MSPM0G3107: MCAN peripheral does not complete initialization after power-on reset

Part Number: MSPM0G3107
Other Parts Discussed in Thread: SYSCONFIG

Hello,

I am trying to use the MCAN peripheral on MSPM0G3107, and have encountered an issue where the memory initialization procedure will not complete after a power-on reset (by applying power or via nRST).

When in this state, reads to all MCAN registers (i.e. via DL_MCAN_getRevisionId and others) will always return zeros via the CPU or via a debugger.

By using a debugger to reset the device (I believe this is a SYSRST?) the check seems to pass more reliably.

int main(void)
{
DL_GPIO_enablePower(GPIOA);
delay_cycles(POWER_STARTUP_DELAY);

DL_GPIO_initPeripheralInputFunction(GPIO_HFCLKIN_IOMUX, GPIO_HFCLKIN_IOMUX_FUNC);
DL_SYSCTL_setHFCLKSourceHFCLKIN();

DL_MCAN_reset(MCAN0_INST);
DL_MCAN_enablePower(MCAN0_INST)
delay_cycles(POWER_STARTUP_DELAY);

static const DL_MCAN_ClockConfig gMCAN0ClockConf = {
.clockSel = DL_MCAN_FCLK_HFCLK,
.divider = DL_MCAN_FCLK_DIV_1,
};

DL_MCAN_enableModuleClock(MCAN0_INST);
DL_MCAN_setClockConfig(MCAN0_INST, (DL_MCAN_ClockConfig *) &gMCAN0ClockConf);


while(false == DL_MCAN_isMemInitDone(MCAN0_INST));

    while (1) {
        delay_cycles(10000);
    }

}

I am able to reproduce this starting with a completely empty project (not using SysConfig).

 

By changing the "delay_cycles" call from  POWER_STARTUP_DELAY (16) to 1000000, this problem seems to go away, and initialization is reliable.

As such, projects using SysConfig are unlikely to encounter this issue due to initialization order - there are many more clock cycles between peripheral power enable and the first register reads and writes.

 

Is there published documentation surrounding the MCAN peripheral startup requiring extra clock cycles before enabling the clock request and accessing registers?

I do not see a section in the Technical Reference Manual which mentions this behaviour - Section "2.2.6 Peripheral Enable" includes a note stating to wait 4 ULPCLK cycles before accesing peripherals.

  • By changing the "delay_cycles" call from  POWER_STARTUP_DELAY (16) to 1000000, this problem seems to go away, and initialization is reliable.

    Hi,, mcan need more time to init after power on.

    Please refer to this code

    /**
     * MCAN restart need to call SYSCFG_DL_MCAN0_init()
     * For MCAN1 restart function, please add manually
     * 
     * Excute time:
     * 6594 systick CPU@80MHz, CANCLK@40MHz = 82.5us 
     */
    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();
        // Please re-config the filter after can retarted
    }

    mcan_application_LP_MSPM0G3519_nortos_ticlang_20250819.zip

    Is there published documentation surrounding the MCAN peripheral startup requiring extra clock cycles before enabling the clock request and accessing registers?

    There will be in 2026 to introduce this usage. Not release yet, it on my plan.

    I do not see a section in the Technical Reference Manual which mentions this behaviour - Section "2.2.6 Peripheral Enable" includes a note stating to wait 4 ULPCLK cycles before accesing peripherals.

    But not related to this one, mcan is a PD1(MCLK) bus peripherals.

    ULPCLK is PD0.

  • Thank you for clarifying and confirming that this will be documented in the future.