What binary is suitable for debugging

Posted on
  • Hi

    I'm trying to investigate the NFC issues on my Puck. So I've attached a J-Link using SWD.
    The connection is stable and I can flash and debug using JLinkExe.

    However I'd prefare a more advanced interface with symbol names and so on ;-).
    So I switched to JLinkGDBServer and arm-gdb. I'm using the espruino built by
    DFU_UPDATE_BUILD=1 BOARD=PUCKJS RELEASE=1 make. (I've tried ELFs built by DFU_UPDATE_BUILD=1 BOARD=PUCKJS DEBUG=1 make, but do not fit into flash.)

    For some reason gdb always tries to accesses the SoftDevice area and in particular 0x00000000 and fails (read protection?) instead of 0x1f000 and up. I assume I'm missing some magic Switch. Any suggestions or a working gdbinit are welcome.

  • I use JLinkGDBServer too and my gdbinit is something like this:

    target extended-remote :4242
    file espruino_1v92.12_nrf52832.elf
    break Reset_Handler
    break HardFault_Handler
    

    If you edit boards/PUCKJS.py and rip out some of the libraries you don't want like NET and GRAPHICS, you can then build with DEBUG=1 which will help you loads :)

    It should work fine - the real gotcha is that the softdevice has a watchdog timer in it, and if you break into something with GDB, the watchdog will fire. The second you then try and continue execution the CPU will restart.

    As far as I know there's no real way around that - it's just one of the nightmares of trying to develop embedded stuff.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

What binary is suitable for debugging

Posted by Avatar for AntiCat @AntiCat

Actions