SLAAET4 April 2025 MSPM0G3506 , MSPM0G3507 , MSPM0G3518 , MSPM0G3519
Users need to put the MCU in low power mode to meet the application requirements. However, the MCAN module is disabled in low power mode. As a workaround, users can configure the MCAN RX pin as an input pin before entering low power mode. Enable a edge fail interrupt on that pin. When there is one message received on the MCAN RX pin, the MCU is woken up by the edge fail interrupt. Then, reconfigure the MCAN RX pin as an MCAN function and reconfigure the MCAN module. The MCAN restores normal functions this way.
An example code is shown below.
void MCAN_LowPowerMode(void)
{
DL_GPIO_initDigitalInputFeatures(GPIO_MCAN0_IOMUX_CAN_RX,
DL_GPIO_INVERSION_DISABLE, DL_GPIO_RESISTOR_PULL_UP,
DL_GPIO_HYSTERESIS_DISABLE, DL_GPIO_WAKEUP_DISABLE);
DL_GPIO_setLowerPinsPolarity(GPIO_MCAN0_CAN_RX_PORT, DL_GPIO_PIN_13_EDGE_FALL);
DL_GPIO_clearInterruptStatus(GPIO_MCAN0_CAN_RX_PORT, GPIO_MCAN0_CAN_RX_PIN);
DL_GPIO_enableInterrupt(GPIO_MCAN0_CAN_RX_PORT, GPIO_MCAN0_CAN_RX_PIN);
DL_SYSCTL_setPowerPolicySTANDBY0();
__WFI();
DL_SYSCTL_setPowerPolicyRUN0SLEEP0();
DL_GPIO_initPeripheralInputFunction(
GPIO_MCAN0_IOMUX_CAN_RX, GPIO_MCAN0_IOMUX_CAN_RX_FUNC);
MCAN0_Restart();
}
/*MCAN restart function*/
void MCAN0_Restart(void)
{
DL_MCAN_reset(CANFD0);
delay_cycles(16);
DL_MCAN_disablePower(CANFD0);
delay_cycles(32);
DL_MCAN_enablePower(CANFD0);
// MCAN RAM need at least 50us to finish init
// 1600 CPU cycles@CPU32MHz
// 4000 CPU cycles@CPU80MHz
delay_cycles(4000);
SYSCFG_DL_MCAN0_init();
}