Open DragosMiloiuNXP opened 1 year ago
Based on offline discussion, setting "stopAtEntry": true
in the launch.json
seems to resolve this issue.
Hi @benmcmorran,
Unfortunately, this doesn't completely solve the issue. Setting stopAtEntry: true
causes the target to stop before main()
sometimes. More specifically, it stops in the Reset_Handler()
, right where the actual entry point is. It seems that sometimes MIDebugger treats main()
as the entry point and sometimes Reset_Handler()
is treated the entry point.
I've tested this with multiple boards and gdb servers, and the common pattern is the following:
Reset_Handler
(the proper entry point) is treated as the entry point. In this case the debug session first stops here, then the user needs to resume debugging to stop at the breakpoint we placed at main
.main()
as expected.In short, if after target remote
GDB shows a proper function name, it will stop at Reset_Handler
when debugging from vscode.
Remote debugging using :2366
0x000019e2 in USART_ReadBlocking (base=0x40086000, data=0x20032fe7 "", length=1)
at C:/Users/nxf67777/Desktop/sdks7/core/drivers/flexcomm/fsl_usart.c:697
697 while ((base->FIFOSTAT & USART_FIFOSTAT_RXNOTEMPTY_MASK) == 0U)
Resetting target
If instead it shows ??
, it will stop at main
when debugging from vscode.
Remote debugging using :2366
0x20006040 in ?? ()
Resetting target
Environment
Bug Summary and Steps to Reproduce
Bug Summary: [J-Link] Debug session doesn't stop in breakpoint after flash is erased.
Steps to reproduce:
Result: Target doesn't stop at main. From the logs, it seems that the target actually stops, but cppdbg tells it to continue execution. If the debug session is done without erasing the flash first it stops at main as expected.
Debugger Configurations
Debugger Logs
Debug log attached. debug.log
Other Extensions
No response
Additional Information
lpcxpresso55s69_hello_world.zip