There is some mistake in the following function.
void system_reset_cfg(void)
{
struct sysctrl_t *sysctrl = (struct sysctrl_t *)CMSDK_SYSCTRL_BASE_S; uint32_t reg_value = SCB->AIRCR;
/* Enable system reset request for CPU 0, to be triggered via
- NVIC_SystemReset function.
*/
sysctrl->resetmask |= ENABLE_CPU0_SYSTEM_RESET_REQUEST;
/* Enable system reset request only to the secure world */
reg_value |= (uint32_t)(SCB_AIRCR_WRITE_MASK | SCB_AIRCR_SYSRESETREQS_Msk);
SCB->AIRCR = reg_value;
}
reg_value |= (uint32_t)(SCB_AIRCR_WRITE_MASK | SCB_AIRCR_SYSRESETREQS_Msk);
In this line, the top 2 bytes of reg_value will be 0xffff, but not 0x05fa. So the write will be ignored.