2014-08-20 09:25 AM
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:2014-08-20 11:03 AM
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.2014-08-20 12:00 PM
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.