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

Device enters and stays in bootloader mode on start

Hi Team,

I am prototyping a product that includes DFU OTA using nRF52832.
To get familiar with the topic, I am experimenting with the buttonless DFU example.

It is working fine with the pre-compiled test-image sd_s132_bootloader_buttonless_with_setting_page_dfu_secure_ble_debug_with_bonds.hex.
However, I would like to make changes to the example app and create my own DFU-ready firmware. When I do that, after downloading the image to the device, it automatically goes to bootloader mode, and I cannot make it run the firmware app itself.
I generated my key pair and replaced the default one, installed microECC, compiled hex files for the bootloader and for the app. 
Then generated the boot loader settings page:
nrfutil settings generate --family NRF52 --application ble_app_buttonless_dfu_pca10040_s132.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 bl_settings_page.hex
Output:
Bootloader DFU Settings:
* File: bl_settings_page.hex
* Family: nRF52
* Start Address: 0x0007F000
* CRC: 0xA3601442
* Settings Version: 0x00000001 (1)
* App Version: 0x00000001 (1)
* Bootloader Version: 0x00000001 (1)
* Bank Layout: 0x00000000
* Current Bank: 0x00000000
* Application Size: 0x0000CF68 (53096 bytes)
* Application CRC: 0x97473D39
* Bank0 Bank Code: 0x00000001
* Softdevice Size: 0x00000000 (0 bytes)
* Boot Validation CRC: 0x00000000
* SD Boot Validation Type: 0x00000000 (0)
* App Boot Validation Type: 0x00000000 (0)

The merged all the hex files into the final image: 
mergehex --merge s132_nrf52_7.2.0_softdevice.hex ble_app_buttonless_dfu_pca10040_s132 secure_bootloader_ble_s132_pca10040.hex --output temp_merg.hex
mergehex --merge s132_nrf52_7.2.0_softdevice.hex ble_app_buttonless_dfu_pca10040_s132.hex secure_bootloader_ble_s132_pca10040.hex --output temp_merg.hex

Another strange thing that I think is related this problem: after downloading this image to the device, nRF Programmer shows that there is no SoftDevice on it. See the screenshot attached - the blue area is missing on the figure on the right side.

Can you please help me solve this issue(s)?

Thanks in advance,
Tibor

Parents
  • Hi Tibor,

    Do you include the settings page in your merged hex file? I do not see it listed where you copy--pasted the mergehex commands. If not, then it would explain what you are seeing.

    If the above is not the problem, then perhaps you are seeing a known issue with the latest mergehex (10.12.1) where it can create corrupt images. Can you revert to an older version and see if the issue persist? Alternatively add all separate hex files to nRF Connect Programmer instead of using mergehex?

    If the issue persists then it would be good if you can test with the debug bootloader project (suffixed _debug) which includes RTT logging and upload the log here. In most cases the RTT log gives a good indication of where to look.

    Einar

  • Hi Einar,

    Thanks a lot for your reply!

    "Do you include the settings page in your merged hex file? I do not see it listed where you copy--pasted the mergehex commands. If not, then it would explain what you are seeing."

    Sorry, I accidentally copy-pasted the same command twice. It should look like this: 

    mergehex --merge s132_nrf52_7.2.0_softdevice.hex ble_app_buttonless_dfu_pca10040_s132 secure_bootloader_ble_s132_pca10040.hex --output temp_merg.hex
    mergehex --merge temp_merg.hex bl_settings_page.hex --output dfu_target_firmware.hex

    mergehex broken into 2 parts, including the bootloader settings page too.

    I'll try out the proposed solutions as soon as I can.

    Thanks,
    Tibor

     

Reply
  • Hi Einar,

    Thanks a lot for your reply!

    "Do you include the settings page in your merged hex file? I do not see it listed where you copy--pasted the mergehex commands. If not, then it would explain what you are seeing."

    Sorry, I accidentally copy-pasted the same command twice. It should look like this: 

    mergehex --merge s132_nrf52_7.2.0_softdevice.hex ble_app_buttonless_dfu_pca10040_s132 secure_bootloader_ble_s132_pca10040.hex --output temp_merg.hex
    mergehex --merge temp_merg.hex bl_settings_page.hex --output dfu_target_firmware.hex

    mergehex broken into 2 parts, including the bootloader settings page too.

    I'll try out the proposed solutions as soon as I can.

    Thanks,
    Tibor

     

Children
No Data
Related