-
I'm confused as to why it's trying to do a remote session
gdb runs on PC and the debugged code runs on ARM device so it needs to be a bit complicated, there is remote GDB server running somewhere. It can be OpenOCD running on your PC translating gdb commands to SWD/JTAG commands. It can be Segger GDB server for J-Link, it can be even running inside your debug probe for speed (Blackmagic probe has one).
As for debugging Espruino I did it few times but there is issue with nrf52 with BLE stack running - you cannot stop and continue as it breaks Bluetooth timing and device reboots. With bluetooth turned off ( at least
NRF.sleep()
) it is better. But even with bluetooth turned on one can set breakpoint and has one shot at investigating stack trace and variables before rebooting and trying again.I used command line gdb with the elf file which is produced in each build, no extra compile flags are needed. I think the elf file produced by gcc should also work in any IDE but don't have any guide, try Google.
EDIT: see also this post https://forum.espruino.com/conversations/369539/#16249545
-
As for debugging Espruino I did it few times but there is issue with nrf52 with BLE stack running - you cannot stop and continue as it breaks Bluetooth timing and device reboots. With bluetooth turned off ( at least NRF.sleep()) it is better.
So now i think i'm at this step.
When i'm stepping through the program from the very start.
In targets/nrf5x/jshardware.c - once i hit jsble_init() the software crashes. It seems to happen both my NRF52840 dev board and my pinetime. Just in different spots.I just don't know were to stick this NRF.sleep() call?
I'm confused as to why it's trying to do a remote session?