Integration Manual
NINA-B4 series - System integration manual
UBX-19052230 - R09 Open CPU software Page 39 of 60
C1-Public
3.2.2.1 Building applications to be flashed using the bootloader
To flash an application to the module without destroying the master boot record (MBR) that is
preflashed in the factory, the start address in flash must be changed to 0x27000 (for applications with
S140 SoftDevice) or 0x1000 (applications without SoftDevice). This change can be done in the nRF5
SDK by changing the macro FLASH_START – in a similar way to how the BOARD_CUSTOM flag was set to
Create a custom board support file for Nordic SDK. The flag is set using the Property Editor in SEGER
Embedded Studio: Code > Linker > Section Placement Macros, as shown in Figure 16.
Figure 16 Setting the FLASH_START macro
☞ Reduce the FLASH_SIZE to make sure that the FLASH_START + FLASH_SIZE is less than boot loader
start address.
3.2.2.2 Preparing the Device Firmware Update (DFU) package
The package to be flashed is in a special DFU package format. The package is generated in the
following way:
An application that does not use a SoftDevice:
nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 0 --application
app.hex app.zip
An application with SoftDevice:
nrfutil pkg generate --hw-version 52 --sd-req 0xCA --sd-id 0xCA --softdevice
s140_nrf52_7.0.1_softdevice.hex --application-version 0 --application app.hex sd_app.zip
3.2.2.3 Flashing the DFU package
The generated DFU package can be flashed on the module using the following nrfutil command:
nrfutil dfu serial -pkg app.zip -p COM95 -b 115200 -fc 1
☞ As there is no application to boot, the loader automatically stops in DFU mode when flashing is
done for the first time. On subsequent reboots, you need to stop the bootloader in DFU mode by
driving SWITCH_2 low during startup.