This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

JLINK V9 cannot download the code.

I Modify my code for 7 buttons from 7 gpios. But my code has a issue at sdk_config.h. The define of GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS is 9. When I built the code and download the code to my target board though Jlink V9. It is OK first time. But it always fail if I want to download code again. Does anyone knows why? How to solve it? Why my error program made the target board cannot re-download again.

  • Error message:

    * JLink Info: Device "NRF52840_XXAA" selected.

    JLink info:
    ------------
    DLL: V6.54c, compiled Nov 7 2019 17:01:02
    Firmware: J-Link V9 compiled May 17 2019 09:50:41
    Hardware: V9.40
    S/N : 59404841
    Feature(s) : RDI, GDB, FlashDL, FlashBP, JFlash

    * JLink Info: InitTarget() start
    * JLink Info: InitTarget() end
    * JLink Info: Found SW-DP with ID 0x2BA01477
    * JLink Info: Could not power-up debug power domain.
    * JLink Info: Scanning AP map to find all available APs
    * JLink Info: AP[1]: Stopped AP scan as end of AP map has been reached
    * JLink Info: AP[0]: AHB-AP (IDR: 0x24770011)
    * JLink Info: Iterating through AP map to find AHB-AP to use
    * JLink Info: AP[0]: Skipped. No ROM table (AHB-AP ROM base: 0x00000000)
    * JLink Info: InitTarget() start
    * JLink Info: InitTarget() end
    * JLink Info: Found SW-DP with ID 0x2BA01477
    * JLink Info: Scanning AP map to find all available APs
    * JLink Info: AP[2]: Stopped AP scan as end of AP map has been reached
    * JLink Info: AP[0]: AHB-AP (IDR: 0x24770011)
    * JLink Info: AP[1]: JTAG-AP (IDR: 0x02880000)
    * JLink Info: Iterating through AP map to find AHB-AP to use
    * JLink Info: AP[0]: Core found
    * JLink Info: AP[0]: AHB-AP ROM base: 0xE00FF000
    * JLink Info: CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    * JLink Info: Found Cortex-M4 r0p1, Little endian.
    * JLink Info: FPUnit: 6 code (BP) slots and 2 literal slots
    * JLink Info: CoreSight components:
    * JLink Info: ROMTbl[0] @ E00FF000
    * JLink Info: ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    * JLink Info: ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    * JLink Info: ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    * JLink Info: ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    * JLink Info: ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    * JLink Info: ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    ***JLink Error: Could not find core in Coresight setup
    ROMTableAddr = 0xE00FF000
    Error: Flash Download failed - Target DLL has been cancelled
    Flash Load finished at 18:51:41

  • Hi,

     

    If the firmware asserts early in the boot-up process (where the default behavior is to do a soft-reset), it can be hard to recover/reprogram the board, as the debugger isn't able to attach fully before the soft-reset occurs again.

     

    Could you try to run "nrfjprog -e -f nrf52" and see if this works?

     

    Kind regards,

    Håkon

  • I try to run "nrfjprog -e -f nrf52", but it also has the error message is as follows. Do you have any other idea to fix it. Maybe connect some pin of hardware to high or low state. I made 2 boards have this issue.  
    ERROR: Cannot connect to any nRF device. Please make sure a device is
    ERROR: connected to the debugger and supplied.

  • I try  to run "nrfjprog -e -f nrf52" for 30 times. It has the messages as follows. Then it can be re-programmed. Thank you very much. By the way, do you have any suggestions to prevent this issue?

    Erasing user available code and UICR flash areas.
    Applying system reset.

  • Glad to hear that you were able to recover. If you get into this scenario in the future, try this loop batch script:

    https://devzone.nordicsemi.com/f/nordic-q-a/45078/nrf52832-not-connected-anymore-after-first-trying-to-debug-keil/177579#177579

     

    Kind regards,

    Håkon

Related