cancel
Showing results for 
Search instead for 
Did you mean: 

Programming firmware on STM32F412.

JDrei
Associate

We need to be able to program a new board with firmware as well as update the firmware...both using USB. What do BOOT0 and BOOT1 need to be? We currently have BOOT0 low to boot from system memory. If updating firmware, how do we get the bootloader running? And, if we change the boot resistors, will the board still boot from system memory if it's programmed?

2 REPLIES 2
Uwe Bonnes
Principal II

BOOT0 low means boot from flash. So you have a problem with initial programming. Have a look at AN2606. With Boot0(pin) = 1 and Boot1(pin) = 0 you will always boot bootloader. So you have to switch Boot0(pin) for initial programming and back afterwards. Additional you will need code in your application that sets some flag, e.g. a pattern in RAM that your compiler does not initialize and on boot request set that pattern, reset the chip from inside the programm and early on boot read that pattern and switch system memory and jump to bootloader.

JDrei
Associate

Ok, so I can't change Boot0. It must stay low so board will boot from system memory. We'll have to use JTAG to program initially.

Is there sample code for launching bootloader from user application? Then we will use DFUSe Demo to program the firmware via USB.