System details:
- Board: Custom
- Chip: nRF52840
- PCA Number: PCA10056
- SoftDevice: S140
- SDK: Version 16.0.0
- mdk version: 8.46.0
- nrfjprog version: 10.15.4 external
- JLinkARM.dll version: 7.64d
I have two boards - one is a Nordic nRF52840 DK board (rev3), and the other is a custom board with the nRF52840 chip. I have been working with a the DK board to develop and test my custom project code. I have successfully programmed this DK board with the following script:
#! /bin/bash
## Compile bootloader and application:
boot_make='../nrf-sdk/examples/dfu/secure_bootloader/pca10056_s140_ble/armgcc/'
boot=${boot_make}_build/nrf52840_xxaa_s140.hex
softdevice='../nrf-sdk/components/softdevice/s140/hex/s140_nrf52_7.0.1_softdevice.hex'
app_make='../nrf-sdk/examples/ble_peripheral/ble_app_technolingus/pca10056/s140/armgcc/'
app=${app_make}_build/nrf52840_xxaa.hex
make -C "$boot_make"
make -C "$app_make"
nrfutil settings generate --family NRF52840 --application "$app" --application-version 1 --bootloader-version 1 --bl-settings-version 2 settings.hex
#nrfutil settings generate --family NRF52840 --application "$app" --application-version 1 --bootloader-version 1 --bl-settings-version 2 --softdevice "$softdevice" --key-file private.key settings.hex
nrfjprog --recover
nrfjprog -e
nrfjprog --program "$softdevice" --verify
nrfjprog --program "$boot" --verify
nrfjprog --program "$app" --verify
nrfjprog --program settings.hex --verify
nrfjprog --reset
Once programmed with this script, the DK runs as expected and all is good. So my natural next step is to start working with our custom circuit board with the nRF52840 chip, and this is where my issue comes up. When I try to run the previous script while hooked up to my custom nRF52840 board, I see that both the SoftDevice and the Application Image can be programmed without ERROR, but both the Bootloader and the Bootloader Settings fail to get flashed. Specifically, the 2 errors that I see are:
- When running "nrfjprog --program "$boot" --verify", it spits out the following error:
-
% nrfjprog --program ../nrf-sdk/examples/dfu/secure_bootloader/pca10056_s140_ble/armgcc/_build/nrf52840_xxaa_s140.hex --verify --log
Parsing image file
ERROR: [ Worker] - Address 0x000f8000 does not map to a known memory.
ERROR: The file specified is not a valid hex file, has data outside valid areas
ERROR: or does not have data in valid areas.
-
- When running "nrfjprog --program settings.hex --verify", it spits out the following error:
-
% nrfjprog --program settings.hex --verify --log
Parsing image file
ERROR: [ Worker] - Address 0x000fe000 does not map to a known memory.
ERROR: The file specified is not a valid hex file, has data outside valid areas
ERROR: or does not have data in valid areas.
-
For your reference, I have attached both of the "boot" .hex file and settings.hex to this post, as well as the ''nrfjprog --log" output from attempting to program each file.

From this documentation on Memory Layout, it seems like the error-address from the bootloader .hex (1) should be OK because 0x000f8000 is the start of the bootloader range of memory for nRF52840/s140. For the settings error (2), the address in question appears to be the start of MBR Parameter Storage, rather than Bootloader Settings, but I am not sure why. Any advice on how to resolve this? Many thanks in advance!