Skip to content

Commit 3b70215

Browse files
Writing FWID to UICR in SystemInit
1 parent ec220d9 commit 3b70215

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ void SystemCoreClockUpdate(void)
4444

4545
void SystemInit(void)
4646
{
47+
NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos);
48+
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
49+
}
50+
//write FWID (NRF_UICR->FWID is readonly)
51+
*(uint32_t *)0x10001010 = 0xFFFF0049;
52+
53+
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
54+
}
55+
56+
NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos);
57+
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
58+
}
4759
// Prepare the peripherals for use as indicated by the PAN 26 "System: Manual setup is required
4860
// to enable the use of peripherals" found at Product Anomaly document for your device found at
4961
// https://www.nordicsemi.com/. The side effect of executing these instructions in the devices

0 commit comments

Comments
 (0)