We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am running version Keil 4.73 and writing code for a STM32F302. I am running through an issue where when using the debugger I am unable to exit the file "staurtup_stm32f302xc.s". If I flash the controller its fine(I have a CAN section and see data transmitted when not in debug mode).
When I click on the debug icon, the application open up at "LDR R0, =SystemInit" (Normally it start at the first line of Main())in the "staurtup_stm32f302xc.s" and will step down to "BX R0"and will stay there forever.
Sometimes if I move my code around a little(I don't delete only move) it will work for a while. Then I make a change and I am locked into the start up file again.
Thanks for any help.
Might want to check the "Run to main()" and "Update Target before Debugging" options.
If you stop it where is it? Stuck in a while(1) for the Hard Fault, or Default Handler?
Probably also want to look at the stack allocation, and if the FPU has been enabled (usually in SystemInit), and whatever is being done in SystemInit() and the functions it calls.
The __main function typically zeros and copies the statics, depending on the data it might also decompress it, then calls your main() function.
I had similar expirience. Try to disable all of your breakpoints; that happens if there are to many of them.
I just verified I do have Run to Main() and Update target before debugging set.
Thanks, it looks like you solved my problem.