2021-12-04 04:50 AM
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)
2021-12-04 05:38 AM
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.
2021-12-05 03:21 AM
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 :grinning_face_with_sweat:
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