I am using uVision V5.15.0 and built an generic M4 based project with "Hello World" program. Set "Use Simulator" and "Run to main()" in Debug tab, built code and started Debug Session, but debugger does not stop at main() rather stopped at the following line.
LDR R0, =SystemInit
My question is why the tool does run to main() as the Options promised? What else it needs to be done to make the debugger runs to main()?
Probably because it breakpoints at main() but never gets there?
Which I guess would mean it's stuck somewhere in SystemInit() waiting for something to happen. So look at the code in SystemInit, turn off "Run to main" and step through the stuff until you figure out what's actually happening.
If I put break point at main and F5 run, debugger can run to break point. That proofs the "Run to main" seems not working in simulator with no additional setting. I even added debug script with one line "g main" or "g, main" and neither works although the IDE showed the following messages in command window. Load "C:\\projects\\Keil\\run2Main\\Objects\\run2Main.axf" Include "C:\\projects\\Keil\\run2Main\\debug.ini" /*-------------------------------------------*/ /* Run the Program (stop at main) */ /*-------------------------------------------*/ g main