#!/bin/sh

BOOTLOADER_VER=7

APPL_VER=100

nrfutil settings generate --family NRF52 --application pca10040/s132/armgcc/_build/*.hex --application-version $APPL_VER --bootloader-version ${BOOTLOADER_VER} --bl-settings-version 1 settings.hex

mergehex --merge Bootloader_v${BOOTLOADER_VER}.hex settings.hex --output comboboot.hex
mergehex --merge comboboot.hex s132_nrf52_6.1.1_softdevice.hex pca10040/s132/armgcc/_build/*.hex --output merged.hex

nrfjprog.exe  --program merged.hex -f nrf52 --chiperase
nrfjprog.exe  --reset --family NRF52
nrfjprog.exe --reset --family NRF52


