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.

TMS320F280039C-Q1: MCAN INIT DONE

Part Number: TMS320F280039C-Q1


Hello support,

I found in the examples that waiting MEM_INIT_DONE != 0 is one of the first operations in MCAN config sequence.

But I could not find in the TRM how the MsgRam initialization is started and how the MCAN soft reset (linked to MCANSS_STAT.RESET) is started.

thanks

  • Hi Davide,

    The examples follow the steps to configure the MCAN as outlined in Table 29-4 for the initialization and reset of the MCAN module.  Like with the DCAN, message RAMs are not initialized, instead these are configured for transmit/receive/filtering data length....etc.  The message RAM configuration is part of the MCANConfig() functions in the example using function MCAN_msgRAMConfig.  Can you clarify what you mean by message RAM initialization?   Soft reset for any C2000 peripheral, like MCAN is accomplished through SOFTPRESx registers.  This is used if user explicitly wants to reset a module, for instance if it stops responding.  At power up, all modules, including MCAN are initialized and there is no need to perform soft reset on the module (SOFTPRES10.MCAN) so the initialization routines, as outlined in table 29-4 would suffice.

    Regards,

    Joseph

  • Hello Joseph,

    "Can you clarify what you mean by message RAM initialization?"

    In the MCAN examples I see that the following code is executed before setting the peripheral in INIT mode

        //
        // Wait for memory initialization to happen.
        //
        while(FALSE == MCAN_isMemInitDone(MCANA_DRIVER_BASE))
        {
        }

    Looking at the drivers I see the description

    /**
     * \brief   This function checks if the memory initialization is done for
     *          MCAN module.
     *
     * \param   baseAddr        Base Address of the MCAN Registers.
     *
     * \retval  state           Returns TRUE if memory initialization is done.
     *                          Else returns FALSE.
     */
    uint32_t MCAN_isMemInitDone(uint32_t baseAddr);

    Therefore my question is:

    what kind of MCAN memory initialization is checked here ?

    When this initialization takes place and how is it triggered ?

    Is it something started by user ?

  • Hello Joseph,

    do you have any news ?

    Maybe my question can be summrized as:

    when the MCAN memory initialization takes place ? Only at wakeup/reset ?
    Is it an automatic procedure of the MCAN module, or can also be started by the user acting on some register ?

  • Hi Davide,

    Initializing MCAN module does not initialize message RAM.  Executing a soft reset by setting and clearing SOFTPRES10.MCAN does initialize the message RAM though.  I'm checking with our design team to see if this behavior is expected or if there are other ways for the MCAN message RAM to be initialized.

    Regards,

    Joseph

  • Hello Joseph,

    in your last reply you said

    "Executing a soft reset by setting and clearing SOFTPRES10.MCAN does initialize the message RAM though"

    New question is:

    in TRM, the field SOFTPRES10.MCANA is defined as "read only". How can happen that this bit is set and reset ?

    About my initial question, related to MEM_INIT_DONE, I can understand the recommendation to wait until MEM_INIT_DONE != 0 before configuring the MCAN module, but I still don't understand the mechanism that changes the value of MEM_INIT_DONE from 0 to 1.

    Is it an automatic procedure of the MCAN module ?

  • Hi Davide,

    Good catch on SOFTPRES10.MCANA bit.  It should be R/W.  The source files have been updated and this should be reflected in the next TRM publication.  I'm waiting for a response from our design team on what else initiates message RAM initialization sequence.  Please allow couple of days for a response.

    Thanks,

    Joseph

  • Hi Davide,

    At power on reset (POR) or a system reset (CPU.SYSRSN), automatic memory initialization will occur.  The polling for MEM_INIT_DONE is to ensure the the message ram has completed prior to initializing th MCAN module.

    Regards,

    Joseph