DFU Package overlapping segment

I am kind of dumbly following a guide and got as far as collecting the .hex files and attempting to merge a dfu package using the nrf-command-line-tools;

\ota_dfu_util> .\nrf-command-line-tools\bin\mergehex.exe --merge OSL_DFU_Settings.hex OSL_Bootloader.hex s112_nrf52_7.2.0_softdevice.hex OSL_Firmware.hex --output OSL_DFU_Package.hex
Parsing input files.
Merging file "OSL_DFU_Settings.hex" into output.
Merging file "OSL_Bootloader.hex" into output.
Merging file "s112_nrf52_7.2.0_softdevice.hex" into output.
Merging file "OSL_Firmware.hex" into output.

So this error is lost on me. Guidance would be greatly appreciated.

Thanks,

Kevin Lamb

  • <error> app: No bootloader was found
    <debug> nrf_sdh: State request: 0x00000000
    <debug> nrf_sdh: State change: 0x00000000
    <debug> nrf_sdh: State change: 0x00000001
    <debug> nrf_sdh_ble: RAM starts at 0x20002EA0
    <info> app: device reset

    FLASH_PH_START=0x0
    FLASH_PH_SIZE=0x30000
    RAM_PH_START=0x20000000
    RAM_PH_SIZE=0x6000
    FLASH_START=0x19000
    FLASH_SIZE=0x17000
    RAM_START=0x20002EA0
    RAM_SIZE=0x3160

  • Hello Kevin,

    Sorry, but I don't see any errors in the 'mergehex.exe' output you posted. Did you mean to post something else? Also, which bootloader project did you use? 

    <error> app: No bootloader was found

    Do you see this after programming the merged 'OSL_DFU_Package.hex' file to your board? Either way, please read out the UICR register at 0x10001014. This register should contain the start address of the bootloader if it was correctly programmed.

    Reading the UICR register with nrfjprog.exe

    $ nrfjprog --memrd 0x10001014

    Best regards,

    Vidar

  • Wow I really failed to give a bit of context in my previous post, apologies. So this time around I generated a new bootloader hex from the secure_bootloader example (with some modifications for nrf52811).

    Here's my latest bout with the powershell;

    PS \ota_dfu_util> .\nrf-command-line-tools\bin\nrfjprog.exe --program OSL_Bootloader.hex --verify
    [ #################### ]   0.294s | Program file - Done programming
    [ #################### ]   0.165s | Verify file - Done verifying
    PS ota_dfu_util> .\nrf-command-line-tools\bin\nrfjprog.exe --memrd 0x10001014
    0x10001014: FFFFFFFF                              |....|
    PS \ota_dfu_util> .\nrf-command-line-tools\bin\mergehex.exe --merge OSL_DFU_Settings.hex OSL_Bootloader.hex s112_nrf52_7.2.0_softdevice.hex OSL_Firmware.hex --output OSL_DFU_Package.hex
    Parsing input files.
    Merging file "OSL_DFU_Settings.hex" into output.
    Merging file "OSL_Bootloader.hex" into output.
    Merging file "s112_nrf52_7.2.0_softdevice.hex" into output.
    Merging file "OSL_Firmware.hex" into output.
    Overlapping segments detected at address 102400.ERROR: The hex files cannot be merged since there are conflicts.

    I'm not sure where the bootloader starts but it looks like it was complaining about address 0x00102014.

    PS \ota_dfu_util> .\nrf-command-line-tools\bin\nrfjprog.exe --memrd 0x00102400
    0x00102400: 00000000                              |....|

    Update: Looking at the datasheet for nrf58211 it looks like the UICR starts at 0x10001000;

    PS \ota_dfu_util> .\nrf-command-line-tools\bin\nrfjprog.exe --memrd 0x10000000
    0x10000000: 55AA55AA                              |.U.U|
    PS \ota_dfu_util> .\nrf-command-line-tools\bin\nrfjprog.exe --memrd 0x10001000
    0x10001000: FFFFFFFF                              |....|

    This is the memory parameters for the application;
    FLASH_PH_START=0x0
    FLASH_PH_SIZE=0x30000
    RAM_PH_START=0x20000000
    RAM_PH_SIZE=0x6000
    FLASH_START=0x19000
    FLASH_SIZE=0x17000
    RAM_START=0x20002EA0
    RAM_SIZE=0x3160

    (These were acquired by the datasheets/the program telling me the memory space needed and help from this ticket)

    This is the output when programming the application via SES and then running;

    <error> app: No bootloader was found
    <debug> nrf_sdh: State request: 0x00000000
    <debug> nrf_sdh: State change: 0x00000000
    <debug> nrf_sdh: State change: 0x00000001
    <debug> nrf_sdh_ble: RAM starts at 0x20002EA0
    <info> app: device reset

    The <error> is after using .\nrf-command-line-tools\bin\nrfjprog.exe --program OSL_Bootloader.hex --verify.

    I noticed I got the same error from nrfjprog when I loaded the bootloader directly from SES.

    The memory parameters for the bootloader are;
    FLASH_PH_START=0x0
    FLASH_PH_SIZE=0x30000
    RAM_PH_START=0x20000000
    RAM_PH_SIZE=0x6000
    FLASH_START=0x19000
    FLASH_SIZE=0xE000
    RAM_START=0x20000000
    RAM_SIZE=0x6000

     

    There's a bit of a gap in my understanding of bootloaders so maybe more education needed in this situation?


  • No worries. Thank you for providing the additional context.

    secure_bootloader example (with some modifications for nrf52811).

    Which specific project configuration did you use? Projects with 'pca10056e' in their names already have the correct linker and startup files for the nRF52811. The only change required for these projects to run on a 52811 is described here: Transferring the project to nRF52811 hardware.

    I'm not sure where the bootloader starts but it looks like it was complaining about address 0x00102014.

    It appears that merge is printing the address as a decimal value, so the actual address is really 0x19000, not 0x00102014. However, I'm not sure which of the hex files have overlapping data at this address. As a test, maybe try to merge only the OSL_Bootloader.hex with OSL_Firmware.hex to see if you get the same error. 

    Edit: I see the problem now: it is the bootloader image that overlaps with the application. The bootloader is supposed to be placed at the end of the flash, as illustrated here: Memory layout.

    Please try to build and program the project in /examples/dfu/secure_bootloader/pca10056e_s112_ble_debug and see if it will run on your board. I also recommend you take a look at the  Getting started with Nordic's Secure DFU bootloader, a step by step guide if you have not already.

  • Okay I see the placement differences. Thanks.

    I changed things to use /examples/dfu/secure_bootloader/pca10056e_s112_ble_debug

    It seems to generate a error after building;

    cannot find ../../../../../external/micro-ecc/nrf52nf_armgcc/armgcc/micro_ecc_lib_nrf52.a: No such file or directory

    I think the disconnect for me is in step B1a. Compile the uECC library of the guide. I assume this process generates the micro_ecc_lib_nrf52.a file? But I cannot seem to have it make for me via PowerShell. I tried Makefile since that seems to be the name of the file in the folder. Still nothing. Thoughts?

    Thanks,
    Kevin

Related