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

Can't connect to custom nrf52 board with J-LINK

We come from here : 

https://devzone.nordicsemi.com/f/nordic-q-a/35180/error-with-nrf52dk-and-mac-os-hs

Now, i have a new development kit and i can program it but now i have a problem with the J-LINK connection, i cant connect with my nordic 58323 custom board 

I have tried from j-link, and j-link commander, and nrfjprog --recover, nothing works :( 

I have tried with a few usb wires too, and a few laptops with differents environments (windows, mac)

Here is the  nrfjprog --recover log :

nrfjprog --recover --log

nrfjprog version 9.7.3

--------------------------------------------------------------------------------

nRF_open_dll

. nRF52_open_dll

. . nRF52_dll_version

nRF_enum_emu_snr

. nRF52_enum_emu_snr

. . nRF52_enum_emu_snr

nRF_enum_emu_snr

. nRF52_enum_emu_snr

. . nRF52_enum_emu_snr

nRF_connect_to_emu_with_snr

. nRF52_connect_to_emu_with_snr

. . nRF52_is_connected_to_emu

. . nRF52_enum_emu_snr

. . nRF52_connect_to_emu_with_snr

. . . nRF52_connect_to_emu_without_snr

. . . nRF52_connect_to_emu_without_snr: JLink: Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 12 2018 16:05:20

. . . nRF52_connect_to_emu_without_snr: JLink: Hardware: V1.00

. . . nRF52_connect_to_emu_without_snr: JLink: S/N: 682010721

. . . nRF52_connect_to_emu_without_snr: JLink: TELNET listener socket opened on port 19021

. . . nRF52_connect_to_emu_without_snr: JLink: WEBSRV  Starting webserver

. . . nRF52_connect_to_emu_without_snr: JLink: (0015ms, 0020ms total) 

. . . nRF52_connect_to_emu_without_snr: JLink: TADEA7380 000:006

. . . nRF52_connect_to_emu_without_snr: JLink: WEBSRV Webserver running on local port 19080

. . . nRF52_connect_to_emu_without_snr: JLink: (0015ms, 0020ms total) 

. . . nRF52_connect_to_emu_without_snr: JLink: TADEA7380 000:006

. . . nRF52_connect_to_emu_without_snr: JLink:   returns O.K.

. . . nRF52_connect_to_emu_without_snr: JLink: (0016ms, 0021ms total) 

. . . nRF52_connect_to_emu_without_snr: JLink: TADEA7380 000:022

. . . nRF52_connect_to_emu_without_snr: JLink: JLINK_GetHWStatus(...)

. . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x00

. . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0021ms total) 

. . . nRF52_connect_to_emu_without_snr: There is no generic nRF52 device in J-Link, so we select NRF52832_xxAA.

. . . nRF52_connect_to_emu_without_snr: JLink: TADEA7380 000:023

. . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("Device = NRF52832_xxAA", ...).

. . . nRF52_connect_to_emu_without_snr: JLink: /Applications/SEGGER/JLink/JLinkDevices.xml evaluated successfully.

. . . nRF52_connect_to_emu_without_snr: JLink: Device "NRF52832_XXAA" selected.

. . . nRF52_connect_to_emu_without_snr: JLink: Device "NRF52832_XXAA" selected.

. . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x00

. . . nRF52_connect_to_emu_without_snr: JLink: (0267ms, 0288ms total) 

. . . nRF52_connect_to_emu_without_snr: JLink: TADEA7380 000:290

. . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("SetRestartOnClose = 0", ...).

. . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x01

. . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0288ms total) 

. . . nRF52_connect_to_emu_without_snr: JLink: TADEA7380 000:290

. . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("DisableFlashDL", ...).

. . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x00

. . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0289ms total) 

. . . nRF52_connect_to_emu_without_snr: JLink: TADEA7380 000:291

. . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("SetDbgPowerDownOnClose = 1", ...).

. . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x01

. . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0289ms total) 

. . . nRF52_connect_to_emu_without_snr: JLink: TADEA7380 000:291

. . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).

. . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x00

. . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0289ms total) 

. . . nRF52_connect_to_emu_without_snr: JLink: TADEA7380 000:291

. . . nRF52_connect_to_emu_without_snr: JLink: JLINK_TIF_Select(JLINKARM_TIF_SWD)

. . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x00

