cancel
Showing results for 
Search instead for 
Did you mean: 

Uart vs Usart on DMA

Posted on August 20, 2014 at 18:25

Hi,

I'm complete noob with STM32 but starting to get the hang of things.

I have problem that got me completly stumped now.  I have simple code that sends string over Uart4 . When using polling or _IT the string is represented perferctly on the other side, but using _DMA transmit then the first byte is simply repeated up to string length.

Using the same code and sending over USART1, then it works fine on DMA.

Is there a internal limit that DMA over Uart can only sent 1 byte and one have to use Usart for strings?

This is using f3cube Hal library's.  I tried to find examples of Uart coms, but all are based on Usart.

Any pointers/help appreciated.

Thanks

L:
2 REPLIES 2
Posted on August 20, 2014 at 20:03

Can't help you with the HAL, but UART and USART performance with DMA should be identical, the UART just lacks the synchronous clocking mode.

Some of the STM32 don't support DMA on all UART, you'd want to review the Reference Manual to confirm unit/channel/stream specifics.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 20, 2014 at 21:00

Thanks Clive

Went to get some food and have break after 12 hrs of sitting with same issue and read the manual properly regarding DMA settings, not Uart...

Problem solved with:   hdma_uart4_tx.Init.MemInc =

DMA_MINC_ENABLE

From the Manual: 

Peripheral and memory pointers can optionally be automatically post-incremented after each transaction depending on the PINC and MINC bits in the DMA_CCRx register. If incremented mode is enabled, the address of the next transfer will be the address of the previous one incremented by 1, 2 or 4 depending on the chosen data size.