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

Merged Hex File

Hello,

Softdevice: 7.0.1, SDK: 16.0, Device: nRF52840

In the production, we want to save time programming the devices. So I'm using following command to combine bootloader, softdevice and app into unified/merged hex file then program it through bootloader. But my device gets stuck in the "DfuTarg" status and reseting puts it again into same state. Please let me know what can go wrong?

@echo off

SET BOOTLD=bootloader.hex
SET APPHEX=app.hex
SET SOFTDV=s140_nrf52_7.0.1_softdevice.hex

echo "## Merging SD, bootloader and app files"
mergehex -m %BOOTLD% %SOFTDV% %APPHEX% -o complete_file.hex
echo.

echo "## Erasing complete chip..."
nrfjprog --family nRF52 --eraseall
echo.

echo "## Programming existing merged file"
nrfjprog --program complete_file.hex --chiperase
echo.


echo "## Making device to reset"
nrfjprog --reset
echo.

:end
pause

Parents
  • Hello,

    You need to generate and merge the Bootloader settings page as well. The settings page contains the information needed by the bootloader to verify and boot the application.

    Here's an example of how you can generate it with nrfutil:

     nrfutil settings generate --family NRF52^
     --application %APPHEX%^
     --application-version-string "%APP_VERSION_STRING%"^
     --bootloader-version %BL_VERSION%^
     --bl-settings-version 2^
     --app-boot-validation VALIDATE_GENERATED_CRC^
     bl_settings.hex

Reply
  • Hello,

    You need to generate and merge the Bootloader settings page as well. The settings page contains the information needed by the bootloader to verify and boot the application.

    Here's an example of how you can generate it with nrfutil:

     nrfutil settings generate --family NRF52^
     --application %APPHEX%^
     --application-version-string "%APP_VERSION_STRING%"^
     --bootloader-version %BL_VERSION%^
     --bl-settings-version 2^
     --app-boot-validation VALIDATE_GENERATED_CRC^
     bl_settings.hex

Children
Related