File tree 1 file changed +4
-0
lines changed
libraries/Nano33_System/examples/Nano33_updateBootloader
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 2
2
#include " MBR.h"
3
3
#include " SoftDevice.h"
4
4
#include " bootloader.h"
5
+ #include " nrf_nvmc.h"
5
6
6
7
#define MBR_ADDR (0x0 )
7
8
#define SOFTDEVICE_ADDR (0xA0000 )
8
9
#define BOOTLOADER_ADDR (0xE0000 )
9
10
#define SOFTDEVICE_INFO_ADDR (0xFF000 )
11
+ #define UICR_BOOT_ADDR (0x10001014 )
10
12
11
13
const unsigned int magic = 0x5f27a93d ;
12
14
@@ -33,6 +35,8 @@ void setup() {
33
35
applyUpdate (SOFTDEVICE_ADDR);
34
36
Serial.println (" Flasing bootloader..." );
35
37
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);
36
40
flash.deinit ();
37
41
Serial.println (" Bootloader update complete. You may now disconnect the board." );
38
42
confirmation = true ;
You can’t perform that action at this time.
0 commit comments