cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to configure the STM32F4 Bootloader USART to use a fixed baud rate?

EBlow.2
Associate

I am using the in-built stm32f4 bootloader to allow software upgrades of the software in the field. However these updates are sometimes failing.

This is due to the in-built baud rate detection sometimes setting an incorrect baud rate. We are unable to detect this in the software so continue with the update regardless which is ultimately leading to the flashing process being aborted due to corruption of the image. This also leaves our devices in an unusable state until the flashing is successful.

Is there any way to either:

  • Configure a static/fixed baud rate on the STM32?
  • Read back the auto-detected baud rate to check its a match before continuing?

2 REPLIES 2

No

Write more robust user facing software.

You can drive BOOT0 and NRST to recover/retry.

The 0x7F is a test pattern that the loader times assuming 8E1 byte formation. It is not receiving it as a byte.

It responds with a 0x79 acknowledgement at the baud rate it measured. You could measure and or confirm this. Or have a simple reset/retry processes to make your solution robust. You can also send other commands to get query type responses which you can also test/evaluate. Should be able to push code into RAM, and run that it suits better.

You can also write your own, far more robust loader in the direct 16KB FLASH sector of the F4 part, that does whatever you want, whoever you want to implement it. Such that it doesn't leave the device in an unrecoverable state, and perhaps resets into a mode offering X-MODEM when the primary app section is deemed unusable/unsafe.

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

You could also push a better loader into one of the outer 128KB sectors. The specific F4 isn't mentioned, but most have 1MB of FLASH on die.

You could then initiate that from the System Loader.

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