Move SystemInit() to register unlock range for perhaps future protected register access

pull/4974/head
ccli8 2017-05-25 17:46:01 +08:00 committed by adbridge
parent 019c989e24
commit cc05269a57
2 changed files with 10 additions and 8 deletions

View File

@ -271,14 +271,15 @@ void Reset_Handler(void)
/* HXT Crystal Type Select: INV */
CLK->PWRCTL &= ~CLK_PWRCTL_HXTSELTYP_Msk;
/* Enable register write-protection function */
SYS_LockReg();
/**
* Because EBI (external SRAM) init is done in SystemInit(), SystemInit() must be called at the very start.
* NOTE 1: Unlock is required for perhaps some register access in SystemInit().
* NOTE 2: Because EBI (external SRAM) init is done in SystemInit(), SystemInit() must be called at the very start.
*/
SystemInit();
/* Enable register write-protection function */
SYS_LockReg();
#if defined(__CC_ARM)
__main();

View File

@ -431,14 +431,15 @@ void Reset_Handler(void)
/* Disable Power-on Reset function */
SYS_DISABLE_POR();
/* Enable register write-protection function */
SYS_LockReg();
/**
* Because EBI (external SRAM) init is done in SystemInit(), SystemInit() must be called at the very start.
* NOTE 1: Unlock is required for perhaps some register access in SystemInit().
* NOTE 2: Because EBI (external SRAM) init is done in SystemInit(), SystemInit() must be called at the very start.
*/
SystemInit();
/* Enable register write-protection function */
SYS_LockReg();
#if defined(__CC_ARM)
__main();