. . . nRF52_connect_to_emu_without_snr: JLink: (0004ms, 0293ms total) 

. . . nRF52_connect_to_emu_without_snr: JLink: TADEA7380 000:295

. . . nRF52_connect_to_emu_without_snr: JLink: JLINK_SetSpeed(4000)

. . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0294ms total) 

nRF_recover

. nRF52_recover

. . nRF52_is_connected_to_emu

. . nRF52_is_connected_to_emu: JLink: TADEA7380 000:297

. . nRF52_is_connected_to_emu: JLink: JLINK_IsOpen()

. . nRF52_is_connected_to_emu: JLink:   returns 0x01

. . nRF52_is_connected_to_emu: JLink: (0000ms, 0294ms total) 

. . nRF52_is_connected_to_device

. . nRF52_is_connected_to_device: JLink: TADEA7380 000:297

. . nRF52_is_connected_to_device: JLink: JLINK_IsConnected()

. . nRF52_is_connected_to_device: JLink:   returns FALSE

. . nRF52_is_connected_to_device: JLink: (0000ms, 0294ms total) 

. . nRF52_readback_status

. . . nRF52_is_ctrl_ap_available

. . . . nRF52_read_access_port_register

. . . . . nRF52_coresight_configure

. . . . . nRF52_coresight_configure: JLink: TADEA7380 000:298

. . . . . nRF52_coresight_configure: JLink: JLINK_CORESIGHT_Configure()

. . . . . nRF52_coresight_configure: JLink:   returns 0

. . . . . nRF52_coresight_configure: JLink: (0102ms, 0396ms total) 

. . . . . nRF52_power_debug_and_system_regions

. . . . . . nRF52_write_debug_port_register

. . . . . . nRF52_write_debug_port_register: JLink: TADEA7380 000:402

. . . . . . nRF52_write_debug_port_register: JLink: JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)

. . . . . . nRF52_write_debug_port_register: JLink:   returns -1

. . . . . . nRF52_write_debug_port_register: JLink: (0001ms, 0398ms total) 

. . . . . . nRF52_write_debug_port_register: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1.

. . . . . nRF52_power_debug_and_system_regions: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.

nRF_close_dll

. nRF52_close_dll

. . nRF52_is_connected_to_emu

. . nRF52_is_connected_to_emu: JLink: TADEA7380 000:405

. . nRF52_is_connected_to_emu: JLink: JLINK_IsOpen()

. . nRF52_is_connected_to_emu: JLink:   returns 0x01

. . nRF52_is_connected_to_emu: JLink: (0000ms, 0398ms total) 

. . nRF52_disconnect_from_emu

. . . nRF52_is_connected_to_device

. . . nRF52_is_connected_to_device: JLink: TADEA7380 000:406

. . . nRF52_is_connected_to_device: JLink: JLINK_IsConnected()

. . . nRF52_is_connected_to_device: JLink:   returns FALSE

. . . nRF52_is_connected_to_device: JLink: (0000ms, 0399ms total) 

. . . nRF52_unpower_debug_and_system_regions

. . nRF52_disconnect_from_emu: JLink: TADEA7380 000:419

. . nRF52_disconnect_from_emu: JLink: JLINK_Close()

