This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ERROR: Not valid hex file when flashing code to new DK board

I am using an nRF52840 DK board that I just bought, but have ran into a weird issue that I have never come across when using our old nRF52840 DK. I have a script that I use to first compile my project code, and then flash everything onto my DK board. Here is the code of that script:

#! /bin/bash

## Compile bootloader and application:
boot_make='../nrf-sdk/examples/dfu/secure_bootloader/pca10040_s132_ble/armgcc/'
boot=${boot_make}_build/nrf52832_xxaa_s132.hex

softdevice='../nrf-sdk/components/softdevice/s132/hex/s132_nrf52_7.0.1_softdevice.hex'

app_make='../nrf-sdk/examples/ble_peripheral/ble_app_technolingus/pca10040/s132/armgcc/'
app=${app_make}_build/nrf52832_xxaa.hex


make -C "$boot_make"
make -C "$app_make"

nrfutil settings generate --family NRF52 --application "$app" --application-version 1 --bootloader-version 1 --bl-settings-version 2 settings.hex

nrfjprog -e
nrfjprog --program "$softdevice" --verify
nrfjprog --program "$boot" --verify --log .
nrfjprog --program "$app" --verify
nrfjprog --program settings.hex --verify

nrfjprog --reset

My code compiles and the hex files are generated as a result of the calls to make -C "$boot_make" and make -C "$app_make". However, when the script finishes programming the softdevice, it complains with ERRORS about the other .hex files I am trying to flash. Here is that output for your reference:

Only moments ago, when running the same code for an older DK (same nRF52840), this script worked fine and everything flashed correctly. I cant figure out why this new DK board causes the programming to fail. What might be causing this new behavior (even though there is no code change)?

I have also attached the log output file from logging the first failing nrfjprog --program command for your reference....if it helps.

The only other thing I have tried is to erase my device from Segger ES (Target > Connect JLink, Target > Erase All), download the secure bootloader ble example, then download my custom application. When I Build and Debug this code, my project always fails at this function, with the same error (NRF ERROR NO MEM "No bootloader found"):

APP_ERROR_CHECK(ble_dfu_buttonless_async_svci_init());


