Hello, everyone.
I'm jinwon.
I'm using the following environment.
S32K144,
Compiler : IAR 8.30.1
SDK : 3.0.0 RTM SDK.
FreeRTOS v10.0.1
I switched to VLPS mode with POWER_SYS_SetMode api and wake up to RUN mode with GPIO interrupt.
Interrupt is well work, but I can not return to run Tasks.
void vApplicationIdleHook( void )
{
// Check sleep condition
if( POWER_STATUS_SLEEP ) {
power_mode = POWER_SYS_GetCurrentMode();
if( power_mode != POWER_MANAGER_VLPS ) {
// Change FlexCAN mode to disable mode
FLEXCAN_DRV_Init(AMTEL_UDSCAN_INSTANCE, &canCom0_State, &canCom0_InitConfigDisable /*&canCom0_InitConfigFreeze*/ );
// Setting GPIO interrupt
INT_SYS_InstallHandler( PORTB_IRQn, &ISR_WakeUp_CAN_RX_PIN, (isr_t *)0 );
PINS_DRV_SetPinIntSel( PORTB, 4U, PORT_INT_FALLING_EDGE );
INT_SYS_EnableIRQ( PORTB_IRQn );
status = POWER_SYS_SetMode( CONF_POWER_MANAGER_VLPS, POWER_MANAGER_POLICY_FORCIBLE );
if( status == STATUS_SUCCESS ) {
}
}
}
// After entry VLPS mode, I can never reach here.
}
void ISR_WakeUp_CAN_RX_PIN(void)
{
uint32_t CanRX_pin = PINS_DRV_GetPortIntFlag(PORTB) & (1 << 4U);
if(CanRX_pin != 0)
{
PINS_DRV_ClearPinIntFlagCmd(PORTB, 4U);
// I checked that this code reached here.
status = POWER_SYS_SetMode( CONF_POWER_MANAGER_RUN, POWER_MANAGER_POLICY_FORCIBLE );
if( status == STATUS_SUCCESS ) {
// It's not reach here.
// Return value is STATUS_TIMEOUT
}
INT_SYS_DisableIRQ(PORTB_IRQn);
FLEXCAN_DRV_Init(AMTEL_UDSCAN_INSTANCE, &canCom0_State, &canCom0_InitConfigNormal);
// After here, I can't run main task.
}
}
How I can work more? Could you help me, please ?
Thank you, Daniel.
Yes, in your opinion, my colleague has created a ticket on NXP support and is in the process of making a case.
If the issue is resolved, I will add comment .
Hello Jinwon,
Could you please share the whole project or a test code at least so that we could test it.
If you don't want to share it here, you can create a ticket.
How to submit a new question for NXP Support
Thanks,
Daniel