Electronic – Rowley Crossworks STM32 Start from Reset

armresetstm32l

I am using an STM32F4 with the Rowley CrossStudio for ARM. It is not clear to me how to have the MCU start from int main() on reset (i.e. power up the device). I thought building it in release mode would have done this, but that seems not to be the case.

Looking online, I see some people saying that you somehow change the startup vector but this may prevent future debugging?

Is there a good way to accomplish this so that I can debug if I need to and run my program without the debugger on startup?

Thank you!

Best Answer

On most (but perhaps not all) members of the STM32 family, to automatically boot an application from flash you must ground the BOOT0 pin.

This is essentially so that if you have a bad application in flash, or one that does not provide a means of entering the bootloader, you can force entry to the bootloader by cycling reset with BOOT0 high (with appropriate setting of boot1 or other mode controls to select the bootloader rather than RAM).