1
\$\begingroup\$

I've been reading the information available in ST.com about creating a bootloader for a STM32F0xxx microcontroller, and it says the following:

"The bootloader is automatically activated by configuring the BOOT0 and BOOT1 pins in the specific “System memory” configuration and then by applying a reset."

"In some products, BOOT1 is not an I/O but a bit in the option byte area. This is the case for the STM32F05x and STM32F3xx devices where BOOT1 is configured through nBoot1 bit in the option bytes."

"The hardware required to put the STM32F051xx devices into System memory boot mode consists of any circuitry, switch or jumper, capable of holding the BOOT0 pin high while nBOOT1 bit in the option bytes (starting at address 0x1FFFF800) is set to value 1. The setting of this bit can be done through STLINK utility or an equivalent tool."

So, if I want to load my programs in this microcontroller, I need to set the nBOOT1 bit to 1 by software. But how can I change its value if I hadn't communicated with it yet, as I need to change it before communicating? :S

Then, do I need to buy the STLINK utility if I want to bootload my custom programs? :S

\$\endgroup\$
  • 2
    \$\begingroup\$ An stlink setup will cost you $10... there's one on each of the "Discovery" boards and you don't even need the same variety as the chip you want to work with. Also, likely the internal-only Boot pin is already in a useful state. \$\endgroup\$ – Chris Stratton Jun 10 '13 at 18:12
1
\$\begingroup\$

Section 2.5 of the reference manual states that the system memory (which contains the bootloader factory-loaded into the part) is activated when BOOT0 is maintained high at startup and nBOOT1 is set to 1 (BOOT1 set to 0).

Boot modes

Section 4.1.1 of the same manual states that the default value of nBOOT1 is indeed 1. So it seems that all you need to start the bootloader is to set the BOOT0 pin to high at startup.

enter image description here

Then you can execute the loaded code by setting BOOT0 to low at startup. When BOOT0 is low, the code from the embedded flash is executed irrelevant of the state of nBOOT1.

\$\endgroup\$
0
\$\begingroup\$

nBOOT1 is active by default, so you don't need STLINK, just connect Boot0 to VCC before powerup.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.