cancel
Showing results for 
Search instead for 
Did you mean: 

IS_USART_BAUDRATE up to 7.5 Mbit/s is wrong for STM32F4xx

Diez.R.
Associate II
Posted on April 21, 2016 at 09:26

Hi all:

On an STM32F407 with the Standard Peripheral Library 1.5.0, I tried to configure USART6 to the documented maximum of 10.5 Mbit/s, and I got an assert in USART_Init().

The problem is here:

#define IS_USART_BAUDRATE(BAUDRATE) (((BAUDRATE) > 0) && ((BAUDRATE) < 7500001))

That definition allows a value up to 7.5 Mbit/s. Is that a bug in the library? I just checked, and the Standard Peripheral Library 1.6.1 has the same values in IS_USART_BAUDRATE().

Thanks in advance,

  rdiez
5 REPLIES 5
Amel NASRI
ST Employee
Posted on April 21, 2016 at 16:11

Hi diez.r,

The issue is reported internally to be fixed in coming versions of STM32F4 Standard Peripheral Library.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on April 21, 2016 at 18:43

These rates seem unreasonably high for an asynchronous link, perhaps you can consider better alternatives?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Diez.R.
Associate II
Posted on April 22, 2016 at 13:36

> These rates seem unreasonably high for an asynchronous

> link, perhaps you can consider better alternatives?

I wanted a synchronous link (with clock signal). I ran out of SPIs, so I am using USART6 as a replacement, even though I will be losing some performance (for each 8 data bits, the additional start and stop bits are wasted because they do not trigger the clock signal, if I understood the documentation correctly).

You call the same function USART_Init() in order to initialise the USART in synchronous mode, right?

Regards,

  rdiez

Posted on April 22, 2016 at 20:07

That and USART_ClockInit() 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 22, 2016 at 20:09

Different family, but might be instructional

STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\USART\Synchronous\main.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..