Parents
  • Hi, 

    Seem you are programming s132_nrf52_7.0.1_softdevice.hex and nrf52832_xxaa_s132.hex to nRF52840DK. For nRF52840, you use --family NRF52840 to generate the setting. 

    To use the new version of nRF52840DK, you have to run "nrfjprog --recover" to disable the approtect. See this blog

    Regards,
    Amanda

  • That makes complete sense, thanks. Do you know why our previous nRF52840 DK is able to run this nRF52832 code without ERROR? I feel like I would have been able to encounter/resolve this bug much sooner if the first DK board worked in the same way as this new one...Im curious to hear your thoughts.

    Also, I did what you suggested. I made sure to refer to the correct s140 SoftDevice for the nRF52840. The softdevice flashes perfectly to the DK board, as before. I am simplifying my script for step-by-step debugging, and all I try to do after flashing the softdevice is to flash the bootloader. I made edits to the script to also reference the correct bootloader, as you can see here:

    #! /bin/bash
    
    # nRF52840
    
    ## Compile bootloader and application:
    boot_make='../nrf-sdk/examples/dfu/secure_bootloader/pca10056_s140_ble/armgcc/'
    boot=${boot_make}_build/nrf52840_xxaa_s140.hex
    
    softdevice='../nrf-sdk/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex'
    
    make -C "$boot_make"
    
    nrfjprog -e
    nrfjprog --program "$softdevice" --verify
    nrfjprog --program "$boot" --verify --log .
    
    nrfjprog --reset


    Unfortunately, these new changes dont seem to help. I am still encountering the same ERROR from the nrfjprog command line tool, which you can see here:

    Lastly, I have included the log output from this failed flash for your reference. What could be causing this error? What should I try to debug this issue? Thank you so much for your help with this.

    [2022-Apr-20 17:43:01] [ info] --------------------------------------------------------------------------------
    [2022-Apr-20 17:43:01] [ info] nrfjprog --program ../nrf-sdk/examples/dfu/secure_bootloader/pca10056_s140_ble/armgcc/_build/nrf52840_xxaa_s140.hex --verify --log . 
    [2022-Apr-20 17:43:01] [ info] nrfjprog version 10.12.1 
    [2022-Apr-20 17:43:01] [ info] --------------------------------------------------------------------------------
    [2022-Apr-20 17:43:01] [debug] [ nRF0x0] - open_dll
    [2022-Apr-20 17:43:01] [ info] [ nRF0x0] - Load library at /Applications/Nordic Semiconductor/nrfjprog/libjlinkarm_unknown_nrfjprogdll.dylib.
    [2022-Apr-20 17:43:01] [ info] [ nRF0x0] - Library loaded, loading member functions.
    [2022-Apr-20 17:43:01] [ info] [ nRF0x0] - Member functions succesfully loaded.
    [2022-Apr-20 17:43:01] [ info] [Backend] - Logger callback at 0x10ec03300 registered in Segger backend logger.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Logger callback at 0x10ec03300 registered in JLink logger.
    [2022-Apr-20 17:43:01] [debug] [nRFUnknown] - Just_open_dll_tagged_callback
    [2022-Apr-20 17:43:01] [debug] [Backend] - open_dll
    [2022-Apr-20 17:43:01] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
    [2022-Apr-20 17:43:01] [ info] [Backend] - Load library at /Applications/SEGGER/JLink/libjlinkarm.dylib.
    [2022-Apr-20 17:43:01] [ info] [Backend] - Library loaded, loading member functions.
    [2022-Apr-20 17:43:01] [ info] [Backend] - Member functions succesfully loaded.
    [2022-Apr-20 17:43:01] [debug] [Backend] - dll_version
    [2022-Apr-20 17:43:01] [ info] [Backend] - Segger dll version 7.60.a loaded.
    [2022-Apr-20 17:43:01] [debug] [Backend] - set_core_data
    [2022-Apr-20 17:43:01] [debug] [ nRF0x0] - enum_emu_snr
    [2022-Apr-20 17:43:01] [debug] [nRFUnknown] - Just_enum_emu_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - enum_emu_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_enum_emu_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_get_num_emus
    [2022-Apr-20 17:43:01] [debug] [ nRF0x0] - connect_to_emu_with_snr
    [2022-Apr-20 17:43:01] [debug] [nRFUnknown] - Just_connect_to_emu_with_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - connect_to_emu_with_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_enum_emu_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_get_num_emus
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_connect_to_emu_with_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_connect_to_emu_without_snr
    [2022-Apr-20 17:43:01] [ info] [Backend] - Segger logging enabled.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Firmware: J-Link OB-nRF5340-NordicSemi compiled Dec  3 2021 15:46:49
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Firmware: J-Link OB-nRF5340-NordicSemi compiled Dec  3 2021 15:46:49
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Hardware: V1.00
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] S/N: 1050260108
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] OEM: SEGGER
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Feature(s): None
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] TELNET listener socket opened on port 19021
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] WEBSRV WEBSRV_Init(): Starting webserver thread(s)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] WEBSRV Webserver running on local port 19080
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 24.945ms returns "O.K."  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_GetHWStatus(...)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.179ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("SetRestartOnClose = 0", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.005ms returns 0x01  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("DisableFlashDL", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.006ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetHookUnsecureDialog  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetHookUnsecureDialog(...)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.011ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_TIF_Select(JLINKARM_TIF_SWD)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.580ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetSpeed(2000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.072ms  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_GetSN()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 1050260108  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_load_core_data
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.003ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("device = Cortex-M4", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] XML file found at: /Applications/SEGGER/JLink_V760a/JLinkDevices.xml 
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] /Applications/SEGGER/JLink_V760a/JLinkDevices.xml evaluated successfully. 
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Device "CORTEX-M4" selected.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Device "CORTEX-M4" selected.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 17.709ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [ nRF0x0] - read_connected_emu_snr
    [2022-Apr-20 17:43:01] [debug] [nRFUnknown] - Just_read_connected_emu_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_connected_emu_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x01  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [ nRF0x0] - read_device_family
    [2022-Apr-20 17:43:01] [debug] [nRFUnknown] - Just_read_device_family
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x01  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_debug_port_idr
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - coresight_configure
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_Configure()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.510ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.230ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x00)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x2BA01477
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.258ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [nRFUnknown] - Discovered device from family NRF52.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.010ms  
    [2022-Apr-20 17:43:01] [debug] [ nRF0x0] - close_dll
    [2022-Apr-20 17:43:01] [debug] [nRFUnknown] - Just_close_dll
    [2022-Apr-20 17:43:01] [debug] [Backend] - close
    [2022-Apr-20 17:43:01] [debug] [Backend] - disconnect_from_emu
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x01  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_disconnect_from_emu
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_device
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsConnected()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns FALSE  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x01  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.230ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0xF0000040
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.201ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms  
    [2022-Apr-20 17:43:01] [debug] [Backend] - unpower_debug_and_system_regions
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_write_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.005ms returns 0x01  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.254ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x01, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.215ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.005ms returns 0x01  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.195ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000040
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.228ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.005ms  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Close()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - Segger Backend closed.
    [2022-Apr-20 17:43:01] [debug] [ nRF0x0] - open_dll
    [2022-Apr-20 17:43:01] [ info] [ nRF0x0] - Load library at /Applications/Nordic Semiconductor/nrfjprog/libjlinkarm_nrf52_nrfjprogdll.dylib.
    [2022-Apr-20 17:43:01] [ info] [ nRF0x0] - Library loaded, loading member functions.
    [2022-Apr-20 17:43:01] [ info] [ nRF0x0] - Member functions succesfully loaded.
    [2022-Apr-20 17:43:01] [ info] [Backend] - Logger callback at 0x10ec03300 registered in Segger backend logger.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Logger callback at 0x10ec03300 registered in JLink logger.
    [2022-Apr-20 17:43:01] [debug] [nRF520x0] - open
    [2022-Apr-20 17:43:01] [debug] [Backend] - open_dll
    [2022-Apr-20 17:43:01] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
    [2022-Apr-20 17:43:01] [ info] [Backend] - Load library at /Applications/SEGGER/JLink/libjlinkarm.dylib.
    [2022-Apr-20 17:43:01] [ info] [Backend] - Library loaded, loading member functions.
    [2022-Apr-20 17:43:01] [ info] [Backend] - Member functions succesfully loaded.
    [2022-Apr-20 17:43:01] [debug] [Backend] - dll_version
    [2022-Apr-20 17:43:01] [ info] [Backend] - Segger dll version 7.60.a loaded.
    [2022-Apr-20 17:43:01] [debug] [ nRF0x0] - connect_to_emu_with_snr
    [2022-Apr-20 17:43:01] [debug] [nRF520x0] - connect_to_emu_with_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [debug] [Backend] - connect_to_emu_with_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_enum_emu_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_get_num_emus
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_connect_to_emu_with_snr
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_connect_to_emu_without_snr
    [2022-Apr-20 17:43:01] [ info] [Backend] - Segger logging enabled.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Firmware: J-Link OB-nRF5340-NordicSemi compiled Dec  3 2021 15:46:49
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Firmware: J-Link OB-nRF5340-NordicSemi compiled Dec  3 2021 15:46:49
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Hardware: V1.00
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] S/N: 1050260108
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] OEM: SEGGER
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Feature(s): None
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] TELNET listener socket opened on port 19021
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] WEBSRV WEBSRV_Init(): Starting webserver thread(s)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] WEBSRV Webserver running on local port 19080
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 22.501ms returns "O.K."  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_GetHWStatus(...)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.172ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("SetRestartOnClose = 0", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x01  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("DisableFlashDL", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.007ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.005ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetHookUnsecureDialog  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetHookUnsecureDialog(...)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.013ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_TIF_Select(JLINKARM_TIF_SWD)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.622ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_SetSpeed(2000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.093ms  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_GetSN()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.034ms returns 1050260108  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_load_core_data
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.005ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("device = nRF52", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] XML file found at: /Applications/SEGGER/JLink_V760a/JLinkDevices.xml 
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] /Applications/SEGGER/JLink_V760a/JLinkDevices.xml evaluated successfully. 
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Device "NRF52" selected.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Device "NRF52" selected.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 17.425ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_debug_port_idr
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - coresight_configure
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_Configure()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.409ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.278ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x00)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x2BA01477
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.227ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms  
    [2022-Apr-20 17:43:01] [debug] [ nRF0x0] - read_device_version
    [2022-Apr-20 17:43:01] [debug] [nRF520x0] - read_device_info
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x01  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-20 17:43:01] [debug] [nRF520x0] - Just_read_device_version
    [2022-Apr-20 17:43:01] [debug] [nRF520x0] - Just_readback_status
    [2022-Apr-20 17:43:01] [debug] [nRF520x0] - Just_is_ctrl_ap_available
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.243ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0xF0000040
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.238ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - Select AP 1, DP Bank 0, AP Bank 15
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x010000F0)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.221ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x02880000
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.226ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x02880000
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.228ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x02880000
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.277ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x02880000
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.229ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - Select AP 1, DP Bank 0, AP Bank 0
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x01000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.280ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000001
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.219ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000001
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.236ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000001
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.222ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_access_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_access_port_register
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000001
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.298ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [nRF520x0] - Protection status read as NONE
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_u32
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_connect_to_device
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_device
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsConnected()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns FALSE  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_load_core_data
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.002ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("device = nRF52", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Device "NRF52" selected.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Device "NRF52" selected.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.622ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Connect()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] InitTarget() start
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] InitTarget() start
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ]  J-Link Script File: Executing InitTarget() 
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] InitTarget() end
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] InitTarget() end
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Found SW-DP with ID 0x2BA01477
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Found SW-DP with ID 0x2BA01477
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] DPIDR: 0x2BA01477
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] DPIDR: 0x2BA01477
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CoreSight SoC-400 or earlier
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CoreSight SoC-400 or earlier
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] AP map detection skipped. Manually configured AP map found.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] AP map detection skipped. Manually configured AP map found.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: AHB-AP (IDR: Not set)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: AHB-AP (IDR: Not set)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: Core found
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: Core found
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: AHB-AP ROM base: 0xE00FF000
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] AP[0]: AHB-AP ROM base: 0xE00FF000
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Found Cortex-M4 r0p1, Little endian.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Found Cortex-M4 r0p1, Little endian.
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] -- Max. mem block: 0x0003C628
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE000EDF0)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE0002000)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] FPUnit: 6 code (BP) slots and 2 literal slots
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] FPUnit: 6 code (BP) slots and 2 literal slots
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE000EDFC)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE000EDFC)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE0001000)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE0001000)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE000ED88)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE000ED88)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0xE000ED88)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE000ED88)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CoreSight components:
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CoreSight components:
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] ROMTbl[0] @ E00FF000
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] ROMTbl[0] @ E00FF000
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(64 bytes @ 0xE00FF000)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE000EFE0)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE0001FE0)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE0002FE0)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE0000FE0)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE0040FE0)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(32 bytes @ 0xE0041FE0)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][5]: E0041000 CID B105900D PID 000BB925 ETM
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] [0][5]: E0041000 CID B105900D PID 000BB925 ETM
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 120.175ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORE_GetFound()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.010ms returns 0xE0000FF  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_u32
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_invalidate_cache
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("InvalidateCache", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.020ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ReadMemU32(0x10000130, 0x1 Items)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0x10000130)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Data:  08 00 00 00
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.461ms returns 1 (0x1)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_u32
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_connect_to_device
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_u32
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_invalidate_cache
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("InvalidateCache", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.007ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ReadMemU32(0x10000134, 0x1 Items)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0x10000134)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Data:  05 00 00 00
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.419ms returns 1 (0x1)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [nRF520x0] - Just_decode_device_version
    [2022-Apr-20 17:43:01] [debug] [Backend] - read_u32
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_connect_to_device
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_u32
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_invalidate_cache
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ExecCommand("InvalidateCache", ...).   
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.007ms returns 0x00  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_ReadMemU32(0x10000110, 0x1 Items)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_ReadMem(4 bytes @ 0x10000110)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Data:  00 04 00 00
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.426ms returns 1 (0x1)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.010ms  
    [2022-Apr-20 17:43:01] [debug] [ nRF0x0] - close_dll
    [2022-Apr-20 17:43:01] [debug] [nRF520x0] - close
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_emu
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.009ms returns 0x01  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Lock()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - close
    [2022-Apr-20 17:43:01] [debug] [Backend] - disconnect_from_emu
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_disconnect_from_emu
    [2022-Apr-20 17:43:01] [debug] [Backend] - is_connected_to_device
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsConnected()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.005ms returns TRUE  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.219ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0xF0000040
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.306ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [Backend] - Disable trace before closing connection.
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_write_u32
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_WriteU32_64(0xE000EDFC, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Debug reg: DEMCR
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU is running
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] CPU_WriteMem(4 bytes @ 0xE000EDFC)
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.701ms returns 0 (0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-20 17:43:01] [ info] [Backend] - Shortcut, lock is on and debug region is powered.
    [2022-Apr-20 17:43:01] [debug] [Backend] - unpower_debug_and_system_regions
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_write_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.249ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x01, 0x00000000)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.260ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_is_debug_region_powered
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_read_debug_port_register
    [2022-Apr-20 17:43:01] [debug] [Backend] - ---just_select_debug_port_register
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x01)  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] Value=0x00000040
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.248ms returns 0  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] - 0.006ms  
    [2022-Apr-20 17:43:01] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_Close()  
    [2022-Apr-20 17:43:01] [debug] [Backend] - Segger Backend closed.
    [2022-Apr-20 17:43:01] [debug] [nRF520x0] - nRF family DLL closed
    

  • Hi, 

    Seems the error happened while programming nrf52840_xxaa_s140.hex. Could you check the flash address or upload the image? Here is the Memory layout

    -Amanda

