From 3b702158ae5f72e7458ff08ef686fe6c5c33b3ea Mon Sep 17 00:00:00 2001 From: tkuyucu Date: Wed, 19 Feb 2014 17:26:59 +0100 Subject: [PATCH] Writing FWID to UICR in SystemInit --- .../TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c index e0d222937e..900b1fda2b 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c +++ b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c @@ -44,6 +44,18 @@ void SystemCoreClockUpdate(void) void SystemInit(void) { + NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos); + while (NRF_NVMC->READY == NVMC_READY_READY_Busy){ + } + //write FWID (NRF_UICR->FWID is readonly) + *(uint32_t *)0x10001010 = 0xFFFF0049; + + while (NRF_NVMC->READY == NVMC_READY_READY_Busy){ + } + + NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos); + while (NRF_NVMC->READY == NVMC_READY_READY_Busy){ + } // Prepare the peripherals for use as indicated by the PAN 26 "System: Manual setup is required // to enable the use of peripherals" found at Product Anomaly document for your device found at // https://www.nordicsemi.com/. The side effect of executing these instructions in the devices