cancel
Showing results for 
Search instead for 
Did you mean: 

Bootloader in STM32 MCU.

Shilpashree Madhu
Associate III

What does it mean ->( the bootloader code 

begins to scan the USARTx_RX line pin, waiting to receive the 0x7F data frame: a start bit, 

0x7F data bits, even parity bit and a stop bit.)?

I'm totally confused understanding this line, how to configure it? where & when should I send the 0x7F frame to get the bootloader commands?

2 REPLIES 2
Artur IWANICKI
ST Employee

Hello,

System bootloader within each STM32 is programmed to serve couple of USART interfaces. Complete list of them for particular MCU you can find within application note AN2606. Knowing this you can select any of USART_RX lines and send there serial data within specified bitrate (specified in AN2606 as well) keeping even parity and single stop bit within frame settings. This 0x7F value is used to detect the bitrate by the build it bootloader After this next frames can be properly received by the bootloader on selected interface.

I hope it clarifies your doubts.

Best Regards,

Artur

You can send 0x7F from serial terminal. This demonstration program https://www.st.com/en/development-tools/flasher-stm32.html is sending 0x7F during connection, you can observe it using serial port monitor (sniffer). Bootloader receive multiple 0x7F and measure square wave duration (bits of 0x7F are 0b1111111). Based on this duration actual USART baud rate is estimated/calibrated.

Where: send 0x7F to computer COM port which is connected to USART pin, for example through USB2COM / USB2TTL converter. When: right after powering on or resetting