can anyone help me ?

  • Hi,

     

    Are you using P19 (2x5 pin header, top left corner) or P20 (1x8 pin header, just above the SEGGER IC)?

    If using P20, please follow this schematic: https://devzone.nordicsemi.com/f/nordic-q-a/14058/external-programming-using-nrf52-dk/53757#53757

    If using P19 (DEBUG OUT), then connect the 10 pin SWD cable, as well as VDD and GND, to your custom board.

     

    Best regards,

    Håkon

  • Hello, thanks for your reply !! 

    My custom board is powered with external supply and, i have tested it that i have +3v between VDD and GND

    I have connected the custom board with the following configuration on port 20:

    nRF52-DK            Custom Board
    
    
    VDD ------+-------------> VDD
             /
    VTG ----+
    
    GND ------------+-------> GND
                   /
    GND DETECT ---+
    
    SWD IO -----------------> SWD IO
    
    SWD CLK ----------------> SWD CLK


    With same behavior, I cant program it.

    I also tried: 

    nRF52-DK            Custom Board
    
    
    VDD ------+-------------> VDD
             /
    VTG ----+
    
    GND DETECT -----+-------> GND
                  
    SWD IO -----------------> SWD IO
    
    SWD CLK ----------------> SWD CLK

    And nothing, here is the nrfjprog --recover --log:


    nRF_open_dll

    . nRF52_open_dll

    . . nRF52_dll_version

    nRF_enum_emu_snr

    . nRF52_enum_emu_snr

    . . nRF52_enum_emu_snr

    nRF_enum_emu_snr

    . nRF52_enum_emu_snr

    . . nRF52_enum_emu_snr

    nRF_connect_to_emu_with_snr

    . nRF52_connect_to_emu_with_snr

    . . nRF52_is_connected_to_emu

    . . nRF52_enum_emu_snr

    . . nRF52_connect_to_emu_with_snr

    . . . nRF52_connect_to_emu_without_snr

    . . . nRF52_connect_to_emu_without_snr: JLink: Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 12 2018 16:05:20

    . . . nRF52_connect_to_emu_without_snr: JLink: Hardware: V1.00

    . . . nRF52_connect_to_emu_without_snr: JLink: S/N: 682010721

    . . . nRF52_connect_to_emu_without_snr: JLink: TELNET listener socket opened on port 19021

    . . . nRF52_connect_to_emu_without_snr: JLink: WEBSRV  Starting webserver

    . . . nRF52_connect_to_emu_without_snr: JLink: (0011ms, 0013ms total) 

    . . . nRF52_connect_to_emu_without_snr: JLink: T89570380 000:005

    . . . nRF52_connect_to_emu_without_snr: JLink: WEBSRV Webserver running on local port 19080

    . . . nRF52_connect_to_emu_without_snr: JLink: (0012ms, 0014ms total) 

    . . . nRF52_connect_to_emu_without_snr: JLink: T89570380 000:005

    . . . nRF52_connect_to_emu_without_snr: JLink:   returns O.K.

    . . . nRF52_connect_to_emu_without_snr: JLink: (0012ms, 0014ms total) 

    . . . nRF52_connect_to_emu_without_snr: JLink: T89570380 000:017

    . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_GetHWStatus(...)

    . . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x00

    . . . nRF52_connect_to_emu_without_snr: JLink: (0002ms, 0016ms total) 

    . . . nRF52_connect_to_emu_without_snr: There is no generic nRF52 device in J-Link, so we select NRF52832_xxAA.

    . . . nRF52_connect_to_emu_without_snr: JLink: T89570380 000:019

    . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("Device = NRF52832_xxAA", ...).

    . . . nRF52_connect_to_emu_without_snr: JLink: /Applications/SEGGER/JLink/JLinkDevices.xml evaluated successfully.

    . . . nRF52_connect_to_emu_without_snr: JLink: Device "NRF52832_XXAA" selected.

    . . . nRF52_connect_to_emu_without_snr: JLink: Device "NRF52832_XXAA" selected.

    . . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x00

    . . . nRF52_connect_to_emu_without_snr: JLink: (0250ms, 0266ms total) 

    . . . nRF52_connect_to_emu_without_snr: JLink: T89570380 000:269

    . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("SetRestartOnClose = 0", ...).

    . . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x01

    . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0267ms total) 

    . . . nRF52_connect_to_emu_without_snr: JLink: T89570380 000:270

    . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("DisableFlashDL", ...).

    . . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x00

    . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0267ms total) 

    . . . nRF52_connect_to_emu_without_snr: JLink: T89570380 000:271

    . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("SetDbgPowerDownOnClose = 1", ...).

    . . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x01

    . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0268ms total) 

    . . . nRF52_connect_to_emu_without_snr: JLink: T89570380 000:271

    . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).

    . . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x00

    . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0268ms total) 

    . . . nRF52_connect_to_emu_without_snr: JLink: T89570380 000:271

    . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_TIF_Select(JLINKARM_TIF_SWD)

    . . . nRF52_connect_to_emu_without_snr: JLink:   returns 0x00

    . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0269ms total) 

    . . . nRF52_connect_to_emu_without_snr: JLink: T89570380 000:272

    . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_SetSpeed(4000)

    . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0269ms total) 

    nRF_recover

    . nRF52_recover

    . . nRF52_is_connected_to_emu

    . . nRF52_is_connected_to_emu: JLink: T89570380 000:273

    . . nRF52_is_connected_to_emu: JLink: JLINK_IsOpen()

    . . nRF52_is_connected_to_emu: JLink:   returns 0x01

    . . nRF52_is_connected_to_emu: JLink: (0000ms, 0269ms total) 

    . . nRF52_is_connected_to_device

    . . nRF52_is_connected_to_device: JLink: T89570380 000:273

    . . nRF52_is_connected_to_device: JLink: JLINK_IsConnected()

    . . nRF52_is_connected_to_device: JLink:   returns FALSE

    . . nRF52_is_connected_to_device: JLink: (0000ms, 0269ms total) 

    . . nRF52_readback_status

    . . . nRF52_is_ctrl_ap_available

    . . . . nRF52_read_access_port_register

    . . . . . nRF52_coresight_configure

    . . . . . nRF52_coresight_configure: JLink: T89570380 000:273

    . . . . . nRF52_coresight_configure: JLink: JLINK_CORESIGHT_Configure()

    . . . . . nRF52_coresight_configure: JLink:   returns 0

    . . . . . nRF52_coresight_configure: JLink: (0102ms, 0371ms total) 

    . . . . . nRF52_power_debug_and_system_regions

    . . . . . . nRF52_write_debug_port_register

    . . . . . . nRF52_write_debug_port_register: JLink: T89570380 000:377

    . . . . . . nRF52_write_debug_port_register: JLink: JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000) ¿Maybe here is the problem?

    . . . . . . nRF52_write_debug_port_register: JLink:   returns -1

    . . . . . . nRF52_write_debug_port_register: JLink: (0002ms, 0374ms total) 

    . . . . . . nRF52_write_debug_port_register: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1.

    . . . . . nRF52_power_debug_and_system_regions: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.

    nRF_close_dll

    . nRF52_close_dll

    . . nRF52_is_connected_to_emu

    . . nRF52_is_connected_to_emu: JLink: T89570380 000:380

    . . nRF52_is_connected_to_emu: JLink: JLINK_IsOpen()

    . . nRF52_is_connected_to_emu: JLink:   returns 0x01

    . . nRF52_is_connected_to_emu: JLink: (0001ms, 0375ms total) 

    . . nRF52_disconnect_from_emu

    . . . nRF52_is_connected_to_device

    . . . nRF52_is_connected_to_device: JLink: T89570380 000:381

    . . . nRF52_is_connected_to_device: JLink: JLINK_IsConnected()

    . . . nRF52_is_connected_to_device: JLink:   returns FALSE

    . . . nRF52_is_connected_to_device: JLink: (0001ms, 0376ms total) 

    . . . nRF52_unpower_debug_and_system_regions

    . . nRF52_disconnect_from_emu: JLink: T89570380 000:393

    . . nRF52_disconnect_from_emu: JLink: JLINK_Close()



  • Hi,

     

    Could you check the current of your external board, by connecting an am-meter in series with the VDD taken from the nRF5x-DK?

    Also, could you check that the "nRF current measurement" header, next to the USB header, is shorted (if you have cut the SB9 solder bridge)?

     

    Have you tried using Jlink Commander to see what the output is there?

     

    Kind regards,

    Håkon

  • Thanks again Håkon.

    I have measured the current consumption between the  VDD jumpered with VTG from my nRF52-DK and my custom board. 

    In idle was 29µA and when i tried the nrjprog --recover  oscilates between 33µA and 130µA.

    The nrf current measurement dosn't have any cut, Its a new development board with factory settings. 

     

    I have tried the jlink commander  too and here is the log : 




    regards!

  • Hi,

     

    If you measured between VTG and VDD, then you have measured the current going into the Segger IC, and not the current going into your custom board. "VTG" is an input for the SEGGER IC to use this specific port for programming, as the DK has a total of 3 debug outputs (P19, P20, and on-board nRF).

    You should measure the current like this:

    VDD ------+--<AM-METER>-> VDD
             /
    VTG ----+
    
    GND ------------+-------> GND
                   /
    GND DETECT ---+
    
    SWD IO -----------------> SWD IO
    
    SWD CLK ----------------> SWD CLK

     

    You could also check if there's voltage on the VDD (in case you've used the board for current measurement on a previous occasion and cut SB9).

     

    Best regards,

    Håkon

Related