Skip to main content
LCE
Principal II
April 7, 2026
Solved

Internal bootloader - UART further timing specs / info

  • April 7, 2026
  • 3 replies
  • 154 views

Heyho,

I think I need some more info about the internal bootloader ("BL") which I didn't find in AN2606 or AN3155 (UART).

 

a) Are all BL interfaces active / scanned at the same time, and any interface finding any change in level will be "chosen"?

From what I have found, it is crucial to keep unused IOs "quiet".

 

b) Does the BL have some "start-up timeout", meaning that it will stop scanning the IOs, and / or jump to the application?

 

Thanks in advance!

Best answer by TDK

> c) This is working with interrupts (it seems), so basically if the STM32 is in bootloader mode, all IOs are quiet, and then some time comes the start byte over UART once, it will switch to UART?

It doesn't use interrupts except for USB DFU. Otherwise, yes.

 

> d) From the AN3155 description it looks the start byte must come only once, so it gets the timing right?
Or would it be okay to send out the start byte in intervals (which probably should be longer than the minimum baud rate x9) until an ACK is received?

Sending it out repeatedly is fine. It will respond to the first one. If it doesn't respond, it's either not in the bootloader or a peripheral has already been selected so any pulses sent will either be ignored or look like an invalid command.

 

3 replies

Uwe Bonnes
Chief
April 7, 2026

a:

There were request before  to ST to document the bootloader better but all that is pubished to long is in AN2606 and 3155. So bootloader related pins not quiet can result in unexpected behaviour. Use your own bootloader if documented behaviour is needed.

b:

I never saw a timeout and I suspect that such a behaviour would be documented.

TDK
Super User
April 7, 2026

a) Yes, they're scanned in serial. If you are using one, you will need the others to be quiet. This is for the C0 which has only two devices but the others are similar.

Screenshot 2026-04-07 103606.png

b) No, there is not a timeout. It scans forever, as you can see in the flowchart.

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
LCE
LCEAuthor
Principal II
April 7, 2026

Thanks so far!

The flowcharts in AN2606, forgot about / overlooked these.

It looks like using ST's bootloader might not be faster than building my own...

 

Nevertheless, more questions about the IO scanning:

c) This is working with interrupts (it seems), so basically if the STM32 is in bootloader mode, all IOs are quiet, and then some time comes the start byte over UART once, it will switch to UART?

d) From the AN3155 description it looks the start byte must come only once, so it gets the timing right?
Or would it be okay to send out the start byte in intervals (which probably should be longer than the minimum baud rate x9) until an ACK is received?

 

TDK
TDKBest answer
Super User
April 7, 2026

> c) This is working with interrupts (it seems), so basically if the STM32 is in bootloader mode, all IOs are quiet, and then some time comes the start byte over UART once, it will switch to UART?

It doesn't use interrupts except for USB DFU. Otherwise, yes.

 

> d) From the AN3155 description it looks the start byte must come only once, so it gets the timing right?
Or would it be okay to send out the start byte in intervals (which probably should be longer than the minimum baud rate x9) until an ACK is received?

Sending it out repeatedly is fine. It will respond to the first one. If it doesn't respond, it's either not in the bootloader or a peripheral has already been selected so any pulses sent will either be ignored or look like an invalid command.

 

"If you feel a post has answered your question, please click ""Accept as Solution""."