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

Blinky example not working on nRF52840-Dongle when programmed externally by nRF52833-DK

Hi!

Currently I'm using the nRF5 SDK and successfully configured the SDK to compile the blinky example for pca10059 (nRF52840-Dongle).

When I plug the dongle and program it via nRF Connect, it works. I can also change the blink rate in the main.c and recompile and flash, the rate changes too.

I then tried to program it externally via a nRF52833-DK board. It programs fine, I see the light flashing while it burns the firmware, and this is the output after I do "make flash":

DONE nrf52840_xxaa
Flashing: _build/nrf52840_xxaa.hex
nrfjprog -f nrf52 --program _build/nrf52840_xxaa.hex --sectorerase
Parsing hex file.
Erasing page at address 0x1000.
Applying system reset.
Checking that the area to write is not protected.
Programming device.
nrfjprog -f nrf52 --reset
Applying system reset.
Run.

The issue is, when I change the blink rate from the default 500ms in main.c and reflash, it no longer turns on any LED.

If I compile it again for 500ms, it works again. I have performed a "make clean" between changing delay values and recompiling, but still, the same thing happens.

Obviously the hex is not the issue here, since the same hex is used on nRF Connect and "make flash" (nrfjprog).

I can't seem to figure out what the issue is.. Any help is greatly appreciated. Thank you!

