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

nRF5340 NVS and readback_protection

Hi Everybody,

We found little or no literature about readback_protection on the nRF5340 SOC. Our issue is that for development and debugging it is not practical to use nrfjprog -recover in order to re-flash as that completely erases the storage partition too. What is the right way to retain NVS data?

Thank you.

Regards,

Milan 

  • No problem. (I could not reply to your latest comment).

    The step by step flow is as is.

    Step nr.1:
    
    nrfjprog version: 10.14.0 external
    JLinkARM.dll version: 7.52d
    
    % nrfjprog --recover                                                   
    Recovering device. This operation might take 30s.
    Writing image to disable ap protect.
    Erasing user code and UICR flash areas.
    
    STEP nr.2:
    
    -- west flash: using runner nrfjprog
    Using board 960180710
    -- runners.nrfjprog: Flashing file: .../build/zephyr/merged_domains.hex
    -- runners.nrfjprog: .../build/zephyr/merged_domains.hex targets both nRF53 coprocessors; splitting it into: .../build/zephyr/GENERATED_CP_NETWORK_merged_domains.hex and .../build/zephyr/GENERATED_CP_APPLICATION_merged_domains.hex
    Parsing image file.
    Applying system reset.
    Verified OK.
    Parsing image file.
    Applying system reset.
    Verified OK.
    Applying pin reset.
    -- runners.nrfjprog: Board with serial number 960180710 flashed successfully.
    
    Terminal will be reused by tasks, press any key to close it.
    
    STEP nr.3:
    
    > Executing task in folder zephyr_zigbee_slave: west flash <
    
    -- west flash: rebuilding
    [0/4] Performing build step for '802154_rpmsg_subimage'
    ninja: no work to do.
    -- west flash: using runner nrfjprog
    Using board 960180710
    -- runners.nrfjprog: Flashing file: .../build/zephyr/merged_domains.hex
    -- runners.nrfjprog: .../build/zephyr/merged_domains.hex targets both nRF53 coprocessors; splitting it into: .../build/zephyr/GENERATED_CP_NETWORK_merged_domains.hex and .../build/zephyr/GENERATED_CP_APPLICATION_merged_domains.hex
    Parsing image file.
    Applying system reset.
    Verified OK.
    Parsing image file.
    ERROR: nrfjprog failed for an unknown reason. Run the same command again with
    ERROR: argument --log, contact Nordic Semiconductor and provide the generated
    ERROR: log.log file to them.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    FATAL ERROR: command exited with status 65: nrfjprog --program .../build/zephyr/GENERATED_CP_APPLICATION_merged_domains.hex --sectorerase -f NRF53 --snr 960180710 --coprocessor CP_APPLICATION
    The terminal process "zsh '-c', 'west flash'" terminated with exit code: 65.
    
    Terminal will be reused by tasks, press any key to close it.
    
    STEP nr.4:
    
    % nrfjprog --memrd 0x01000000
    ERROR: The operation attempted is unavailable due to readback protection in
    ERROR: your device. Please use --recover to unlock the device.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    % nrfjprog --memrd 0x01000000 --log
    ERROR: [  JLink] - Could not find core in Coresight setup 
    ERROR: [SeggerBackend] - JLinkARM.dll reported error -1 at line 4410.
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-261", "Could not find supported CPU.".
    ERROR: [  JLink] - Could not find core in Coresight setup 
    ERROR: [SeggerBackend] - JLinkARM.dll reported error -1 at line 4410.
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-261", "Could not find supported CPU.".
    ERROR: [  JLink] - Could not find core in Coresight setup 
    ERROR: [SeggerBackend] - JLinkARM.dll reported error -1 at line 4410.
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-261", "Could not find supported CPU.".
    ERROR: [  JLink] - Could not find core in Coresight setup 
    ERROR: [SeggerBackend] - JLinkARM.dll reported error -1 at line 4410.
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-261", "Could not find supported CPU.".
    ERROR: [  JLink] - Could not find core in Coresight setup 
    ERROR: [SeggerBackend] - JLinkARM.dll reported error -1 at line 4410.
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-261", "Could not find supported CPU.".
    

    I had logs from before updated the command line tools and Jlinkt to the latest. 

    --------------------------------------------------------------------------------
    [2021-Sept-28 15:44:02] [ info] nrfjprog --program .../build/zephyr/GENERATED_CP_NETWORK_merged_domains.hex --sectorerase -f NRF53 --snr 960180710 --coprocessor CP_NETWORK --log 
    [2021-Sept-28 15:44:02] [ info] nrfjprog version 10.12.1 
    [2021-Sept-28 15:44:02] [ info] --------------------------------------------------------------------------------
    [2021-Sept-28 15:44:02] [debug] [ nRF0x0] - open_dll
    [2021-Sept-28 15:44:02] [ info] [ nRF0x0] - Load library at /Applications/Nordic Semiconductor/nrfjprog/libjlinkarm_nrf53_nrfjprogdll.dylib.
    [2021-Sept-28 15:44:02] [ info] [ nRF0x0] - Library loaded, loading member functions.
    [2021-Sept-28 15:44:02] [ info] [ nRF0x0] - Member functions succesfully loaded.
    [2021-Sept-28 15:44:02] [ info] [Backend] - Logger callback at 0x105221300 registered in Segger backend logger.
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Logger callback at 0x105221300 registered in JLink logger.
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - open
    [2021-Sept-28 15:44:02] [debug] [Backend] - open_dll
    [2021-Sept-28 15:44:02] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
    [2021-Sept-28 15:44:02] [ info] [Backend] - Load library at /Applications/SEGGER/JLink/libjlinkarm.7.20.0.dylib.
    [2021-Sept-28 15:44:02] [ info] [Backend] - Library loaded, loading member functions.
    [2021-Sept-28 15:44:02] [ info] [Backend] - Member functions succesfully loaded.
    [2021-Sept-28 15:44:02] [debug] [Backend] - dll_version
    [2021-Sept-28 15:44:02] [ info] [Backend] - Segger dll version 7.20.  loaded.
    [2021-Sept-28 15:44:02] [debug] [ nRF0x0] - enum_emu_snr
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - enum_emu_snr
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_emu
    [2021-Sept-28 15:44:02] [debug] [Backend] - enum_emu_snr
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_enum_emu_snr
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_get_num_emus
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_emu
    [2021-Sept-28 15:44:02] [debug] [ nRF0x0] - connect_to_emu_with_snr
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - connect_to_emu_with_snr
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_emu
    [2021-Sept-28 15:44:02] [debug] [Backend] - connect_to_emu_with_snr
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_emu
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_enum_emu_snr
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_get_num_emus
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_connect_to_emu_with_snr
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_connect_to_emu_without_snr
    [2021-Sept-28 15:44:02] [ info] [Backend] - Segger logging enabled.
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Firmware: J-Link OB-K22-NordicSemi compiled Apr 29 2021 15:10:52
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Firmware: J-Link OB-K22-NordicSemi compiled Apr 29 2021 15:10:52
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Decompressing FW timestamp took 217 us
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Hardware: V1.00
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] S/N: 960180710
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] OEM: SEGGER
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] TELNET listener socket opened on port 19021
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] WEBSRV Starting webserver
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] WEBSRV Webserver running on local port 19080
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 39.603ms returns "O.K."  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_GetHWStatus(...)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.313ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("SetRestartOnClose = 0", ...).   
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.005ms returns 0x01  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("DisableFlashDL", ...).   
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.008ms returns 0x00  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).   
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.009ms returns 0x00  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetHookUnsecureDialog  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetHookUnsecureDialog(...)
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.022ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_TIF_Select(JLINKARM_TIF_SWD)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 1.073ms returns 0x00  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetSpeed(2000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.253ms  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_GetSN()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.007ms returns 960180710  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_load_core_data
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...).   
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.008ms returns 0x00  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("device = Cortex-M33", ...).   
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] XML file found at: /Applications/SEGGER/JLink_V720/JLinkDevices.xml 
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] /Applications/SEGGER/JLink_V720/JLinkDevices.xml evaluated successfully. 
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Device "CORTEX-M33" selected.
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Device "CORTEX-M33" selected.
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 25.140ms returns 0x00  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - read_debug_port_idr
    [2021-Sept-28 15:44:02] [debug] [Backend] - read_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - coresight_configure
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_Configure()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.707ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.364ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x00)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x6BA02477
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.356ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.029ms  
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - enable_coprocessor
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_emu
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x01  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_enable_coprocessor
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_is_secure_debug_available
    [2021-Sept-28 15:44:02] [debug] [Backend] - read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_is_debug_region_powered
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.342ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0xF0000040
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.386ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_access_port_register
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x00)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x43000002
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 1.598ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_is_peripheral_mapped_secure
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_is_secure_debug_available
    [2021-Sept-28 15:44:02] [debug] [Backend] - read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_access_port_register
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x00)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x43000002
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.341ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [warning] [nRF530x0] - Secure trustzone access required to read SPU config. Assume NS access.
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_readback_status
    [2021-Sept-28 15:44:02] [debug] [Backend] - read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - Select AP 2, DP Bank 0, AP Bank 0
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x02000000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 1.435ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000003
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.352ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - Select AP 0, DP Bank 0, AP Bank 0
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.335ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x00)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x43000002
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.432ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [nRF530x0] - Protection status read as APPROTECT -> ALL
    [2021-Sept-28 15:44:02] [ info] [nRF530x0] - Application core access protection is enabled, can't enable coprocessor.
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.009ms  
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - select_coprocessor
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_emu
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x01  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_device
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_device
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsConnected()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns FALSE  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_select_coprocessor
    [2021-Sept-28 15:44:02] [ info] [nRF530x0] - Loading new coprocessor data.
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_load_coprocessor_data
    [2021-Sept-28 15:44:02] [debug] [Backend] - set_core_data
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.011ms  
    [2021-Sept-28 15:44:02] [debug] [ nRF0x0] - read_device_version
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - read_device_info
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_emu
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x01  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_read_device_version
    [2021-Sept-28 15:44:02] [debug] [Backend] - read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_is_debug_region_powered
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 1.541ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0xF0000040
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.332ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - Select AP 3, DP Bank 0, AP Bank 3
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x03000030)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.343ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x00)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000007
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.424ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_access_port_register
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x01)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000005
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.500ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_decode_device_version
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.007ms  
    [2021-Sept-28 15:44:02] [debug] [ nRF0x0] - is_bprot_enabled
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - is_bprot_enabled
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_emu
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.011ms returns 0x01  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_is_bprot_enabled
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - Just_readback_status
    [2021-Sept-28 15:44:02] [debug] [Backend] - read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_is_debug_region_powered
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.580ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0xF0000040
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 1.667ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - Select AP 3, DP Bank 0, AP Bank 0
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x03000000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.276ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000001
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.242ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_access_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - Select AP 1, DP Bank 0, AP Bank 0
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x01000000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.281ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x00)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x43000002
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.241ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [nRF530x0] - Protection status read as APPROTECT -> ALL
    [2021-Sept-28 15:44:02] [ info] [nRF530x0] - Access protection is enabled, can't read block protection state.
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.032ms  
    [2021-Sept-28 15:44:02] [debug] [ nRF0x0] - close_dll
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - close
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_emu
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x01  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - close
    [2021-Sept-28 15:44:02] [debug] [Backend] - disconnect_from_emu
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_disconnect_from_emu
    [2021-Sept-28 15:44:02] [debug] [Backend] - is_connected_to_device
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsConnected()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns FALSE  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_is_debug_region_powered
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.329ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0xF0000040
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.385ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - unpower_debug_and_system_regions
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_write_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_debug_port_register
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x01, 0x00000000)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.252ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_is_debug_region_powered
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_read_debug_port_register
    [2021-Sept-28 15:44:02] [debug] [Backend] - ---just_select_debug_port_register
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000040
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.372ms returns 0  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] - 0.005ms  
    [2021-Sept-28 15:44:02] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Close()  
    [2021-Sept-28 15:44:02] [debug] [Backend] - Segger Backend closed.
    [2021-Sept-28 15:44:02] [debug] [nRF530x0] - nRF family DLL closed
    

    nrfSDK version is as: 1.7.99

  • Hi,

    I see a few things.

    First of all, if you recover using nrfjprog it does not automatically recover both the application core and network core. As you did not specify anything, you only changed the application core (which is default). To recover both, do the following:

    nrfjprog --recover
    nrfjprog --recover --coprocessor CP_NETWORK

    And when you try to read you try to read the flash mapped to the network core (0x01000000, see memory layout), but via application core, as --coprocessor CP_NETWORK has not been specified. That does not work. So to read that address you must specify network core like this:

    nrfjprog --memrd 0x01000000 --coprocessor CP_NETWORK

  • That is good to know, thanks. 

    I tried exactly as you mentioned and have the following observations.

    After flash nr.1:

    nrfjprog --memrd 0x01000000 --coprocessor CP_NETWORK    
    0x01000000: 21005BE8           
    

    After flash nr.2: The NET_CORE gets locked.

    It is enough to recover the NET_CORE though to flash the SOC again. So the APP_CORE stays unlocked as it should.

  • That is odd.  I have not been able to reproduce it. Can you show the exact steps you use here?

  • 1st step: OK

    nrfjprog --recover

    2nd step: OK

    nrfjprog --recover --coprocessor CP_NETWORK

    3rd step: OK

    west flash

    4th step: FAIL

    west flash

Related