Skip to content

Commit 91a77e0

Browse files
committed
Save magic and SD info at the beginning of last sector in flash + reboot
1 parent e84d346 commit 91a77e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libraries/Nano33_System/examples/Nano33_updateBootloader/Nano33_updateBootloader.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define MBR_ADDR (0x0)
77
#define SOFTDEVICE_ADDR (0xA0000)
88
#define BOOTLOADER_ADDR (0xE0000)
9-
#define SOFTDEVICE_INFO_ADDR (0xFFFF0)
9+
#define SOFTDEVICE_INFO_ADDR (0xFF000)
1010

1111
const unsigned int magic = 0x5f27a93d;
1212

@@ -27,7 +27,7 @@ void setup() {
2727
flash.init();
2828
Serial.println("Flasing MBR...");
2929
applyUpdate(MBR_ADDR);
30-
Serial.println("Storing SoftDevice length info at 0xF0000...");
30+
Serial.println("Storing SoftDevice length info at 0xFF000...");
3131
writeSoftDeviceLen(SOFTDEVICE_INFO_ADDR);
3232
Serial.println("Flasing SoftDevice...");
3333
applyUpdate(SOFTDEVICE_ADDR);
@@ -36,6 +36,7 @@ void setup() {
3636
flash.deinit();
3737
Serial.println("Bootloader update complete. You may now disconnect the board.");
3838
confirmation = true;
39+
NVIC_SystemReset();
3940
break;
4041
case 'n':
4142
case 'N':

0 commit comments

Comments
 (0)