nrfjprog --recover

nrfjprog -e

nrfjprog --memrd 0x10001208

mergehex -m s140_nrf52_7.0.1_softdevice.hex secure_bootloader_ble_s140_pca10056_debug.hex -o merged_SD_bootloader.hex

nrfjprog --program merged_SD_bootloader.hex --verify

nrfjprog --memrd 0x10001208

nrfjprog --reset

nrfjprog --memrd 0x10001208

pause
# Here you can attach segger with secure_bootloader_ble_s140_pca10056_debug, no erasing if you want

nrfutil settings generate --family NRF52840 --application ble_app_buttonless_dfu_pca10056_s140.hex --application-version 3 --bootloader-version 2 --bl-settings-version 1 settings.hex

mergehex -m ble_app_buttonless_dfu_pca10056_s140.hex settings.hex -o app_setting.hex

nrfjprog --program app_setting.hex --sectorerase --verify

nrfjprog --memrd 0x10001208

nrfjprog --reset

pause

# Attach segger with ble_app_buttonless_dfu_pca10056_s140, no erasing