AnsweredAssumed Answered

STM32CubeMX USART Limitation/Bug Report

Question asked by Greg Fundyler on Jul 6, 2017

Hi. I have noticed that STM32CubeMX has some limitations when configuring a USART for synchronous mode. I am using a STM32F413RGTx running at 100 MHz.

 

I am configuring USART3 for synchronous transmit/receive (pseudo SPI master mode) and would like it to run as fast as possible. The HAL sets the OVER8 bit with the following comment in USART_SetConfig:

Force OVER8 bit to 1 in order to reach the max USART frequencies

So this is not even a user-configurable option. This is great because it means that USART3 should be able to run at 6250000 baud. However, CubeMX does not allow me to set a value greater than 3125000. I have tried setting the value to 6250000 in the code and, as expected, it works fine. Anything higher fails immediately. When configuring the peripheral in asynchronous mode and explicitly setting 'Over sampling' to '8 Samples' CubeMX allows 6250000 baud. So I believe CubeMX should allow 6250000 in synchronous mode as well.

 

Next, I am trying to configure USART6 for synchronous transmit-only operation. I need only USART6_TX and USART6_CK. But once again, I have hit a limitation in CubeMX. I cannot select 'Synchronous' because it attempts to allocate USART6_RX as well, which is unavailable. So I cannot use CubeMX to configure this peripheral properly. The closest I can get is 'SmartCard with Card Clock' which allocates the correct pins, but it configures USART6_TX in Open Drain mode and, of course, the peripheral configuration is completely wrong for what I need. I believe the same limitation applies to Asynchronous mode; in that it allocates both TX and RX even if you configure the peripheral for transmit-only or receive-only.

 

Am I incorrect about either of these? Is there a way to configure them properly that I have not discovered?

 

Thank you,

Greg Fundyler

Outcomes