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

DFU bootloader prevents to load app hex

Hi all,

I am on the DK-52 with the SDK 13.0.0.

After erasing the device, I follow this steps:

  1. upload the softdevice

    nrfjprog --reset --program s132_nrf52_4.0.2_softdevice.hex --family NRF52

  2. upload the bootloader (bootloader_secure_ble)

    nrfjprog --reset --program nrf52832_xxaa_s132.hex --family NRF52

After that the bootloader enters in DFU mode (LED1 and LED3 on)

If I try to upload my app firmware:

nrfjprog --reset --program pollen_device.hex --sectorerase --family NRF5

I get this error:

Argument provided has a wrong value. Memory access not aligned, value outside of range or similar

If I try to upload the app from my iPhone (using iOSDFULibrary) I am able to upload the app firmware, the device resets and the app starts correctly.

My app firmware has:

FLASH_START=0x1F000
SRAM_START=0x20001fe0

How do I correctly upload the app firmware via nrfjprog?

Thank you.

Parents
  • Hi Hung Bui, Thank you, you saved my day. Generating the bootloader settings made the trick. I am now able to upload the app firmware both from nrfjprog and form my mobile app.

    Maybe others are interested in the procedure that worked for me:

    1) Erase the device: nrfjprog -e --family NRF52 
    2) Generate the bootloader settings: nrfutil settings generate --family NRF52 --application pollen_device.hex --application-version 0x01 --bootloader-version 0 --bl-settings-version 1 bootloader_setting.hex
    3) Upload the settings: nrfjprog --program bootloader_setting.hex --family NRF52 
    4) Upload the bootloader: nrfjprog --reset --program nrf52832_xxaa_s132.hex --family NRF52 
    5) Upload the softdevice: rfjprog --reset --program s132_nrf52_4.0.2_softdevice.hex --family NRF52
    6) Upload the app firmware: nrfjprog --reset --program s132_nrf52_4.0.2_softdevice.hex --family NRF52
    
Reply
  • Hi Hung Bui, Thank you, you saved my day. Generating the bootloader settings made the trick. I am now able to upload the app firmware both from nrfjprog and form my mobile app.

    Maybe others are interested in the procedure that worked for me:

    1) Erase the device: nrfjprog -e --family NRF52 
    2) Generate the bootloader settings: nrfutil settings generate --family NRF52 --application pollen_device.hex --application-version 0x01 --bootloader-version 0 --bl-settings-version 1 bootloader_setting.hex
    3) Upload the settings: nrfjprog --program bootloader_setting.hex --family NRF52 
    4) Upload the bootloader: nrfjprog --reset --program nrf52832_xxaa_s132.hex --family NRF52 
    5) Upload the softdevice: rfjprog --reset --program s132_nrf52_4.0.2_softdevice.hex --family NRF52
    6) Upload the app firmware: nrfjprog --reset --program s132_nrf52_4.0.2_softdevice.hex --family NRF52
    
Children
No Data
Related