# Rowley Crossworks STM32 Start from Reset

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!

• What is the state of the BOOT0 pin? This controls the startup mode of most members of the STM32 family. – Chris Stratton Mar 2 '18 at 19:49
• Aha! By grounding the BOOT0 pin I was able to make this work. This is a good hardware solution, but shouldn't I still be able to programmatically make this work? – Biff Mar 4 '18 at 0:32
• No, you have to use the pin, or else have something else command it to jump to flash. – Chris Stratton Mar 4 '18 at 1:14

• So I tried #define STARTUP_FROM RESET 1 in my main.c file but it didn't seem to work? – Biff Mar 2 '18 at 18:59
• Defining it in Startup.s does not work, and adding STARTUP_FROM_RESET in global macros does not work either. – Biff Mar 4 '18 at 0:11