hi we are using STM32L152RET6.what is boot0 meant for and what should i connect
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.
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.
Hi KIC8462852 EPIC204278916,
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!
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.
Here the example for STM32F405/407
Hi romain reicher ,
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:stackexchange.
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!
Yes BOOT0 tied to 0V
Thank you romain reicher!
This completely solves my issue.
Retrieving data ...