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

DFU: Settings to compile secure_bootloader_ble_s140_pca10056.hex

What are the memory settings in the SES compiler to compile secure_bootloader_ble_s140_pca10056

When I try to merge:

mergehex --merge s140_nrf52_7.2.0_softdevice.hex target_application.hex secure_bootloader_ble_s140_pca10056.hex --output temp_merg.hex

I get the failed message:

Parsing input files.
Merging file "s140_nrf52_7.2.0_softdevice.hex" into output.
Merging file "target_application.hex" into output.
Merging file "secure_bootloader_ble_s140_pca10056.hex" into output.
Overlapping segments detected at address 159744.ERROR: The hex files cannot be merged since there are conflicts.

Do I need to change any of the memory settings for the Linker?

Memory Segments, or Section Placement Macros?

In SES, The secure_bootloader_ble_s140_pca10056 project indicates it inherits from project in Common configuration

"FLASH_PH_START=0x0;

FLASH_PH_SIZE=0x100000;

RAM_PH_START=0x20000000;

RAM_PH_SIZE=0x40000;

FLASH_START=0xf8000;

FLASH_SIZE=0x6000;

RAM_START=0x20005978;

RAM_SIZE=0x3a688"

I got it to work some time ago with nRF5_SDK_17.0.2_d674dde, but now I use nRF5_SDK_17.1.0_ddde560 with no luck

Any help appreciated

  • Hello,

    Overlapping segments detected at address 159744.ERROR: The hex files cannot be merged since there are conflicts.

    Do I need to change any of the memory settings for the Linker?

    Memory Segments, or Section Placement Macros?

    In SES, The secure_bootloader_ble_s140_pca10056 project indicates it inherits from project in Common configuration

    The error indicates that there could indeed be an issue with the Section Placement Macros.
    Could you show me the Section Placement Macros for your target_application as well?

    I got it to work some time ago with nRF5_SDK_17.0.2_d674dde, but now I use nRF5_SDK_17.1.0_ddde560 with no luck

    Have you checked the release notes for the nRF5 SDK v17.1.0? There could be API changes or driver / SoftDevice version upgrades with the new release.

    Best regards,
    Karl

  • Karl,

    My target application Section Placement Macros
    FLASH_PH_START=0x0
    FLASH_PH_SIZE=0x100000
    RAM_PH_START=0x20000000
    RAM_PH_SIZE=0x40000
    FLASH_START=0x27000
    FLASH_SIZE=0xd9000
    RAM_START=0x20002ae8
    RAM_SIZE=0x3d518

    TheSection Placement Macros secure_bootloader_ble_s140_pca10056
    FLASH_PH_START=0x0
    FLASH_PH_SIZE=0x100000
    RAM_PH_START=0x20000000
    RAM_PH_SIZE=0x40000
    FLASH_START=0xf8000
    FLASH_SIZE=0x6000
    RAM_START=0x20005978
    RAM_SIZE=0x3a688

    I also changed these to the same as target application Section Placement Macros, but that did not work either, does not make sense

  • Karl,

    I did look at the release notes for the nRF5 SDK v17.1.0.

    It mentions that 

    mergehex.exe, which can produce a corrupted hex file.
    The issue has been fixed in the SES section-placement file (flash_placement.xml)
    by setting the memory section size attribute to 4.

    I use SES V5.62, so that should be OK.
    I use the latest mergehex version: 10.14.0 

    What should the Section Placement Macros for the secure_bootloader_ble_s140_pca10056 be?
    It is not clear if the placement causes the problem, or if
    mergehex still corrupts the hex file because of
    misalignment.

    Any help appreciated

  • I have the mergehex working.

    The issue was, I had to change Linker ->Memory Segments:

    FLASH1 RX 0x0 0x100000;RAM1 RWX 0x20000000 0x40000;mbr_params_page RX 0x000FE000 0x1000;bootloader_settings_page RX 0x000FF000 0x1000;uicr_bootloader_start_address RX 0x10001014 0x4;uicr_mbr_params_page RX 0x10001018 0x4

    The only uncertainty still is that one can use FLASH RX 0x0 0x100000; or FLASH1 RX 0x0 0x100000;

    Both work?

  • Hello again, 

    Thank you for your continued patience with this.

    Renix said:

    I have the mergehex working.

    The issue was, I had to change Linker ->Memory Segments:

    I am glad to hear that you were able to identify and resolve the root cause of this issue!
    Thanks for updating us with your solution as well - so that others might see this in the future if they experience a similar problem!

    Renix said:

    The only uncertainty still is that one can use FLASH RX 0x0 0x100000; or FLASH1 RX 0x0 0x100000;

    Both work?

    Yes, this was a backwards compatibility issue introduced by a change in the MDK supplied with nRF5 SDK v17.0.2 and v17.1.0. You should therefore use FLASH1.

    Here is the relevant exempt from the release notes:

    Compatibility of SES projects:
    
    Updates and fixes in the MDK used by SES break backwards compatibility
    with old SES project files.
    To use old projects in combination with this version of the SDK (MDK),
    make the following updates:
    
    1. In the flash_placement.xml file:
       MemorySegment name must be changed from "RAM" to "RAM1":
       <MemorySegment name="RAM1" start="$(RAM_PH_START)" size="$(RAM_PH_SIZE)">
    
    2. In the .emProject file:
       In "linker_section_placements_segments" you must refer to "RAM1", replacing "RAM":
       linker_section_placements_segments="FLASH RX 0x0 0x100000;RAM1 RWX 0x20000000 0x40000"
    
    ------------------


    Best regards,
    Karl

Related