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

uicr_mbr_params_page and uicr_bootloader_start_address overwrite the beginning of the softdevice.

Hi,

      I am running SDK 15.3, nRF52840 on a custom board, Softdevice 6.1.1 and SES.

When running the secure dfu example I find that the two segments uicr_mbr_params_page and uicr_bootloader_start_address overwrite the beginning of  the softdevice. nrfConnect programmer stops identifying the softdevice - turns black - and shows it as one contiguous segment at a larger size.

nrf_dfu_mbr_init_sd returns 0x7  which is NRF_ERROR_INVALID_PARAM  which in turn is returned by sd_mbr_command which is documented as  "NRF_ERROR_INVALID_PARAM if an invalid command is given." This I am interpreting as an indication that the softdevice can't be run.

I have tried moving these two segments back to their former locations - as mentioned to solve the same issue with GCC 

<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="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="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>
  <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>

However that causes an unplaced sections overflow for .init in elf. Flash placement does include .init but doesn't specify a location.

<MemorySegment name="FLASH" start="$(FLASH_PH_START)" size="$(FLASH_PH_SIZE)">
    <ProgramSection load="no" name=".reserved_flash" start="$(FLASH_PH_START)" size="$(FLASH_START)-$(FLASH_PH_START)" />
    <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START)" />
    <ProgramSection alignment="4" load="Yes" name=".init" />
    <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
    <ProgramSection alignment="4" load="Yes" name=".text" />
    <ProgramSection alignment="4" keep="Yes" load="Yes" name=".crypto_data" inputsections="*(SORT(.crypto_data*))" address_symbol="__start_crypto_data" end_symbol="__stop_crypto_data" />
    <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_queue" inputsections="*(.nrf_queue*)" address_symbol="__start_nrf_queue" end_symbol="__stop_nrf_queue" />
    <ProgramSection alignment="4" keep="Yes" load="Yes" name=".dfu_trans" inputsections="*(SORT(.dfu_trans*))" address_symbol="__start_dfu_trans" end_symbol="__stop_dfu_trans" />
    <ProgramSection alignment="4" keep="Yes" load="Yes" name=".svc_data" inputsections="*(.svc_data*)" address_symbol="__start_svc_data" end_symbol="__stop_svc_data" />

The primary problem I want to fix is that softdevice isn't working. I am happy to try and fix the unplaced sections overflow or to fix the soft device over write whichever the wise heads suggest.

Many thanks in advance

Paul

Parents Reply Children
No Data
Related