cancel
Showing results for 
Search instead for 
Did you mean: 

Keil Debug stops at the beginning

CGali.2
Associate III

Hello. I am programming a stm32wb55rg Nucleo and the debug was working as expected. A few days ago I decided to add the trace functionallity that the BLE packet has in these microcontrollers. Since then when I want to run the code I have to push for four times the button of "start running code" until it works. I have delete all breakpoints on the project and I have check all the files (.c and .h) and I am not able to see the yellow arrow that indicates where the code is being executed. Do you know what could be happening?. Thanks a lot for your time. (Keil version: 5.28.0 CubeMX version 6.3.0)

2 REPLIES 2

Hard to say.

If you've added code in the SystemInit() function it can be in there before reaching main()

You could uncheck the "run to main" option and follow the code from reset.

Watch if it is stuck in the erase/program stage before the debugger starts.

Perhaps try a full erase.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
CGali.2
Associate III

Hi Tesla DeLorean. I have checked with the GitCracken comparator if the code in SystemInit() is changed, but it seems like it is not. I have disable the option "Run to main", but the code didn't stop at the first instruction of the code. I have seen some changes in the startup file (the assembly code at the bottom). I dont know if they are realted, but I didn´t find the way to change them. ¿Do you know if it could be the problem?.Thanks for your response and for your time.

Pd: I did't understand the third thing you propose in your first message 😅

BEFORE ENABLE TRACES
 
 151 00000000                 IMPORT           SystemInit
  152 00000000                 IMPORT           __main
  153 00000000         
  154 00000000 4806            LDR              R0, =SystemInit
  155 00000002 4780            BLX              R0
  156 00000004 4806            LDR              R0, =__main
  157 00000006 4700            BX               R0
  158 00000008                 ENDP
  159 00000008    
 
AFTER ENABLE TRACES
 
151 00000000                 IMPORT           SystemInit
  152 00000000                 IMPORT           __main
  153 00000000         
  154 00000000 4809            LDR              R0, =SystemInit
  155 00000002 4780            BLX              R0
  156 00000004 4809            LDR              R0, =__main
  157 00000006 4700            BX               R0
  158 00000008                 ENDP
  159 00000008