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

Unable to connect to nRF52840 on custom board over SWD. "No idcode detected:

Hi, I have a custom board with an nrf52840 onboard I was able to program the nrf52, but then I executed:

% nrfjprog --eraseall

and, 

% nrfjprog --pinreset

and the JLink can no longer communicate with the board.  I get a "No idcode detected" on SES.  I have also tried nrfjprog --recover and it was not successful.  I thought it may be a bad board, but I now have two boards in the same state.

% nrfjprog --family NRF52 --recover
ERROR: JLinkARM DLL reported an error. Try again. If error condition
ERROR: persists, run the same command again with argument --log, contact Nordic
ERROR: Semiconductor and provide the generated log.log file to them.

All tools are the latest.

log.log:

2260.log.log

 

Voltage looks good.  Let me know if there is anything else that can help debug.

Parents Reply
  • DannyB said:
    I am using an external Segger JLink USB-based programmer.

    Have you made sure that this programmer supports the voltage level your board is running at?

    DannyB said:
    However, I did try with the Segger onboard the DK and it was the same result

    This makes sense if the custom board runs at 1.76V. The on-board debugger on the DK does not support level-shifting, meaning it can only program boards running at the DK voltage (normally 3.0 V). 

Children
  • Interesting, I believe the programmer works at 1.8 V, but I don't know for sure.  I am able to use this JLink on boards I haven't erased.  Here is the log of a successful debug session:

    SEGGER J-Link GDB Server V6.86f Command Line Version

    JLinkARM.dll V6.86f (DLL compiled Oct 23 2020 17:50:09)

    Command line: -if swd -device nRF52840_xxAA -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui

    -----GDB Server start settings-----

    GDBInit file:                  none

    GDB Server Listening port:     2331

    SWO raw output listening port: 2332

    Terminal I/O port:             2333

    Accept remote connection:      localhost only

    Generate logfile:              off

    Verify download:               on

    Init regs on start:            on

    Silent mode:                   off

    Single run mode:               on

    Target connection timeout:     0 ms

    ------J-Link related settings------

    J-Link Host interface:         USB

    J-Link script:                 none

    J-Link settings file:          none

    ------Target related settings------

    Target device:                 nRF52840_xxAA

    Target interface:              SWD

    Target interface speed:        1000kHz

    Target endian:                 little

    Connecting to J-Link...

    J-Link is connected.

    Firmware: J-Link V9 compiled Dec 13 2019 11:14:50

    Hardware: V9.10

    S/N: XXXXXXXX

    Feature(s): GDB

    Checking target voltage...

    Target voltage: 1.79 V

    Listening on TCP/IP port 2331

    Connecting to target...

    Connected to target

    Waiting for GDB connection...Connected to 127.0.0.1

    Reading all registers

    Read 4 bytes @ address 0x00000000 (Data = 0x20040000)

    Read 2 bytes @ address 0x00000000 (Data = 0x0000)

    Received monitor command: speed 1000

    Target interface speed set to 1000 kHz

    Received monitor command: clrbp

    Received monitor command: reset

    Resetting target

    Received monitor command: halt

    Halting target CPU...

    ...Target halted (PC = 0x00000100)

    Received monitor command: regs

    R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000

    R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000

    R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000

    R12= 00000000, R13= 20040000, MSP= 20040000, PSP= 00000000

    R14(LR) = FFFFFFFF, R15(PC) = 00000100

    XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000

    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

    Reading all registers

    Received monitor command: speed auto

    Select auto target interface speed (2000 kHz)

    Received monitor command: flash breakpoints 1

    Flash breakpoints enabled

    Received monitor command: semihosting enable

    Semi-hosting enabled (Handle on BKPT)

    Received monitor command: semihosting IOClient 1

    Semihosting I/O set to TELNET Client

    Received monitor command: SWO DisableTarget 0xFFFFFFFF

    SWO disabled successfully.

    Received monitor command: SWO EnableTarget 0 0 0x1 0

    SWO enabled successfully.

    Downloading 16032 bytes @ address 0x0000C020 - Verified OK

    Downloading 16064 bytes @ address 0x0000FEC0 - Verified OK

    Downloading 16016 bytes @ address 0x00013D80 - Verified OK

    Downloading 16064 bytes @ address 0x00017C10 - Verified OK

    Downloading 16096 bytes @ address 0x0001BAD0 - Verified OK

    Downloading 15872 bytes @ address 0x0001F9B0 - Verified OK

    Downloading 16096 bytes @ address 0x000237B0 - Verified OK

    Downloading 16064 bytes @ address 0x00027690 - Verified OK

    Downloading 16064 bytes @ address 0x0002B550 - Verified OK

    Downloading 16016 bytes @ address 0x0002F410 - Verified OK

    Downloading 16032 bytes @ address 0x000332A0 - Verified OK

    Downloading 16320 bytes @ address 0x00037140 - Verified OK

    Downloading 2224 bytes @ address 0x0003B100 - Verified OK

    Downloading 24 bytes @ address 0x0003B9B0 - Verified OK

    Downloading 2200 bytes @ address 0x0003B9C8 - Verified OK

    Comparing flash   [....................] Done.

    Writing register (PC = 0x    c120)

    Read 4 bytes @ address 0x0000C120 (Data = 0x0000F04F)

    Read 2 bytes @ address 0x0000C120 (Data = 0xF04F)

    Read 2 bytes @ address 0x0000C122 (Data = 0x0000)

    Read 2 bytes @ address 0x0000CA8C (Data = 0xB508)

    Reading 64 bytes @ address 0x0002B980

    Read 2 bytes @ address 0x0002B9B2 (Data = 0xF7E1)

    Received monitor command: regs

    R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000

    R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000

    R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000

    R12= 00000000, R13= 20040000, MSP= 20040000, PSP= 00000000

    R14(LR) = FFFFFFFF, R15(PC) = 0000C120

    XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000

    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

    Reading all registers

    Read 4 bytes @ address 0x0000C120 (Data = 0x0000F04F)

    Read 2 bytes @ address 0x0000C120 (Data = 0xF04F)

    Read 2 bytes @ address 0x0000C122 (Data = 0x0000)

  • Here is the log from a failing board:

    ...

    Connecting to J-Link...

    J-Link is connected.

    Firmware: J-Link V9 compiled Dec 13 2019 11:14:50

    Hardware: V9.10

    S/N: 59103743

    Feature(s): GDB

    Checking target voltage...

    Target voltage: 1.80 V

    Listening on TCP/IP port 2331

    Connecting to target...

    ERROR: Could not connect to target.

    Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...

    Shutting down...

  • Ok, I was able to recover both boards.  I had to apply power to the nRF as I was calling:

    nrfjprog --recover  --family NRF52

    But I still don't know the root cause for the problem.  Is it possible the nrfjprog --eraseall put the pin pselreset UICR registers in a weird state?  Also, these nRFs had probably never been programmed/erased before i did it.  

  • Also, now I can't seem to duplicate the problem.  (I tried a couple times on each board)

Related