HI,
can_sleep function successfully put CAN module to sleep (clock stop mode). The can_wakeup function will wakeup the CAN module successfully. See the content of the two functions later. The MCANSS_CTRL.AUTOWAKEUP bit and MCANSS_CTRL.WAKEUPREQEN bit have been configured to enable. But the module cannot wake up automatically when the CAN_RX pin is pulled down. The CCCR.INIT bit and CCCR.CSA bit are always 1, even if the CAN_RX pin has been pulled down more than 1 microsecond multiple times.
void can_sleep(void)
{
DL_MCAN_addClockStopRequest(CANFD0, true);
while (DL_MCAN_OPERATION_MODE_SW_INIT != DL_MCAN_getOpMode(CANFD0));
}
void can_wakeup(void)
{
if(DL_MCAN_getClkStopAck(CANFD0))
{
DL_MCAN_enableModuleClock(CANFD0);
DL_MCAN_addClockStopRequest(CANFD0, false);
DL_MCAN_setOpMode(CANFD0, DL_MCAN_OPERATION_MODE_NORMAL);
while (DL_MCAN_OPERATION_MODE_NORMAL != DL_MCAN_getOpMode(CANFD0));
}
}
Best regards,
Jason