all dear:
PROJECT : 1、freeRTos 2、power manager 3、CAN
freeRTos+power manager into POWER_STATE_VLPS mode is ok,
but add init CAN ,into POWER_STATE_VLPS is fail,and MCU is restart,why?
can you help me?
thanks
grayli
Hello grayli.wang@cdskysoft.com,
Do you put the FlexCAN module into Freeze mode before VLPS?
Thanks,
BR, Daniel
hi,Daniel
i add function:
void CAN_Freeze_mode(uint8_t instance,bool enable)
{
CAN_Type * base = g_flexcanBase[instance];
DEV_ASSERT(instance < CAN_INSTANCE_COUNT);
if(enable)
FLEXCAN_EnterFreezeMode(base);
else
FLEXCAN_ExitFreezeMode(base);
}
1、
into VLPS mode ,before set CAN_Freeze_mode(INST_CANCOM1,1);
but mcu restart
2、
into VLPS mode ,before set FLEXCAN_DRV_Deinit(INST_CANCOM1);
is ok,but i need CAN_IRQ wake up MCU,
3、
i need add CAN_ID filter?
FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, RX_MAILBOX, &dataInfo, 0x0);
FLEXCAN_DRV_SetRxMbGlobalMask(instance,FLEXCAN_MSG_ID_STD,0x1);
but CAN receive all ID.
Not only should you receive (CAN_ID) 0x0 and 0x1??
why is all ID?
sorry ,so much issue,I just started learning NXP MCU.
can you help me,please
thanks
BRS
Grayli
The FlexCAN module is not a wake-up source in VLPS (7.3.1 Wake-up sources, RM rev.11).
But PORT interrupts are functional in all digital pin muxing modes including CAN_RX (12.6.1 Pin Control Register n (PORT_PCRn)) and can bring the MCU from VLPS.
BR, Daniel
hello,Daniel
deinit CAN and set CAN pin to muxing mode,before into VLPS
thanks
BRS
Grayli
The PORT interrupt (wake-up event) on the corresponding pin is functional in VLPS even if the FlexCAN module is initialized and the pin is routed to the CAN_RX function in PCR[MUX].
BR, Daniel
hello,Daniel
i test CAN set to port interrupt can wake on MCU form sleep mode ;
but again init CAN ,MCU restart.
can you help solve why MCU restart?
Hello grayli.wang@cdskysoft.com,
I assume that you are running the application stand-alone without any debugger connected.
So, I would place an infinite loop in the wake-up ISR (variable = 1; while(variable){}) and then attach a debugger without resetting the MCU and step the code, examine registers, check if clocks are enabled. Do you have HardFault ISR in your code implemented?
BR, Daniel
hi,Daniel
thanks,into Freeze mode,CAN_IRQ can wake up in VLPS?
BRS
grayli