I have a custom board of nRF52832-QFAB-B0 on which my application works well with SDK15.0.0 & SD132 v6.0.0
To perform DFU,
1. I copied the relevant parts of ble_app_buttonless_dfu example,
2. Increased the vendor specific uuid count to 2 in the sdk_config, now that I have two services - custom service & DFU service.
3. Included the required libraries and headers into my project as prompted by the error messages in SEGGER embedded studio and ran.
4. Got the following error in my log: "missing bootloader"
To program bootloader, I followed the steps in infocenter:
1. Cleared the flash
nrfjprog wipe
2. Programmed the softdevice SD132 v6.0.0
nrfjprog program -d nrf52 -c ../../SDK_15.0.0/components/softdevice/s132/hex/s132_nrf52_6.0.0_softdevice.hex
3. Modified the secure_bootloader with the following settings in memory segments & linker. Memory map changed since my IC variant is nRF52832 QFAB-B0 with 256kB Flash & 32kB RAM
Common Linker -> Section Placement macros:
FLASH_PH_START=0x0
FLASH_PH_SIZE=0x40000
RAM_PH_START=0x20000000
RAM_PH_SIZE=0x8000
FLASH_START=0x38000
FLASH_SIZE=0x6000
RAM_START=0x200057b8
RAM_SIZE=0x2848
Common Build->Memory segments:
FLASH RX 0x0 0x40000
RAM RWX 0x20000000 0x8000
uicr_mbr_params_page RX 0x10001018 0x4
mbr_params_page RX 0x0003E000 0x1000
bootloader_settings_page RX 0x0003F000 0x1000
uicr_bootloader_start_address RX 0x10001014 0x4
4. Generated the Bootloader settings hex file with the following command:
nrfutil settings generate --family NRF52QFAB --application pca10040/s132/ses/Output/Debug/Exe/ble_app_template_pca10040_s132.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 settings.hex
5. Merged bootloader and settings file using mergehex
mergehex -m bootloader.hex settings.hex -o bootloader_settings.hex
6. Now to program the bootloader I use nrfjprog
./nrfjprog --reset --program ../mergehex/glo_bootloader_settings.hex --family NRF52 --sectoranduicrerase
which throws an error:
Parsing hex file.
ERROR: The file specified is not a valid hex file, has data outside valid areas
ERROR: or does not have data in valid areas.