Dear NXPs:
ARCH:S32K146
OS:freeRTOS
I want to call the SystemSoftwareReset interface immediately after calling the Secureboot Enable interface. Will there be any problem?
CODE:
/* enable secureboot SERIAL Mode */
(void)CSEC_DRV_BootDefine(BM_BOOT_SIZE, CSEC_BOOT_SERIAL);
/* Reset process. */
SystemSoftwareReset();
The reason for doing this is mainly to reduce one manual power operation on the production line, so that the startup process becomes: call Secureboot Enable interface → SystemSoftwareReset → Secureboot Enabled → Free RTOS Startup.
void SystemSoftwareReset(void)
{
uint32_t regValue;
/* Read Application Interrupt and Reset Control Register */
regValue = S32_SCB->AIRCR;
/* Clear register key */
regValue &= ~( S32_SCB_AIRCR_VECTKEY_MASK);
/* Configure System reset request bit and Register Key */
regValue |= S32_SCB_AIRCR_VECTKEY(FEATURE_SCB_VECTKEY);
regValue |= S32_SCB_AIRCR_SYSRESETREQ(0x1u);
/* Write computed register value */
S32_SCB->AIRCR = regValue;
}