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

nrf52840 app and bootloader merge. the program did not jump to application execution.

I use sdk15.2.
bootloader nRF5_SDK_15.2.0_9412b96\examples\dfu\secure_bootloader\pca10056_ble_debug.
Application nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_buttonless_dfu.
step1:
nrfutil keys generate priv.pem
nrfutil keys display --key pk --format code --out_file dfu_public_key.c priv.pem
copy dfu_public_key.c to nRF5_SDK_15.2.0_9412b96\examples\dfu
step2:
Rbuil pca10056_ble_debug project.get bootloader.hex.
step3:
Rbuil ble_app_buttonless_dfu project.get app.hex.
step4:
nrfutil settings generate --family NRF52 --application nrf52840_app.hex --application-version 3 --bootloader-version 2 --bl-settings-version 1 settings_52840.hex
mergehex.exe -m s140_nrf52_6.1.0_softdevice.hex nrf52840_app.hex -o sd_and_app_52840.hex 
mergehex.exe -m sd_and_app_52840.hex  nrf52840_boot.hex -o sd_and_app_and_boot_52840.hex
mergehex.exe -m sd_and_app_and_boot_52840.hex settings_52840.hex -o sd_app_boot_setting_complete_52840.hex
step5:
nrfjprog.exe --family NRF52 --eraseall
nrfjprog.exe  --family NRF52 --program sd_app_boot_setting_complete_52840.hex
nrfjprog.exe  --family NRF52 --verify sd_app_boot_setting_complete_52840.hex
nrfjprog.exe  --reset
over.
But the program did not jump to app execution. (This method 52832 can run.)

Parents Reply
  • Hi.

    Could you try this:

    1. Flash your SoftDevice and Application without using mergehex.exe, does the application start?

    2. Flash your SoftDevice, Application, and bootloader without using mergehex.exe, does the application start?

    3. Flash your SoftDevice, Application, bootloader , and bootloader-settings-page without using mergehex.exe, does the application start?

    - Andreas

Children
  • Hi.

    Test 1: Softdevice and Application merge,application can be start.

    Test 2: Softdevice,Application and bootloader,application cann't start.

    Test 3: Softdevice ,Application,bootloader and settings.cann't start.

    The result is the same as nRFgo and mergehex.exe.

  • Hi.

    If test 2 fails then there is something wrong with the bootloader.

    Have you edited anything in the bootloader? If not, then the address jump in the bootloader is most likely wrong.

    - Andreas

  • Hi:

    this is test 2 log. I haven't changed anything bootloader or application.

    00> <info> app: Inside main
    00> <debug> app: In nrf_bootloader_init
    00> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    00> <debug> nrf_dfu_settings: Settings OK
    00> <debug> app: Enter nrf_bootloader_fw_activate
    00> <info> app: No firmware to activate.
    00> <debug> app: Enter nrf_dfu_app_is_valid
    00> <debug> app: No valid app to boot.
    00> <debug> app: DFU mode because app is not valid.
    00> <info> nrf_bootloader_wdt: WDT is not enabled
    00> <debug> app: in weak nrf_dfu_init_user
    00> <debug> app: timer_stop (0x200057D4)
    00> <debug> app: timer_activate (0x200057D4)
    00> <info> app: Entering DFU mode.
    00> <debug> app: Initializing transports (found: 1)
    00> <debug> nrf_dfu_ble: Initializing BLE DFU transport
    00> <debug> nrf_dfu_ble: Setting up vector table: 0x000F1000
    00> <debug> nrf_dfu_ble: Enabling SoftDevice.
    00> <debug> nrf_dfu_ble: Configuring BLE stack.
    00> <debug> nrf_dfu_ble: Enabling the BLE stack.
    00> <debug> nrf_dfu_ble: No advertising name found
    00> <debug> nrf_dfu_ble: Using default advertising name
    00> <debug> nrf_dfu_ble: Advertising...
    00> <debug> nrf_dfu_ble: BLE DFU transport initialized.
    00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
    00> <debug> app: Enter main loop

  • I do not have a good solution to this problem now. so if there is a better way to merge these hex, can you tell me?

  • Hi.

    Could you provide log from test 3?

    - Andreas

Related