How to have my program run when I push the reset button on my nucleo ?
Hello,
I'd developing on a Nucleo STM32L152.
For now I managed to assemble a small program that turns on a LED. When I flash the program using the command:
$ st-flash write main.bin 0x8000000The program is flashed to, I guess, the flash memory of the microcontroller and then the user LED illuminates, so I guess my program is launched. That is good. Ultimately though, I'll want to be able to run my program without having to flash it before each use. Ultimately, I'll even want to run my program without any USB power, by powering the nucleo on a 3V battery.
So I'd like to learn how to configure the nucleo so that it starts my program each time I push the reset button.
I've been reading at boot options here:
From this I infer, that if I could set the boot0 pin to 0, and the nBFB2 option bit to 1, the device would boot on flash memory and so maybe that would work, my program would be launched when I push reset. I'm not sure about this theory but this is my theory so far.
I'd like to try what I just described but there are two obstacles for me.
First, I can't set boot0 pin to 0, because I have no idea how to set a pin to 0.
Second I can't envision how I could set the nBFB2 option bit to 1 for two reasons: first I don't know where that bit is. Second I don't know how to set its value before running any program.
Any help would be greatly appreciated.
