[ABANDONED] Debugging with JLinkGDBserver - How is the erase size determined

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ABANDONED] Debugging with JLinkGDBserver - How is the erase size determined

    We are debugging a Bootloader on an NXP lpc55s06 device and when launching the debugger, it erases the the size of the debugger + 1 extra sector of the application. How is the erase size determined?

    In our situation, we have a bootloader from 0 - 0x8FFF, and the application from 0x9000 and above. I then launch the debugger to debug the bootloader, but the first sector of the application is erased. The other sectors of the application have been confirmed to be okay and untouched by launching the debugger. We have also confirmed that the elf file the debugger is pointing to is filled completely to the 0x8FFF but not over, and the sector sizes are 0x200, so it seems like it should be able to work without touching the application sectors. But for some reason the sector from 0x9000-0x9199 is erase as well.

    We are using vscode with the cortex-debug extension.
    Is there anyway to limit the erase size or conclusively determine what sectors are being erased by the jlinkgdbserver?
  • It seems like the extra sector is being erased whenever an erase call is done with the JLink. So JFlash and JLink commander both do the same thing. If I do an internal erase or use the nxp ISP interface, then the behavior is as expected.

    Maybe there is something in the erase abstraction that is causing an extra sector to erase?