<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Simple USART transmit with DMA does not work, suggestions?</title>
		<link>http://forums.leaflabs.com/topic.php?id=1719</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:08:23 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1719" rel="self" type="application/rss+xml" />

		<item>
			<title>JL2010 on "Simple USART transmit with DMA does not work, suggestions?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1719#post-10670</link>
			<pubDate>Tue, 15 May 2012 14:20:52 +0000</pubDate>
			<dc:creator>JL2010</dc:creator>
			<guid isPermaLink="false">10670@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I'm using 8-bits for both.&#60;/p&#62;
&#60;p&#62;Here's a reference in case someone needs it in the future: &#60;a href=&#34;http://pastebin.com/7JneG8d4&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/7JneG8d4&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rod on "Simple USART transmit with DMA does not work, suggestions?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1719#post-10667</link>
			<pubDate>Tue, 15 May 2012 12:25:13 +0000</pubDate>
			<dc:creator>Rod</dc:creator>
			<guid isPermaLink="false">10667@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;How about the transfer sizes? Are you using something other than the 8 bits at both ends that's in your example?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JL2010 on "Simple USART transmit with DMA does not work, suggestions?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1719#post-10666</link>
			<pubDate>Tue, 15 May 2012 12:15:13 +0000</pubDate>
			<dc:creator>JL2010</dc:creator>
			<guid isPermaLink="false">10666@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;No, simply calling dma_enable() started it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rod on "Simple USART transmit with DMA does not work, suggestions?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1719#post-10665</link>
			<pubDate>Tue, 15 May 2012 12:13:21 +0000</pubDate>
			<dc:creator>Rod</dc:creator>
			<guid isPermaLink="false">10665@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Did you need to start it manually with the first character as well?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JL2010 on "Simple USART transmit with DMA does not work, suggestions?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1719#post-10664</link>
			<pubDate>Tue, 15 May 2012 12:11:41 +0000</pubDate>
			<dc:creator>JL2010</dc:creator>
			<guid isPermaLink="false">10664@http://forums.leaflabs.com/</guid>
			<description>&#60;blockquote&#62;&#60;p&#62;USART1_TX is channel 4 on DMA1.&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;Rod, that was it!  Thank you so much.  I overlooked that and thought I could use an arbitrary channel.  I'll have to read that part of the reference manual and become more familiar with it such that I can manage my channels for DMA + peripheral usage going forward.&#60;/p&#62;
&#60;p&#62;Thanks a lot guys.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rod on "Simple USART transmit with DMA does not work, suggestions?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1719#post-10663</link>
			<pubDate>Tue, 15 May 2012 11:48:30 +0000</pubDate>
			<dc:creator>Rod</dc:creator>
			<guid isPermaLink="false">10663@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;How about this, then...&#60;/p&#62;
&#60;p&#62;USART1_TX is channel 4 on DMA1.&#60;/p&#62;
&#60;p&#62;Also, I notice robodude sets up the USART after the DMA.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JL2010 on "Simple USART transmit with DMA does not work, suggestions?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1719#post-10662</link>
			<pubDate>Tue, 15 May 2012 10:40:12 +0000</pubDate>
			<dc:creator>JL2010</dc:creator>
			<guid isPermaLink="false">10662@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Marti and Rob, I tried the two suggestions like so: &#60;a href=&#34;http://pastebin.com/b2AgNTsv&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/b2AgNTsv&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Changed peripheral size to 32-bit, tried 16-bit as well.  Writing the first byte in manually only makes the first byte 't' show up on my PC terminal, no further activity so it looks like DMA is not taking over with the rest. It still continues on to blinky.&#60;/p&#62;
&#60;p&#62;I forgot to add the pin modes on the last example, they're back in at the top of main now.&#60;/p&#62;
&#60;p&#62;EDIT: for whatever its worth, I found this old example: &#60;a href=&#34;https://github.com/robodude666/libmaple/blob/f477ed289e8412e373a981a0bc84abc18529fdcd/examples/dma-advanced.cpp&#34; rel=&#34;nofollow&#34;&#62;https://github.com/robodude666/libmaple/blob/f477ed289e8412e373a981a0bc84abc18529fdcd/examples/dma-advanced.cpp&#60;/a&#62; where they looped and printed ADC readings out the USART all DMA driven.  The sizes used in his initialization were 8-bit, although I don't know if this example ever worked as its not a part of the current version.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rod on "Simple USART transmit with DMA does not work, suggestions?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1719#post-10661</link>
			<pubDate>Tue, 15 May 2012 10:17:28 +0000</pubDate>
			<dc:creator>Rod</dc:creator>
			<guid isPermaLink="false">10661@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Good to have you back Marti.&#60;/p&#62;
&#60;p&#62;I agree with the peripheral size comment.&#60;/p&#62;
&#60;p&#62;My suggestion is to send the first character manually as I suspect the DMA transfers gets triggered on transmit buffer empty.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "Simple USART transmit with DMA does not work, suggestions?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1719#post-10657</link>
			<pubDate>Tue, 15 May 2012 10:00:52 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">10657@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;RM0008 says the registers can only be accessed as 16- or 32-bits:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
The peripheral registers can be accessed by half-words (16-bit) or words (32-bit).
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;Have you tried &#60;code&#62;DMA_SIZE_32BITS&#60;/code&#62; instead of &#60;code&#62;DMA_SIZE_8BITS&#60;/code&#62; for the peripheral size?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JL2010 on "Simple USART transmit with DMA does not work, suggestions?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1719#post-10654</link>
			<pubDate>Tue, 15 May 2012 00:48:25 +0000</pubDate>
			<dc:creator>JL2010</dc:creator>
			<guid isPermaLink="false">10654@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I've gone back and forth between the datasheet and libmaple API for half a day trying to get DMA transmit to work right.  I haven't had any success unfortunately.&#60;/p&#62;
&#60;p&#62;Here is what I have so far: &#60;a href=&#34;http://pastebin.com/6fPptpvL&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/6fPptpvL&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The code simply tries to send one short string out before entering a blinky loop.  The blinky loop is just there to tell me if it got hung up on the DMA initialization or not (which it doesn't - it continues on to blinky just fine).&#60;/p&#62;
&#60;p&#62;This is strait C out of libmaple.  I've tested my own interrupt driven USART TX successfully already (along with many other peripherals - so I'm pretty sure the build system or reference to libmaple is not the issue) and was trying to get a DMA solution to work but with no luck so far.&#60;/p&#62;
&#60;p&#62;Here's what I've gathered from the datasheet:&#60;br /&#62;
1. USART must have DMAT bit enabled in CR3 (DMA transmit)&#60;br /&#62;
2. DMA must be set up for memory to peripheral, USART data register as the peripheral address, the start of my buffer for memory address, 8-bit sizes for each, auto-increment memory address, and interrupt on completion.&#60;br /&#62;
3. Number of transfers set to the length of my test buffer&#60;/p&#62;
&#60;p&#62;After calling DMA enable, I can't seem to get any activity on the USART.  I must be missing something obvious, any help or another set of eyes would be much appreciated.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
