0

I buy a stm32 board as picture below, I connect the Boot0 to 3.3 and use the serial port download the program.

I use the library https://github.com/rogerclarkmelbourne/Arduino_STM32

The second and third picture is my program. After I download the program, the led on board shine and the serial is normal, but after I press RESET on board, it is not shine. Seemly, the program vanish.

Why it is so ? And how to let the program in board after press reset ?

enter image description here

enter image description here

enter image description here

2 Answers 2

2

By connecting BOOT0 to 3.3V you are telling the chip When I reset for whatever reason you must go into the bootloader.

So you reset, and it goes into the bootloader. You then upload your sketch.

At that point the programming software tells the bootloader "Ok, you are done now. Run the program". And it does.

Until you reset. And because you are telling it to go into the bootloader with BOOT0 it dutifully does so, waiting for you to load a new program.

The old program is still there, but you just aren't letting run, since you are insisting that the chip go into the bootloader when you reset.

In order to get your program to run and not the bootloader you must disconnect BOOT0 so it doesn't enter the bootloader.

You only need to connect the BOOT0 when you want to put a new program on there.

2

From http://wiki.stm32duino.com/index.php?title=Bootloader

Activating the bootloader is done through forcing two boot pins (and then resetting the MCU). Many boards have one or more boot pins exposed as jumpers or push buttons.

Normal boot (to user firmware, which may be a secondary bootloader):

  • Boot0 LOW
  • Boot1 LOW

Allow firmware upload through USART1:

  • Boot0 HIGH
  • Boot1 LOW

After uploading new software through the serial, move Boot0 back to GND so that the MCU loads the firmware you uploaded, rather than it's internal serial bootloader.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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