52832DK can't be unsecured

Hello:

I have a problem here:

Connecting ...
- Connecting via USB to probe/ programmer device 0
- Probe/ Programmer firmware: J-Link OB-nRF5340-NordicSemi compiled Apr 11 2024 17:44:26
- Probe/ Programmer S/N: 1050397561
- Device "NRF52832_XXAA" selected.
- Target interface speed: 2000 kHz (Fixed)
- VTarget = 3.300V
- InitTarget() start
- Device will be unsecured now.
- InitTarget() end - Took 7.46s
- InitTarget() start
- Device will be unsecured now.
- InitTarget() end - Took 8.81s
- ERROR: Failed to connect.
Could not establish a connection to target.
- ERROR: Connect failed

what is this issuse

  • Hi,

     

    Could you try to run "nrfjprog --recover -f nrf52 --log" ? And if it still fails, can you attach the outputted "log.log" file?

     

    Kind regards,

    Håkon

  • Hi,

     

    Are you sure that is the correct log file?

    Because this log file shows a successful recover, based on the file itself:

    *snip*
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 0.002ms returns 0x00  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_ReadMemU32(0x4001E400, 0x1 Items)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - CPU_ReadMem(4 bytes @ 0x4001E400)
    [2024-Sept-10 08:39:05] [trace] [  JLink] - Data:  01 00 00 00
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 0.583ms returns 1 (0x1)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_WriteMem(0x00000000, 0xDE4 Bytes, ...)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - Data:  00 00 01 20 7D 05 00 00 A5 05 00 00 A7 05 00 00 ...
    [2024-Sept-10 08:39:05] [trace] [  JLink] - CPU_WriteMem(3556 bytes @ 0x00000000)
    [2024-Sept-10 08:39:05] [trace] [ Client] - Command write executed for 76 milliseconds with result 0
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 64.251ms returns 0xDE4  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:05] [debug] [  nRF52] - Just_nvmc_wait_for_ready
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - read_u32
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - ---just_connect_to_device
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - is_connected_to_device
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - ---just_read_u32
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - ---just_invalidate_cache
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_ExecCommand("InvalidateCache", ...).   
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 0.004ms returns 0x00  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_ReadMemU32(0x4001E400, 0x1 Items)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - CPU_ReadMem(4 bytes @ 0x4001E400)
    [2024-Sept-10 08:39:05] [trace] [  JLink] - Data:  01 00 00 00
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 0.621ms returns 1 (0x1)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:05] [debug] [  nRF52] - Just_nvmc_config_control
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - write_u32
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - ---just_connect_to_device
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - is_connected_to_device
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - ---just_write_u32
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - ---just_write_debug_port_register
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - ---just_select_debug_port_register
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - Select AP 255, DP Bank 0, AP Bank 255
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 0.426ms returns 0  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 0.481ms returns 0  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_WriteU32_64(0x4001E504, 0x00000000)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - CPU_WriteMem(4 bytes @ 0x4001E504)
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 0.601ms returns 0 (0x00000000)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:05] [debug] [  nRF52] - Just_nvmc_wait_for_ready
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - read_u32
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - ---just_connect_to_device
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - is_connected_to_device
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - ---just_read_u32
    [2024-Sept-10 08:39:05] [debug] [SeggerBackend] - ---just_invalidate_cache
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_ExecCommand("InvalidateCache", ...).   
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 0.001ms returns 0x00  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_ReadMemU32(0x4001E400, 0x1 Items)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - CPU_ReadMem(4 bytes @ 0x4001E400)
    [2024-Sept-10 08:39:05] [trace] [  JLink] - Data:  01 00 00 00
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 0.549ms returns 1 (0x1)  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:05] [trace] [  JLink] - - 0.004ms  
    [2024-Sept-10 08:39:05] [trace] [ Worker] - Command write executed for 70 milliseconds with result 0
    [2024-Sept-10 08:39:06] [debug] [  nRF52] - close
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - is_connected_to_emu
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_IsOpen()  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - - 0.006ms returns 0x01  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_Lock()  
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - close
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - disconnect_from_emu
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_disconnect_from_emu
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - is_connected_to_device
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_IsConnected()  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - - 0.002ms returns TRUE  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_is_debug_region_powered
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_read_debug_port_register
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_select_debug_port_register
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - Select AP 255, DP Bank 0, AP Bank 255
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - - 0.449ms returns 0  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - Value=0xF0000040
    [2024-Sept-10 08:39:06] [trace] [  JLink] - - 0.477ms returns 0  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - Disable trace before closing connection.
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_write_u32
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_write_debug_port_register
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_select_debug_port_register
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - Select AP 255, DP Bank 0, AP Bank 255
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - - 0.433ms returns 0  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - - 0.472ms returns 0  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_WriteU32_64(0xE000EDFC, 0x00000000)  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - Debug reg: DEMCR
    [2024-Sept-10 08:39:06] [trace] [  JLink] - CPU_WriteMem(4 bytes @ 0xE000EDFC)
    [2024-Sept-10 08:39:06] [trace] [  JLink] - - 0.800ms returns 0 (0x00000000)  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_is_debug_region_powered
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - Shortcut, lock is on and debug region is powered.
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - unpower_debug_and_system_regions
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_write_debug_port_register
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_select_debug_port_register
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x01, 0x00000000)  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - - 0.435ms returns 0  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_is_debug_region_powered
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_read_debug_port_register
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - ---just_select_debug_port_register
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - Value=0x00000040
    [2024-Sept-10 08:39:06] [trace] [  JLink] - - 0.460ms returns 0  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_HasError()  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - - 0.003ms  
    [2024-Sept-10 08:39:06] [trace] [  JLink] - JLINK_Close()  
    [2024-Sept-10 08:39:06] [debug] [SeggerBackend] - Segger Backend closed.
    [2024-Sept-10 08:39:06] [debug] [  nRF52] - nRF family DLL closed
    [2024-Sept-10 08:39:06] [trace] [ Worker] - Command close executed for 44 milliseconds with result 0
    [2024-Sept-10 08:39:06] [trace] [ Client] - Command close executed for 61 milliseconds with result 0
    [2024-Sept-10 08:39:06] [debug] [ Client] - terminate
    [2024-Sept-10 08:39:06] [trace] [ Client] - Command terminate executed for 0 milliseconds with result 0
    [2024-Sept-10 08:39:06] [trace] [ Worker] - Command terminate executed for 0 milliseconds with result 0
    [2024-Sept-10 08:39:06] [trace] [ Worker] - Executed 10 commands for 1360 milliseconds
    [2024-Sept-10 08:39:06] [debug] [ Client] - Worker process exited with code: 0
    [2024-Sept-10 08:39:06] [debug] [ Client] - Worker process exited with code: 0
    [2024-Sept-10 08:39:06] [debug] [ Client] - Child process terminated with result 0
    [2024-Sept-10 08:39:06] [trace] [ Client] - Executed 10 commands for 1475 milliseconds
    [2024-Sept-10 08:39:06] [debug] [ Client] - terminate

     

    What happens if you try to program a .hex file using nrfjprog?

    nrfjprog --program <hexfile> --sectorerase --verify -f nrf52

      

    Kind regards,

    Håkon

  • Oh, thanks, I forgot to check the programming function again after the cmd-line. It is now programmable, but I tried the recover command more than once before and failed every time. I don't know what the hell happened.

  • Hi,

     

    It could be that the firmware running on the device is in a assert loop (default behavior is then to do a soft-reset), which again can cause connection issues, because it is continuously resetting when trying to connect with the debugger.

    I am glad to hear that you were able to re-program your kit!

     

    Kind regards,

    Håkon

Related