Skip to content

Commit 95b8edd

Browse files
committed
Enable the bootloader by writing its address to the UICR memory
1 parent 91a77e0 commit 95b8edd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/Nano33_System/examples/Nano33_updateBootloader/Nano33_updateBootloader.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
#include "MBR.h"
33
#include "SoftDevice.h"
44
#include "bootloader.h"
5+
#include "nrf_nvmc.h"
56

67
#define MBR_ADDR (0x0)
78
#define SOFTDEVICE_ADDR (0xA0000)
89
#define BOOTLOADER_ADDR (0xE0000)
910
#define SOFTDEVICE_INFO_ADDR (0xFF000)
11+
#define UICR_BOOT_ADDR (0x10001014)
1012

1113
const unsigned int magic = 0x5f27a93d;
1214

@@ -33,6 +35,8 @@ void setup() {
3335
applyUpdate(SOFTDEVICE_ADDR);
3436
Serial.println("Flasing bootloader...");
3537
applyUpdate(BOOTLOADER_ADDR);
38+
Serial.println("Write in UICR memory the address of the new bootloader...");
39+
nrf_nvmc_write_word(UICR_BOOT_ADDR, BOOTLOADER_ADDR);
3640
flash.deinit();
3741
Serial.println("Bootloader update complete. You may now disconnect the board.");
3842
confirmation = true;

0 commit comments

Comments
 (0)