cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement software automatic baud rate detection for STM32F407IG?

arduo
Senior

Hi i want to make the automatic baud rate detection for my STM32F407IG, which supports only the software variant. Here is the link where the software variant is described --> https://www.st.com/content/ccc/resource/technical/document/application_note/group0/66/fa/62/a2/5c/75/48/a8/DM00327191/files/DM00327191.pdf/jcr:content/translations/en.DM00327191.pdf 

The Issue here is that it is not really described where and how i should integrate the code showed in Table 5. 

I use the STM32F407IG to communicate with a BMC but the Baud rate between the two is not adjusted.

Thanks for every help!

6 REPLIES 6
julian-poidevin
Associate

I'm also interested by this, can anyone provide some additional information ? Thanks.

Ozone
Lead II

I don't know any STM32 specific code, but auto-baudate detection is nothing new, and nothing complex.

Sender and receiver implicitly agree on a special sync character, i.e. the sender sends this sync character periodically, and checks for an answer.

The receiver measures the timing of incoming sync characters, and maps them to specific baudrates.

If the mapping is successful he answers, thus communication is established.

One can try without specific sync chars, but detection becomes more difficult and error prone.

For STM32, I would probably start with EXTI interrupts on the UART Rx pin, to measure the timing, and TIM unit for measurement.

Upon detection, I would discard the EXTI configuration, and reconfigure the pins to UART.

Sego2
Associate III

Hello,

Was it possible to perform ABR with F4?

Since I think on table 2 it is marked as not being possible :

0693W00000Nrc65QAB.png

Sego2
Associate III

Seen at the AN4908

The 'F4 UART does not implement the automatic baudrate detection in hardware.

You still can do it in the old fashioned way, by measuring duration of incoming pulses and calculating baudrate from it in software. See link in the original post.

JW

Ah okok I i think I get it.

It would be the chapter 4.3 ...

Thank you!