Loading ELF file fails in UICR, while loading HEX works on nRF52840

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Loading ELF file fails in UICR, while loading HEX works on nRF52840



      I'm using SES 4.52b with a (custom) nR52840 board.
      SES generates both .elf and .hex files.
      I've defined the following MemorySegment in the flash_placement.xml:

      XML Source Code: flash_placement.xml

      1. <MemorySegment name="UICR" start="0x10001000" size="0x308">
      2. <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" />
      3. <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" />
      4. <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_regout0" start="0x10001304" size="4"/>
      5. </MemorySegment>
      When I now start the debugger (which loads the .elf) the unused sections in this MemorySegment are filled with 0's. When I load the .hex file, the unused sections are properly filled with 0xff.

      Is this a bug in the .elf loader? Or is there a way to make sure the unused sections remain untouched while loading an .elf?

      Thanks in advance.

      Kind regards,

      Remco Poelstra
    • New

      Hello Remco,

      Thank you for your inquiry.
      The reason why one file is filled and one not is that hex files have 0xFF as default fill value.
      For the elf file this can be specified in project option Default Fill Pattern or you can use the fill attribute in the linker script.

      Best regards,
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.