Hello Daniel,
Thanks for the answers. I am working on a similar problem.
Is it at all possible to NOT reset and go to line 1 of main after exit from FAST STANDBY?
In the example, I see this function in Wkup.c:
/**
* @brief This function to show MCU what need to do after fast wake up.
* @details First, you can modify FIRC clock(FIRC default is 24MHz).
* However, you can add your code at here. MCU need to jump to Reset_Handler to initialize the MCU.
* @Param[in] None
*
* @return void
**/
static void Wkup_FastWkupBootAddress(void)
{
/*FIRC is 24M after wakeup. Change FIRC to 48M by bare metal code.*/
if(((IP_CONFIGURATION_GPR->CONFIG_REG_GPR & CONFIGURATION_GPR_CONFIG_REG_GPR_APP_CORE_ACC_MASK) >> CONFIGURATION_GPR_CONFIG_REG_GPR_APP_CORE_ACC_SHIFT) == 5u)
{
/* FIRC Divider to 1 */
IP_CONFIGURATION_GPR->CONFIG_REG_GPR = CONFIGURATION_GPR_CONFIG_REG_GPR_APP_CORE_ACC(5) | CONFIGURATION_GPR_CONFIG_REG_GPR_FIRC_DIV_SEL(3);
}
/* Customer can add their self code at here
Write your code here */
/*Jump to Reset_Handler to initialize the MCU.*/
// __asm("bl Reset_Handler");
// Initialize clocks
Clock_Ip_StatusType clockStatus;
/* This function initializes the PLL and MCU specific clock options.*/
clockStatus = Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);
while (clockStatus != CLOCK_IP_SUCCESS)
{
clockStatus = Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);
}
/* Init MCU MC_RGM part of the registers, Init Power Management Controller and Disable the padkeeping */
Power_Ip_Init(&Power_Ip_HwIPsConfigPB);
// Re-initialize peripherals
/* Clear RDSS to prevent automatic wake up after setting RDSS during standby */
Power_Ip_GetResetReason();
/* Set power to run mode which include enable last mile regulator and other PMC configuration */
Power_Ip_SetMode(&Power_Ip_aModeConfigPB[0]);
/* Pins configuration. */
Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);
// Go back to routine
}
Is it all possible to remove __asm("bl Reset_Handler"); and then manually init the clocks and peripherals after that. Then the MCU picks up from where it left off before going to FAST STANDBY
I only ask this because of the flowchart you mentioned in your answer.
Please let me know.
Thanks in advance,
KD