AnsweredAssumed Answered

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

Question asked by Luke Metro on Mar 29, 2018
Latest reply on Mar 31, 2018 by Luke Metro

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?