Hi Everyone,
I am using NRF52833 in my project and have implemented OTA on it. OTA works fine. One issue is when I program the device for the 1st time using the merged hex file, the device stays in bootloader mode. It does not jump to application even though the merge file includes the application file.
I am using merge hex to combine the softdevice, bootloader and application file. I give the following script to generate merged hex file:-
@echo off :: # Check to make sure nrfjprog is installed before moving on WHERE >nul 2>nul nrfjprog IF %ERRORLEVEL% NEQ 0 ( ECHO "nrfjprog was not found in PATH, please install using windows installed as found on nordicsemi.com" goto :end ) WHERE >nul 2>nul mergehex IF %ERRORLEVEL% NEQ 0 ( ECHO "mergehex was not found in PATH, please install using windows installed as found on nordicsemi.com" goto :end ) SET S140=s140_nrf52_7.2.0_softdevice.hex SET BOOTLOADER=bootloader.hex SET APPLICATION=application.hex echo "## Looking to make sure %S140% exists" if not exist %S140% ( echo "#### s140 hex file does not exist! Make sure the softdevice is in the same folder as this script!" goto :end ) echo. echo "## Looking to make sure %BOOTLOADER% exists" if not exist %BOOTLOADER% ( echo "#### Bootloader hex file does not exist! Please make sure its compiled, copied, and renamed into this folder!" goto :end ) echo. echo "## Looking to make sure APPLICATION% exists" if not exist %APPLICATION% ( echo "#### APPLICATION hex file does not exist! Please make sure its compiled, copied, and renamed into this folder!" goto :end ) echo. mergehex -v echo "## Merging S140 and bootloader, then flashing it to nRF52-DK; make sure the DK is powered on and connected to the PC" mergehex -m %S140% %BOOTLOADER% %APPLICATION% -o merged_SD_bootloader.hex nrfjprog --program merged_SD_bootloader.hex --chiperase echo. echo "## Please power cycle the DK and then with nRF Connect, make sure the board is in bootloader mode and ADV as DfuTarg" echo. :end pause
After running this script I load the generated merged hex file into device. Now what I have observed is the device stays in the bootloader mode. It does not automatically go into application mode.
What changes are needed to do so that after flashing this merged hex file, the device will come out of bootloader mode and start running the application. Is something wrong with my merge hex method?
I am getting the following error:-
00> <info> app: Inside main
00>
00> <info> nrf_dfu_settings: Old settings page detected. Upgrading info.
00>
00> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
00>
00> <info> app: No firmware to activate.
00>
00> <warning> app: Boot validation failed. App is invalid.
00>
00> <info> nrf_bootloader_wdt: WDT is not enabled
00>
00> <info> app: Entering DFU mode.
I saw many threads on it but could not find the link to what I am missing. Please help.
Thanks & Regards,
Snehal.