This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0G3519-Q1: proper clock stop procedure for 3519

Part Number: MSPM0G3519-Q1

Hello,

my most recent discovery of proper clockstop procedure for 3519 is the following:

                     DL_MCAN_txBufCancellationReq(MCAN0_INST, 0);
                    do {
                        cancellation_status = DL_MCAN_txBufCancellationStatus(MCAN0_INST);
                    }while((cancellation_status & 0x1) == 0);
                    DL_MCAN_setOpMode(MCAN0_INST, DL_MCAN_OPERATION_MODE_SW_INIT);
                    DL_MCAN_addClockStopRequest(MCAN0_INST, true);//CSR
                    while (DL_MCAN_OPERATION_MODE_SW_INIT != DL_MCAN_getOpMode(MCAN0_INST));//INIT must be set to '1' by h/w

                    DL_MCAN_enableClockStopGateRequest(MCAN0_INST);//STOPREQ
                    while (DL_MCAN_isClockStopGateRequestEnabled(MCAN0_INST) == false);//STOPREQ
                    do {
                    {
                       ackstatus = DL_MCAN_getClockStopAcknowledgeStatus(MCAN0_INST); //ACKSTS
                    }
                    }while (ackstatus == false);

                    DL_MCAN_disableModuleClock(MCAN0_INST);

this one mostly works but unfortunately not 100percent reliable, please advise.

  • Hi Mykhaylo,

    Refer to TRM, I think only one of MCAN_CCCR.CSR or MCANSS_CLKCTL.STOPREQ is needed to be set for Clock Stop function. 

    I think you could try to removing your code for MCANSS_CLKCTL.STOPREQ and INIT, and just try setting MCAN_CCCR.CSR (by DL_MCAN_addClockStopRequest) and then check MCAN_CCCR.CSA (by DL_MCAN_getClkStopAck) to wait for clock stop finished. 

  • hi Pengfei, thank you for the reply,

    I've tried - didn't help. what confuses me is your recommendation on removing INIT part meaning preserving the MCAN in "normal" mode of operation. isn't it weird? your colleague corroborate on this and recommends switching to INIT.
    what actually helped is to add forgotten MCAN reset at the beginning of MCAN initialization.