Secure bootloader example linking error

Hello,

I have been working with custom nrf52832 board to develop firmware for my product. I have been trying to compile the example secure bootloader from the SDK v15.3.0 and faced with linking error.

section .uicr_bootloader_start_address VMA [0000000000000ff8,0000000000000ffb] overlaps section .reserved_flash VMA [0000000000000000,0000000000077fff]

I tried modifying the flash_placement.xml file based on this solution,

Segger 5.42: DFU link error section .uicr_bootloader_start_address VMA [0000000000000ff8,0000000000000ffb] overlaps section .reserved_flash VMA [0000000000000000,00000000000f7fff] - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com)

which resulted in a different error:

Rebuilding ‘secure_bootloader_ble_s132_pca10040_debug’ from solution ‘secure_bootloader_ble_s132_pca10040_debug’ in configuration ‘Release’
  Assembling ‘thumb_crt0.s’
  Compiling ‘nrf_log_backend_rtt.c’
  Compiling ‘nrf_log_backend_serial.c’
  Compiling ‘nrf_log_default_backends.c’
  Compiling ‘nrf_log_frontend.c’
  Compiling ‘nrf_log_str_formatter.c’
  Compiling ‘app_error_weak.c’
  Compiling ‘app_scheduler.c’
  Compiling ‘app_util_platform.c’
  Compiling ‘crc32.c’
  Compiling ‘mem_manager.c’
  Compiling ‘nrf_assert.c’
  Compiling ‘nrf_atfifo.c’
  Compiling ‘nrf_atomic.c’
  Compiling ‘nrf_balloc.c’
  Compiling ‘nrf_fprintf.c’
  Compiling ‘nrf_fprintf_format.c’
  Compiling ‘nrf_fstorage.c’
  Compiling ‘nrf_fstorage_nvmc.c’
  Compiling ‘nrf_fstorage_sd.c’
  Compiling ‘nrf_memobj.c’
  Compiling ‘nrf_queue.c’
  Compiling ‘nrf_ringbuf.c’
  Compiling ‘nrf_section_iter.c’
  Compiling ‘nrf_strerror.c’
  Compiling ‘sha256.c’
  Compiling ‘nrf_nvmc.c’
  Compiling ‘nrfx_atomic.c’
  Compiling ‘micro_ecc_backend_ecc.c’
  Compiling ‘micro_ecc_backend_ecdh.c’
  Compiling ‘micro_ecc_backend_ecdsa.c’
  Compiling ‘pb_common.c’
  Compiling ‘pb_decode.c’
  Compiling ‘boards.c’
  Compiling ‘nrf_dfu_svci.c’
  Compiling ‘nrf_dfu_svci_handler.c’
  Compiling ‘nrf_svc_handler.c’
  Compiling ‘nrf_crypto_ecc.c’
  Compiling ‘nrf_crypto_ecdsa.c’
  Compiling ‘nrf_crypto_hash.c’
  Compiling ‘nrf_crypto_init.c’
  Compiling ‘nrf_crypto_shared.c’
  Compiling ‘dfu_public_key.c’
  Compiling ‘main.c’
  Compiling ‘SEGGER_RTT.c’
  Compiling ‘SEGGER_RTT_printf.c’
  Compiling ‘nrf_bootloader.c’
  Compiling ‘nrf_bootloader_app_start.c’
  Compiling ‘nrf_bootloader_app_start_final.c’
  Compiling ‘nrf_bootloader_dfu_timers.c’
  Compiling ‘nrf_bootloader_fw_activation.c’
  Compiling ‘nrf_bootloader_info.c’
  Compiling ‘nrf_bootloader_wdt.c’
  Assembling ‘ses_startup_nrf52.s’
  Assembling ‘ses_startup_nrf_common.s’
  Compiling ‘system_nrf52.c’
  Compiling ‘nrf_sw_backend_hash.c’
  Compiling ‘ble_srv_common.c’
  Compiling ‘dfu-cc.pb.c’
  Compiling ‘nrf_dfu.c’
  Compiling ‘nrf_dfu_ble.c’
  Compiling ‘nrf_dfu_flash.c’
  Compiling ‘nrf_dfu_handling_error.c’
  Compiling ‘nrf_dfu_mbr.c’
  Compiling ‘nrf_dfu_req_handler.c’
  Compiling ‘nrf_dfu_settings.c’
  Compiling ‘nrf_dfu_settings_svci.c’
  Compiling ‘nrf_dfu_transport.c’
  Compiling ‘nrf_dfu_utils.c’
  Compiling ‘nrf_dfu_validation.c’
  Compiling ‘nrf_dfu_ver_validation.c’
  Compiling ‘nrf_sdh.c’
  Compiling ‘nrf_sdh_ble.c’
  Compiling ‘nrf_sdh_soc.c’
  Compiling ‘oberon_backend_chacha_poly_aead.c’
  Compiling ‘oberon_backend_ecc.c’
  Compiling ‘oberon_backend_ecdh.c’
  Compiling ‘oberon_backend_ecdsa.c’
  Compiling ‘oberon_backend_eddsa.c’
  Compiling ‘oberon_backend_hash.c’
  Compiling ‘oberon_backend_hmac.c’
  Generating linker script ‘secure_bootloader_ble_s132_pca10040_debug.ld’
  Linking secure_bootloader_ble_s132_pca10040_debug.elf
    Output/Release/Obj/secure_bootloader_ble_s132_pca10040_debug/nrf_svc_handler.o: in function `nrf_svc_handler_c':
    undefined reference to `__start_svc_data'
    C:\Users\aashy\Downloads\DeviceDownload (4)\nRF5SDK153059ac345\nRF5_SDK_15.3.0_59ac345\components\libraries\svc/nrf_svc_handler.c:83: undefined reference to `__stop_svc_data'
    Output/Release/Obj/secure_bootloader_ble_s132_pca10040_debug/nrf_sdh_ble.o:C:\Users\aashy\Downloads\DeviceDownload (4)\nRF5SDK153059ac345\nRF5_SDK_15.3.0_59ac345\components\softdevice\common/nrf_sdh_ble.c:64: undefined reference to `__start_sdh_ble_observers'
    Output/Release/Obj/secure_bootloader_ble_s132_pca10040_debug/nrf_sdh_ble.o:(.rodata.sdh_ble_observers+0x4): undefined reference to `__stop_sdh_ble_observers'
Build failed

I am building this example project in SEGGER Embedded Studio version 6.20a(64-bit). The compiled micro-ecc file is added to the project as well.

Reference: Getting started with Nordic's Secure DFU bootloader, a step by step guide - Software Development Kit - nRF5 SDK guides - Nordic DevZone (nordicsemi.com)

Any help is appreciated!

  • Hi,

    These symbols should be defined in the flash_placement.xml file. Did you remove anything when you added the suggested change from your linked post?

    Please compare the file towards the unmodified file from the SDK zip, to make sure you did not accidentally change something.

    Are you working on an older project, since you are using nRF5 SDK v 15.3.0? The latest version is v17.1.0, and I would recommend you to use this if you are starting a new project.

    We also recommend you to use the SES version specified in the release notes of the SDK, as this is the only version that have been tested and verified to work with the release.

    Best regards,
    Jørgen

Related