cancel
Showing results for 
Search instead for 
Did you mean: 

Hi what is boot0 in stm32

chaitanya jasti
Associate II
Posted on February 25, 2017 at 06:55

hi we are using STM32L152RET6.what is boot0 meant for and what should i connect

8 REPLIES 8
S.Ma
Principal
Posted on February 25, 2017 at 09:06

First time the STM32 is powered up (and reset line is released), an internal bootcode (bootloader) will kick in first and check if the flash is blank. If the flash is blank, the bootloader will enable and listen for some peripherals (some UART/I2C/SPI/USB) to communicate with the external world as a mean to download and flashing the device.

If the flash is not blank, the user code in the flash will start.

If boot0 is tied high, the bootloader will assume the flash is blank.

Another way to program the flash of the microcontroller is by debugger (ST Link) through SWD or JTAG.

On STM8 MCU due to low pincount, the bootloader does not have a boot0 pin and instead the bootloader will be listening for communication for a single second after reset line is released.

Posted on February 25, 2017 at 11:09

First time the STM32 is powered up (and reset line is released), an internal bootcode (bootloader) will kick in first and check if the flash is blank. If the flash is blank, the bootloader will enable

This does not apply universally to all STM32, only to the newer ones - in particular, in the 'L1 this is not implemented.

For an exhaustively detailed list, see Table 2. Bootloader activation patterns in AN2606.

JW

Posted on March 03, 2018 at 18:04

Hi

Centauris.Alpha

‌,

Just to double check on this, I plan on programming through SWD and my MCU has a boot0 pin. I did read the an2606 application note, reference manual etc. Although it still seems a little unclear.

Is there any point for me to consider this boot pin if I'm programming through SWD?

Thanks in advance for any help!

Posted on March 03, 2018 at 18:59

Hi piet t

Most of STM32 familly have BOOT0 pin and recent device have both BOOT0 pin and BOOTn user option bytes.

Check the reference manual of your device.

By default, if your firmware is programmed in FLASH (when using SWD) BOOT0 = GND 

If BOOT0 = VDD you can enter in bootloader mode or relocate your code in SRAM.

KR

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 March 03, 2018 at 19:03

Here the example for STM32F405/407

0690X00000609mOQAQ.png

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 March 03, 2018 at 19:56

Hi

reicher.romain

,

Thank you for the reply!

So if I'm using the SWD to program the device and want to have the code stored in flash, I just tie boot0 to 0V?

I think this lead to the confusion:

/external-link.jspa?url=https%3A%2F%2Felectronics.stackexchange.com%2Fquestions%2F336677%2Fdo-i-really-need-to-put-stm32-microcontroller-into-bootloader-mode-to-program-it

.

Which seemed to imply using the boot loader pin was only necessary when programming the device via uart.

Thank for the clarification and help.

I really appreciate it!

Posted on March 03, 2018 at 20:28

Yes BOOT0 tied to 0V

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 March 03, 2018 at 20:31

Thank you

reicher.romain

!

This completely solves my issue.