cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F091 UART Rx DMA failing at high speeds when talking to specific device

Luke Metro
Associate II
Posted on March 29, 2018 at 22:57

In my project, I'm using an STM32F091 MCU to communicate with another ARM processor via UART. The communication rate is 1 MBaud, and I'm using the STM32's DMA in circular mode to receive bytes.

I have been developing the STM32 firmware on a Nucleo board and using an FTDI USB-to-UART cable as a stand-in for the other processor. I have just recently begun to replace the FTDI cable with the other processor, and some transmission problems have arisen.

While the new processor is able to successfully communicate with the STM32 via basic polling (the proper bytes are appearing in RDR, and RXNE is being correctly flagged), the DMA is not activating at Baud rates over 900kBaud when communicating with this specific device.

I am convinced there are no problems with the other processor: Its output is properly decoded by a logic analyzer, and it is able to successfully communicate with the FTDI cable. It is only the DMA transfer that is not occuring: the bytes otherwise appear to be properly received, as the STM32 in polling mode is able to communicate with the new processor. The buffer in memory is not filling up, and the DMA channel's CNDTR register is keeping its initial value.

I have found a workaround: Switching the UART's oversampling from 8 to 16 does make the DMA work normally. I'm not sure why, as in theory the UART and DMA controllers are separate from one another. The DMA error register does not show any errors when I look at it with a debugger.

Even with the workaround, adding a small amount of series resistance (400 ohms total) to the TX and RX lines causes the DMA to stop working at higher frequencies. Both the UART and DMA are using the internal HSI48 clock with prescalers set to 1 (so both are using a 48MHz clock).

It seems like a timing bug to me, but has anyone encountered anything like this before?

#uart-dma #usart-rx
11 REPLIES 11
Posted on March 31, 2018 at 01:06

Yes, the addresses are properly set. 0xB is in DMA_CSELR6. The weird thing is that using the DMA for the UART is working at low speed, but once the speed goes above the 900 kBaud threshold, it stops working, but only (1) when the STM32 is talking to the one specific device and (2) the DMA is being used for reading out the bytes.

I've submitted a technical support message to ST, so I'll keep you in the loop if there are any updates. Thanks for the idea.

LM

Posted on March 31, 2018 at 02:33

I am using a UART connection between the two chips directly at CMOS logic levels. Just resolved the issue - see update for details.