Parents
  • Hi,

    Obviously the hex is not the issue here, since the same hex is used on nRF Connect and "make flash" (nrfjprog).

    I suspect that is it. Does the nRF52840 dongle still have the USB bootloader in place? If so, the bootloader may check if the application is valid and only start it if that is the case, depending on the configuration in the bootloader settings page. Therefore, you need to generate and flash a new bootloader setting page that either includes the correct CRC of the application you are flashing or is configured to skip boot validation (using "--app-boot-validation NO_VALIDATION" when you generate the settings page using nrfutil).

  • Hi Einar,

    Thanks for getting back to me. I have bad news haha.

    I tried to create a new bootloader image using nrfutil with --app-boot-validation NO_VALIDATION.

    Then I eagerly tried to burn it onto the chip.

    I went onto nRF Connect and connected to the nRF52840-DK and read the image, then did an erase all. The program hanged indefinitely. The partitioning of the read image before erasing everything looked unfamiliar, it had multiple partitions, not the usual MBR|APP.............|bootloader.

    I suspect that I might have screwed up the interface MCU.

    This is what I see now when I try to connect to the DK

    the log entry in red reads:

    "Could not fetch memory size of target devkit: Error: Error occured when get library info. Errorcode: CouldNotOpenDevice (0x4) Lowlevel error: JLINKARM_DLL_ERROR (ffffff9a)"

    I tried typing on command line: nrfjprog --recover

    I get:

    C:\Users\bash\OneDrive\Desktop>nrfjprog --recover
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.

    I also logged the above command with nrfjprog --recover --log.

    I have attached the log at the appendix of this message.

    So I downloaded the Interface MCU binary, turned off DK, held down IF BOOT/RESET, turned back on DK.

    Interface LED does turn on and flash when I drag and drop Interface MCU binary (it keeps flashing indefinitely and USB connectivity to PC is lost).

    I turn off/turn back on the DK and I try again to connect via nRF Connect, to no avail.

    Also, the nRF52840-Dongle is absolutely bricked too. When I connect it directly to the PC, no lights turn on, and the PC does not even recognize a plugged in USB device.

    If I could save the DK I would be over the moon. Thank you in advance.

    Appendix:

    Log output

    2020-Jun-09 22:30:29 --------------------------------------------------------------------------------
    2020-Jun-09 22:30:29 nrfjprog --recover --log
    2020-Jun-09 22:30:29 nrfjprog version 10.8.0
    2020-Jun-09 22:30:29 --------------------------------------------------------------------------------
    2020-Jun-09 22:30:29 nRF_logger_open
    2020-Jun-09 22:30:29 nRF_logger_open: nRFJProg logger opened to callback at address 0X2F0940
    2020-Jun-09 22:30:29 nRF_open_dll
    2020-Jun-09 22:30:29 nRF_open_dll: Load library at "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\JLINKARM_UNKNOWN_NRFJPROG.dll".

    2020-Jun-09 22:30:29 . nRFXX_logger_open
    2020-Jun-09 22:30:29 . nRFXX_logger_open: nRFJProg logger opened to callback at address 0X68FFB850
    2020-Jun-09 22:30:29 . . Segger_logger_open
    2020-Jun-09 22:30:29 . . Segger_logger_open: nRFJProg logger opened to callback at address 0X68FBC8A0
    2020-Jun-09 22:30:29 . . Segger_open_dll
    2020-Jun-09 22:30:29 . . Segger_open_dll: Load library at "C:\\Program Files (x86)\\SEGGER\\JLink\\JLinkARM.dll".

    2020-Jun-09 22:30:29 . . . Segger_dll_version
    2020-Jun-09 22:30:29 . . Segger_set_core_data
    2020-Jun-09 22:30:29 nRF_enum_emu_snr
    2020-Jun-09 22:30:29 . nRFXX_enum_emu_snr
    2020-Jun-09 22:30:29 . . Segger_enum_emu_snr
    2020-Jun-09 22:30:29 . . . Segger_enum_emu_snr
    2020-Jun-09 22:30:29 . . . . Segger_get_num_emus
    2020-Jun-09 22:30:30 nRF_connect_to_emu_with_snr
    2020-Jun-09 22:30:30 . nRFXX_connect_to_emu_with_snr
    2020-Jun-09 22:30:30 . . Segger_connect_to_emu_with_snr
    2020-Jun-09 22:30:30 . . . Segger_is_connected_to_emu
    2020-Jun-09 22:30:30 . . . Segger_enum_emu_snr
    2020-Jun-09 22:30:30 . . . . Segger_get_num_emus
    2020-Jun-09 22:30:30 . . . Segger_connect_to_emu_with_snr
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: Segger logging enabled with callback at 0x1761332272.

    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:021.738
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:024.926
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO Hardware: V1.00
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:026.317
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO S/N: 685785838
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:027.584
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO OEM: SEGGER
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:028.641
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:030.540
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO TELNET listener socket opened on port 19021
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:032.087
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO WEBSRV Starting webserver
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:033.680
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO WEBSRV Webserver running on local port 19080
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:035.008
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO - 17.625ms returns O.K.
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:036.509
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO JLINK_GetHWStatus(...)
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:038.108
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO - 2.238ms returns 0x00
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:039.404
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO JLINK_ExecCommand("SetRestartOnClose = 0", ...).
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:040.628
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO - 0.561ms returns 0x01
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:041.721
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO JLINK_ExecCommand("DisableFlashDL", ...).
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:043.059
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO - 1.035ms returns 0x00
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:044.962
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:046.675
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO - 0.807ms returns 0x00
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:048.255
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO JLINK_SetHookUnsecureDialog(...)
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:050.322
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO - 2.905ms returns 0
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:051.960
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO JLINK_TIF_Select(JLINKARM_TIF_SWD)
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:054.191
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO - 3.094ms returns 0x00
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:055.922
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO JLINK_SetSpeed(2000)
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO T0104 000:057.747
    2020-Jun-09 22:30:30 . . . . Segger_connect_to_emu_without_snr: JLink INFO - 2.779ms
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO T0104 000:060.597
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...).
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO T0104 000:062.240
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO - 1.119ms returns 0x00
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO T0104 000:064.042
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO JLINK_ExecCommand("device = Cortex-M4", ...).
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO T0104 000:073.878
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO XML file found at: C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO T0104 000:076.133
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml evaluated successfully.
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO T0104 000:122.563
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO Device "CORTEX-M4" selected.
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO T0104 000:125.935
    2020-Jun-09 22:30:30 . . . . . Segger_load_core_data: JLink INFO - 61.053ms returns 0x00
    2020-Jun-09 22:30:30 nRF_read_connected_emu_snr
    2020-Jun-09 22:30:30 . nRFXX_read_connected_emu_snr
    2020-Jun-09 22:30:30 . . Segger_read_connected_emu_snr
    2020-Jun-09 22:30:30 . . . Segger_is_connected_to_emu
    2020-Jun-09 22:30:30 . . . Segger_is_connected_to_emu: JLink INFO T0104 000:129.542
    2020-Jun-09 22:30:30 . . . Segger_is_connected_to_emu: JLink INFO JLINK_IsOpen()
    2020-Jun-09 22:30:30 . . . Segger_is_connected_to_emu: JLink INFO T0104 000:130.675
    2020-Jun-09 22:30:30 . . . Segger_is_connected_to_emu: JLink INFO - 1.721ms returns 0x01
    2020-Jun-09 22:30:30 nRF_read_device_family
    2020-Jun-09 22:30:30 . nRFXX_read_device_family
    2020-Jun-09 22:30:30 . . Segger_is_connected_to_emu
    2020-Jun-09 22:30:30 . . Segger_is_connected_to_emu: JLink INFO T0104 000:133.518
    2020-Jun-09 22:30:30 . . Segger_is_connected_to_emu: JLink INFO JLINK_IsOpen()
    2020-Jun-09 22:30:30 . . Segger_is_connected_to_emu: JLink INFO T0104 000:134.647
    2020-Jun-09 22:30:30 . . Segger_is_connected_to_emu: JLink INFO - 1.686ms returns 0x01
    2020-Jun-09 22:30:30 . . : JLink INFO T0104 000:135.803
    2020-Jun-09 22:30:30 . . : JLink INFO JLINK_Lock()
    2020-Jun-09 22:30:30 . . Segger_read_debug_port_idr
    2020-Jun-09 22:30:30 . . . Segger_read_debug_port_register
    2020-Jun-09 22:30:30 . . . . Segger_read_debug_port_register
    2020-Jun-09 22:30:30 . . . . . Segger_coresight_configure
    2020-Jun-09 22:30:30 . . . . . Segger_coresight_configure: JLink INFO T0104 000:139.340
    2020-Jun-09 22:30:30 . . . . . Segger_coresight_configure: JLink INFO JLINK_CORESIGHT_Configure()
    2020-Jun-09 22:30:30 . . . . . Segger_coresight_configure: JLink INFO T0104 000:241.683
    2020-Jun-09 22:30:30 . . . . . Segger_coresight_configure: JLink INFO - 103.445ms returns 0
    2020-Jun-09 22:30:30 . . . . Segger_read_debug_port_register: JLink INFO T0104 000:243.528
    2020-Jun-09 22:30:30 . . . . Segger_read_debug_port_register: JLink INFO JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x00)
    2020-Jun-09 22:30:30 . . . . Segger_read_debug_port_register: JLink INFO T0104 000:245.711
    2020-Jun-09 22:30:30 . . . . Segger_read_debug_port_register: JLink INFO failed
    2020-Jun-09 22:30:30 . . . . Segger_read_debug_port_register: JLink INFO T0104 000:247.387
    2020-Jun-09 22:30:30 . . . . Segger_read_debug_port_register: JLink INFO - 4.437ms returns -1
    2020-Jun-09 22:30:30 . . . . Segger_read_debug_port_register: JLinkARM.dll reported "-1", an unknown error.

    2020-Jun-09 22:30:30 . . . . . Segger_abort_debug_action
    2020-Jun-09 22:30:30 . . . . . Segger_abort_debug_action: Attempting to clear any configuration errors in debug port before closing connection.

    2020-Jun-09 22:30:30 . . . . . Segger_abort_debug_action: JLink INFO T0104 000:250.238
    2020-Jun-09 22:30:30 . . . . . Segger_abort_debug_action: JLink INFO JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)
    2020-Jun-09 22:30:30 . . . . . Segger_abort_debug_action: JLink INFO T0104 000:252.425
    2020-Jun-09 22:30:30 . . . . . Segger_abort_debug_action: JLink INFO - 3.064ms returns -1
    2020-Jun-09 22:30:30 . . . . . Segger_abort_debug_action: JLinkARM.dll reported "-1", an unknown error.

    2020-Jun-09 22:30:30 . . : JLink INFO T0104 000:254.697
    2020-Jun-09 22:30:30 . . : JLink INFO JLINK_Unlock()
    2020-Jun-09 22:30:30 nRF_close_dll
    2020-Jun-09 22:30:30 . nRFXX_close_dll
    2020-Jun-09 22:30:30 . . Segger_close
    2020-Jun-09 22:30:30 . . . Segger_disconnect_from_emu
    2020-Jun-09 22:30:30 . . . . Segger_is_connected_to_emu
    2020-Jun-09 22:30:30 . . . . Segger_is_connected_to_emu: JLink INFO T0104 000:258.579
    2020-Jun-09 22:30:30 . . . . Segger_is_connected_to_emu: JLink INFO JLINK_IsOpen()
    2020-Jun-09 22:30:30 . . . . Segger_is_connected_to_emu: JLink INFO T0104 000:259.693
    2020-Jun-09 22:30:30 . . . . Segger_is_connected_to_emu: JLink INFO - 1.669ms returns 0x01
    2020-Jun-09 22:30:30 . . . . Segger_disconnect_from_emu
    2020-Jun-09 22:30:30 . . . . . Segger_is_connected_to_device
    2020-Jun-09 22:30:30 . . . . . Segger_is_connected_to_device: JLink INFO T0104 000:261.987
    2020-Jun-09 22:30:30 . . . . . Segger_is_connected_to_device: JLink INFO JLINK_IsConnected()
    2020-Jun-09 22:30:30 . . . . . Segger_is_connected_to_device: JLink INFO T0104 000:263.057
    2020-Jun-09 22:30:30 . . . . . Segger_is_connected_to_device: JLink INFO - 1.595ms returns FALSE
    2020-Jun-09 22:30:30 . . . . . Segger_is_debug_region_powered
    2020-Jun-09 22:30:30 . . . . . . Segger_read_debug_port_register
    2020-Jun-09 22:30:30 . . . . . . . Segger_is_connected_to_emu
    2020-Jun-09 22:30:30 . . . . . . . Segger_is_connected_to_emu: JLink INFO T0104 000:265.848
    2020-Jun-09 22:30:30 . . . . . . . Segger_is_connected_to_emu: JLink INFO JLINK_IsOpen()
    2020-Jun-09 22:30:30 . . . . . . . Segger_is_connected_to_emu: JLink INFO T0104 000:267.173
    2020-Jun-09 22:30:30 . . . . . . . Segger_is_connected_to_emu: JLink INFO - 1.955ms returns 0x01
    2020-Jun-09 22:30:30 . . . . . . Segger_read_debug_port_register: JLink INFO T0104 000:268.419
    2020-Jun-09 22:30:30 . . . . . . Segger_read_debug_port_register: JLink INFO JLINK_Lock()
    2020-Jun-09 22:30:30 . . . . . . . Segger_write_debug_port_register
    2020-Jun-09 22:30:30 . . . . . . . Segger_write_debug_port_register: JLink INFO T0104 000:270.326
    2020-Jun-09 22:30:30 . . . . . . . Segger_write_debug_port_register: JLink INFO JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
    2020-Jun-09 22:30:30 . . . . . . . Segger_write_debug_port_register: JLink INFO T0104 000:272.389
    2020-Jun-09 22:30:30 . . . . . . . Segger_write_debug_port_register: JLink INFO - 2.788ms returns -1
    2020-Jun-09 22:30:30 . . . . . . . Segger_write_debug_port_register: JLinkARM.dll reported "-1", an unknown error.

    2020-Jun-09 22:30:30 . . . . . . . . Segger_abort_debug_action
    2020-Jun-09 22:30:30 . . . . . . . . Segger_abort_debug_action: Attempting to clear any configuration errors in debug port before closing connection.

    2020-Jun-09 22:30:30 . . . . . . . . Segger_abort_debug_action: JLink INFO T0104 000:275.710
    2020-Jun-09 22:30:30 . . . . . . . . Segger_abort_debug_action: JLink INFO JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)
    2020-Jun-09 22:30:30 . . . . . . . . Segger_abort_debug_action: JLink INFO T0104 000:277.846
    2020-Jun-09 22:30:30 . . . . . . . . Segger_abort_debug_action: JLink INFO - 2.770ms returns -1
    2020-Jun-09 22:30:30 . . . . . . . . Segger_abort_debug_action: JLinkARM.dll reported "-1", an unknown error.

    2020-Jun-09 22:30:30 . . . . . . Segger_read_debug_port_register: JLink INFO T0104 000:279.733
    2020-Jun-09 22:30:30 . . . . . . Segger_read_debug_port_register: JLink INFO JLINK_Unlock()
    2020-Jun-09 22:30:30 . . . . Segger_disconnect_from_emu: JLink INFO T0104 000:295.808
    2020-Jun-09 22:30:30 . . . . Segger_disconnect_from_emu: JLink INFO JLINK_Close()
    2020-Jun-09 22:30:30 . . Segger_close: Freeing Library.

    2020-Jun-09 22:30:30 nRF_close_dll: Freeing Library.

  • Hi,

    Bash said:
    I tried to create a new bootloader image using nrfutil with --app-boot-validation NO_VALIDATION.

    There is no need to make a new bootloader, just keep the existing one. You only need to update the bootloader settings page (which is the very last flash page).

    Bash said:
    I suspect that I might have screwed up the interface MCU.

    If you do a full chip erase, that will also erase the UICR, which includes the configuration for regulator 0. So the chip is now powered by 1.8 V (default), and in that state, it cannot be debugged from the DK. There are a few ways to recover from though. Please refer to the "Recover after an accidental UICR erase" section in the nRF52840 Dongle Programming Tutorial for how to recover.

  • Hooray!

    Progress! Currently I have restored the bootloader, and managed to re-flash the app.

    The main issue persists, but with more progress:

    I generate new bootloader settings page for a given app hex.

    The new bootloader settings page looks like this:

    Bootloader DFU Settings:
    * File: settings.hex
    * Family: NRF52840
    * Start Address: 0x000FF000
    * CRC: 0xAD74C244
    * Settings Version: 0x00000002 (2)
    * App Version: 0x00000003 (3)
    * Bootloader Version: 0x00000002 (2)
    * Bank Layout: 0x00000000
    * Current Bank: 0x00000000
    * Application Size: 0x00000724 (1828 bytes)
    * Application CRC: 0xC1ECFCF4
    * Bank0 Bank Code: 0x00000001
    * Softdevice Size: 0x00000000 (0 bytes)
    * Boot Validation CRC: 0xACDA1BA2
    * SD Boot Validation Type: 0x00000000 (0)
    * App Boot Validation Type: 0x00000000 (0)

    The App validation is of type NO_VALIDATION.

    But when the application is updated and flashed, the Dongle enters DFU mode.

    Everytime I update the application, I have to create a new bootloader settings page and flash it to the Dongle for it to work. Therefore, it seems that the bootloader is ignoring the App Boot Validation Type setting.

    This is OK for me personally I suppose, but the question is, how did nRF Connect manage to automatically update the bootloader settings page for every application hex? Is this feature purposefully ignored in the makefile?

    Thank you so much for your help, you've been great so far!

  • Hi,

    Bash said:
    Everytime I update the application, I have to create a new bootloader settings page and flash it to the Dongle for it to work. Therefore, it seems that the bootloader is ignoring the App Boot Validation Type setting.

    I see. if you check the generated .hex files with the settings, does it also cover the MBR params page (second to the last page), or just the last page? If it only has data on the last page then it does not overwrite the backup page. The backup page should be populated as well though unless you added "--no-backup" or perhaps if you are using an old nrfutil.

    Bash said:
    This is OK for me personally I suppose, but the question is, how did nRF Connect manage to automatically update the bootloader settings page for every application hex? Is this feature purposefully ignored in the makefile?

    It is not nRF Connect that does this manually. Rather it is the fact that the nRF Connect programs the nRF52840 dongle via USB DFU, and then it is the bootloader that updates the bootloader settings page during the update procedure. So the bootloader settings page only needs to be touched if you are programming via a debugger instead of DFU.

  • Hi Einar,

    This is my current input for nrf util:

    nrfutil settings generate --family NRF52840 --application nrf52840_xxaa.hex --application-version 3 --bootloader-version 2 --bl-settings-version 2 settings.hex --app-boot-validation NO_VALIDATION

    calling nrfutil version returns nrfutil version 6.1.0, which appears to be the latest.

    As for the settings page, yes it also covers MBR params page, where MBR params page which spans address space 0x000FE000-0x000FE323 (804 bytes), and bootloader settings page 0x000FF000-0x000FF323 (804 bytes). This is what I see from nRF Connect in the top of the memory map.

    EDIT:

    I have managed to get it working.

    I used the open bootloader from examples\dfu\open_bootloader\pca10059_usb_debug\hex and just flashed that onto the chip. Now I can code in peace.

    Thanks a lot for all your help!

Reply
  • Hi Einar,

    This is my current input for nrf util:

    nrfutil settings generate --family NRF52840 --application nrf52840_xxaa.hex --application-version 3 --bootloader-version 2 --bl-settings-version 2 settings.hex --app-boot-validation NO_VALIDATION

    calling nrfutil version returns nrfutil version 6.1.0, which appears to be the latest.

    As for the settings page, yes it also covers MBR params page, where MBR params page which spans address space 0x000FE000-0x000FE323 (804 bytes), and bootloader settings page 0x000FF000-0x000FF323 (804 bytes). This is what I see from nRF Connect in the top of the memory map.

    EDIT:

    I have managed to get it working.

    I used the open bootloader from examples\dfu\open_bootloader\pca10059_usb_debug\hex and just flashed that onto the chip. Now I can code in peace.

    Thanks a lot for all your help!

Children
No Data
Related