1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #include <stdint.h>
- #include <stdbool.h>
- #include "nrf.h"
- #include "nrf_erratas.h"
- #include "system_nrf5340_network.h"
- #define __SYSTEM_CLOCK (64000000UL)
- #if defined ( __CC_ARM )
- uint32_t SystemCoreClock __attribute__((used)) = __SYSTEM_CLOCK;
- #elif defined ( __ICCARM__ )
- __root uint32_t SystemCoreClock = __SYSTEM_CLOCK;
- #elif defined ( __GNUC__ )
- uint32_t SystemCoreClock __attribute__((used)) = __SYSTEM_CLOCK;
- #endif
- void SystemCoreClockUpdate(void)
- {
- SystemCoreClock = __SYSTEM_CLOCK;
- }
- void SystemInit(void)
- {
-
- uint32_t index = 0;
- for (index = 0; index < 32ul && NRF_FICR_NS->TRIMCNF[index].ADDR != (uint32_t *)0xFFFFFFFFul; index++){
- #if defined ( __ICCARM__ )
-
- #pragma diag_suppress=Pa082
- #endif
- *NRF_FICR_NS->TRIMCNF[index].ADDR = NRF_FICR_NS->TRIMCNF[index].DATA;
- #if defined ( __ICCARM__ )
- #pragma diag_default=Pa082
- #endif
- }
-
- if (nrf53_errata_49())
- {
- if (NRF_RESET_NS->RESETREAS & RESET_RESETREAS_RESETPIN_Msk)
- {
- NRF_POWER_NS->EVENTS_SLEEPENTER = 0;
- NRF_POWER_NS->EVENTS_SLEEPEXIT = 0;
- }
- }
-
- if (nrf53_errata_55())
- {
- if (NRF_RESET_NS->RESETREAS & RESET_RESETREAS_RESETPIN_Msk){
- NRF_RESET_NS->RESETREAS = ~RESET_RESETREAS_RESETPIN_Msk;
- }
- }
- SystemCoreClockUpdate();
- }
|