So,the SysTick is one of the wake up source。
If I don't use the FreeRTOS component, the use of some components will open the SysTick,but there is no closed interface. will this is optimized?
I use the demo project of the power_mode_switch_s32k144.
I modify the code,see below:
/* VLPS */
case '6':
//OSIF_TimeDelay(25);
print((const char*)"******** CPU is going in VLPS and need interrupt to wake up CPU\r\n");
/*Board EVB - red led on
Board MB - led 0 on */
PINS_DRV_WritePin(LED_PORT, LED_0, 0);
/*Board EVB - green led off
Board MB - led 1 off */
PINS_DRV_WritePin(LED_PORT, LED_1, 1);
/* Set power mode to VLPS */
//retV = POWER_SYS_SetMode(VLPS, POWER_MANAGER_POLICY_AGREEMENT);
EcuM_EnterLPM();
if (retV == STATUS_SUCCESS)
{
print((const char*)"CPU was entered VLPS mode successfully and then woke up to exit VLPS mode.\r\n");
if (POWER_SYS_GetCurrentMode() == POWER_MANAGER_RUN)
{
print((const char*)"Current mode is RUN.\r\n");
}
else
{
print((const char*)"Current mode is VLPR.\r\n");
}
}
else
{
print((const char*)"Switch VLPS mode unsuccessfully\r\n");
}
break;
/**
* \brief the ECU Enter Lower Power Mode.
*
* \param None
*
* \return None
*
* \note Before calling this function , the peripheral and power must be turned off.
*/
void EcuM_EnterLPM(void)
{
Mcu_DisableGlobalIRQ(); /* Step 1,disable global IRQ.*/
EcuM_ResetPortCfg(); /* Step 2,Reset the port configurations. */
EcuM_EnableWakeupSource(); /* Step 3,Enable wake up source. */
Mcu_EnterPLM(); /* Step 4,enter the PLM mode,Step5,wait for interrupt. excute POWER_SYS_SetMode(VLPS, POWER_MANAGER_POLICY_AGREEMENT); */
EcuM_RecordWakeupEvent(); /* Step 6,record wake up event. */
EcuM_DisableWakeupSource(); /* Step 7,disable wake up source,and clear interrupt flag.*/
Mcu_EnableGlobalIRQ(); /* Step 8,enable global IRQ.*/
}
When I mask the code OSIF_TimeDelay(25), the actual operation can enter the VLPS mode. When I open the code OSIF_TimeDelay(25), the actual operation will exit directly from the VLPS mode and cannot enter low power consumption. So,Is this normal operation?
So the SysTick is the one of wake up source? Can you optimize the interface of the SDK to close the SysTick?