Reply Children
  • Im not sure how to check the flash address, but here is the .hex file created as a result of running my script (specifically the call to make)

    6038.nrf52840_xxaa_s140.hex

    Would you mind pointing me in the direction of resources where I can learn how to check high-level bootloader info like the flash address, etc?

    EDIT: I dug around and found a file called flash_placement.xml in the /dfu/secure_bootloader/pca10056_s140_ble/ses/ directory. Here are some relevant sections:

      <MemorySegment name="bootloader_settings_page" start="0x000FF000" size="0x1000">
        <ProgramSection alignment="4" keep="Yes" load="No" name=".bootloader_settings_page" address_symbol="__start_bootloader_settings_page" end_symbol="__stop_bootloader_settings_page" start = "0x000FF000" size="0x1000" />
      </MemorySegment>
      <MemorySegment name="mbr_params_page" start="0x000FE000" size="0x1000">
        <ProgramSection alignment="4" keep="Yes" load="No" name=".mbr_params_page" address_symbol="__start_mbr_params_page" end_symbol="__stop_mbr_params_page" start = "0x000FE000" size="0x1000" />
      </MemorySegment>
      <MemorySegment name="uicr_bootloader_start_address" start="0x10001014" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_bootloader_start_address" address_symbol="__start_uicr_bootloader_start_address" end_symbol="__stop_uicr_bootloader_start_address" start = "0x10001014" size="0x4" />
      </MemorySegment>
      <MemorySegment name="uicr_mbr_params_page" start="0x10001018" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_mbr_params_page" address_symbol="__start_uicr_mbr_params_page" end_symbol="__stop_uicr_mbr_params_page" start = "0x10001018" size="0x4" />
      </MemorySegment>

    Is my issue coming from the "uicr_bootloader_start_address" parameter in this file, which is "0x10001014" instead of something more close to the Memory Layout table you shared with me, which says we should expect the start address to be "0x000F8000"?

  • Hi, 

    What is the DK HW version? See the white sticker on the DK.

    What is the nrfjprog version (nrfjprog -v)? Could you try the latest version of the nRF Command Line Tools?

    -Amanda

  • Hello Amanda. Thanks for helping with this.

    On the older DK board, here is what the sticker says:

    • PCA10056
    • 1.1.0
    • 2019.25
    • 683638102

    On my most recent DK board:

    • PCA10056
    • 3.0.0
    • 2022.7
    • 1050260108

    My nrfjprog version is:

    • nrfjprog version: 10.12.1
    • JLinkARM.dll version: 7.60a

    The link you shared leads me to a "Page Not Found" error. But I was able to find a link to the nRF Command Line Tools downloads, and see that there is a 10.15.4 version, so I will try that now.

  • Hi, 

    cor10 said:
    The link you shared leads me to a "Page Not Found" error. But I was able to find a link to the nRF Command Line Tools downloads, and see that there is a 10.15.4 version, so I will try that now.

    Sorry for attaching the wrong link. I fix it now. Can the v10.15.4 work?

    -Amanda 

  • Hi Amanda, this v10.15.4 did perform much better. I was finally able to compile and flash everything to the device without any errors being thrown by the 'nrfjprog' command line tool. However, this did not resolve the same error which I refer to in my original post at the top.

    Specifically, this line of code:

    APP_ERROR_CHECK(ble_dfu_buttonless_async_svci_init());

    is still throwing the "No Bootloader Found" error. When I attach the debugger, I can see that this issue is with the Bootloader address. Inside this ble_dfu_buttonless_async_svci_init() function call, there is another function nrf_dfu_svci_vector_table_set():

    uint32_t nrf_dfu_svci_vector_table_set(void)
    {
        uint32_t err_code;
        uint32_t bootloader_addr = BOOTLOADER_ADDRESS;
    
        if (bootloader_addr != 0xFFFFFFFF)
        {
            NRF_LOG_INFO("Setting vector table to bootloader: 0x%08x", bootloader_addr);
            err_code = sd_softdevice_vector_table_base_set(bootloader_addr);
            if (err_code != NRF_SUCCESS)
            {
                NRF_LOG_ERROR("Failed running sd_softdevice_vector_table_base_set");
                return err_code;
            }
    
            return NRF_SUCCESS;
        }
    
        NRF_LOG_ERROR("No bootloader was found");
        return NRF_ERROR_NO_MEM;
    }

    This function checks to see if BOOTLOADER_ADDRESS is equal to 0xFFFFFFFF. In this case, BOOTLOADER_ADDRESS is defined in app_util.h, as:

    #define BOOTLOADER_ADDRESS      ((*(uint32_t *)MBR_BOOTLOADER_ADDR) == 0xFFFFFFFF ? *MBR_UICR_BOOTLOADER_ADDR : *(uint32_t *)MBR_BOOTLOADER_ADDR) 
    /**< The currently configured start address of the bootloader. If 0xFFFFFFFF, no bootloader start address is configured. */
    

    And this depends on the definition of MBR_BOOTLOADER_ADDR in nrf_mbr.h. Here are some relevant definitions from that header:

    /**@brief MBR SVC Base number. */
    #define MBR_SVC_BASE            (0x18)
    
    /**@brief Page size in words. */
    #define MBR_PAGE_SIZE_IN_WORDS  (1024)
    
    /** @brief The size that must be reserved for the MBR when a SoftDevice is written to flash.
    This is the offset where the first byte of the SoftDevice hex file is written. */
    #define MBR_SIZE                (0x1000)
    
    /** @brief Location (in the flash memory) of the bootloader address. */
    #define MBR_BOOTLOADER_ADDR      (0xFF8)
    
    /** @brief Location (in UICR) of the bootloader address. */
    #define MBR_UICR_BOOTLOADER_ADDR (&(NRF_UICR->NRFFW[0]))
    
    /** @brief Location (in the flash memory) of the address of the MBR parameter page. */
    #define MBR_PARAM_PAGE_ADDR      (0xFFC)
    
    /** @brief Location (in UICR) of the address of the MBR parameter page. */
    #define MBR_UICR_PARAM_PAGE_ADDR (&(NRF_UICR->NRFFW[1]))

    One would think that 0xFF8 is not equal to 0xFFFFFFFF....what could be happening here? Why wont the bootloader be recognized? Anything that I can try?

    Many thanks :)

    EDIT: Could it be due to my use of the dfu_secure_bootloader? I am seeing new behavior in the SEGGER Embedded Studio that is telling me my device is secured, and that if I want debugger connection, I must unsecure the device which causes a big ERASE of all flash memory. The only way I can attach the debugger is to accept and unsecure the device, which ERASES things. Could it be erasing all of the SoftDevice/Bootloader/AppImage/Settings that I just flashed, and this is why it complains about "No Bootloader"? This behavior never happened when using the secure dfu bootloader with the other nRF52840 DK and also never with our custom s132 device, so I am confused. Any help is appreciated.

Related