This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32F302: Stuck in Start up file

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.

Parents
  • 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.

Reply
  • 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.

Children