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.

RTOS/TDA2P-ACD: QSPI Boot Issue on Custom Board

Part Number: TDA2P-ACD

Tool/software: TI-RTOS

Hello,

I am working with TDA2Px based custom board and PSDK3.5

I am facing issues in booting my application (usecase) in QSPI boot mode. The application works fine in SD boot mode but when I flashed the MLO and AppImage_BE in QSPI flash, the booting halts just before the usecase menu appears on the console. I tried to find out the issue and found that one of the links used in my usecase is causing this QSPI boot issue.

I have created a CANLink which uses mcan driver API's available in Vision SDK "ti_components\drivers\pdk_01_10_01_06\packages\ti\csl\src\ip\mcan\V0\priv\mcan.c". The calls to following low level functions are causing the QSPI boot issue,

#if 0
    /* Enable Auto wakeup */
    fdoe = MCAN_isFDOpEnable(MCAN_MODULE);
    if ((UInt32)TRUE != fdoe)
    {
        configStatus = STW_EFAIL;
    }

    /* wait for memory initialization to happen */
    while (FALSE == MCAN_isMemInitDone(MCAN_MODULE))
    {}

    /* Put MCAN in SW initialization mode */
    MCAN_setOpMode(MCAN_MODULE, MCAN_OPERATION_MODE_SW_INIT);
    while (MCAN_OPERATION_MODE_SW_INIT != MCAN_getOpMode(MCAN_MODULE))
    {}

    /* Initialize MCAN module */
    MCAN_init(MCAN_MODULE, mcan_initParams);
    /* Configure MCAN module */
    MCAN_config(MCAN_MODULE, &configParams);

    /* Configure Bit timings */
    MCAN_setBitTime(MCAN_MODULE, &bitTimes);

    /* Set Extended ID Mask */
    MCAN_setExtIDAndMask(MCAN_MODULE, MCAN_EXT_ID_AND_MASK);

    /* Configure Message RAM Sections */
    MCAN_msgRAMConfig(MCAN_MODULE, mcan_msgRAMConfigParams);

    /* Configure Standard ID filter element */
    MCAN_addStdMsgIDFilter(MCAN_MODULE, 0U, mcan_stdFiltelem);

    /* Configure Extended ID filter element */
    MCAN_addExtMsgIDFilter(MCAN_MODULE, 0U, mcan_extIdFiltelem);

    /* Take MCAN out of the SW initialization mode */
    MCAN_setOpMode(MCAN_MODULE, MCAN_OPERATION_MODE_NORMAL);

    while (MCAN_OPERATION_MODE_NORMAL != MCAN_getOpMode(MCAN_MODULE))
    {}
#endif

If I comment the calls to these functions, the QSPI boot works and my usecase also executes but the CAN module does not work.

I am not able to get find out the exact cause of this issue. Can anyone please point out what could be the issue in QSPI boot when MCAN driver API's are called.

Regards,

Abhay

  • Hi Abhay,

    There are multiple while loops in above code. Can you comment them one by one and narrow done the one where CPU is stuck.

    Regards,
    Rishabh
  • Hi Rishabh,

    Thanks for quick reply.
    Actually If I enable only the first function call "MCAN_isFDOpEnable()" and keep all others below it commented, the QSPI boot stops.
    I also tried by commenting "MCAN_isFDOpEnable()" call and then enabling the call to function "MCAN_isMemInitDone()", still QSPI boot stopped.
    QSPI boot works only when I comment all the MCAN function calls as below,

    #if 0
    /* Enable Auto wakeup */
    fdoe = MCAN_isFDOpEnable(MCAN_MODULE);
    if ((UInt32)TRUE != fdoe)
    {
    configStatus = STW_EFAIL;
    }

    /* wait for memory initialization to happen */
    while (FALSE == MCAN_isMemInitDone(MCAN_MODULE))
    {}

    /* Put MCAN in SW initialization mode */
    MCAN_setOpMode(MCAN_MODULE, MCAN_OPERATION_MODE_SW_INIT);
    while (MCAN_OPERATION_MODE_SW_INIT != MCAN_getOpMode(MCAN_MODULE))
    {}

    /* Initialize MCAN module */
    MCAN_init(MCAN_MODULE, mcan_initParams);
    /* Configure MCAN module */
    MCAN_config(MCAN_MODULE, &configParams);

    /* Configure Bit timings */
    MCAN_setBitTime(MCAN_MODULE, &bitTimes);

    /* Set Extended ID Mask */
    MCAN_setExtIDAndMask(MCAN_MODULE, MCAN_EXT_ID_AND_MASK);

    /* Configure Message RAM Sections */
    MCAN_msgRAMConfig(MCAN_MODULE, mcan_msgRAMConfigParams);

    /* Configure Standard ID filter element */
    MCAN_addStdMsgIDFilter(MCAN_MODULE, 0U, mcan_stdFiltelem);

    /* Configure Extended ID filter element */
    MCAN_addExtMsgIDFilter(MCAN_MODULE, 0U, mcan_extIdFiltelem);

    /* Take MCAN out of the SW initialization mode */
    MCAN_setOpMode(MCAN_MODULE, MCAN_OPERATION_MODE_NORMAL);

    while (MCAN_OPERATION_MODE_NORMAL != MCAN_getOpMode(MCAN_MODULE))
    {}
    #endif

    Regards,
    Abhay
  • Hi Rishabh,

    Do you have any suggestions for me.

    Thanks,
    Abhay
  • Hi Rishabh,

    Actually even the SD boot is not working with the calls to MCAN driver API's. By mistake in my previous posts I had written that SD boot works but that is not the case.
    Booting works only if I load MLO using JTAG and Appimage using SD card.

    Regards,
    Abhay
  • Hi Abhay,

    I will sync with MCAN expert and get back to you.

    Regards,
    Rishabh
  • Hi Abhay,

    Can you comment out the MCAN calls and let boot pass/happen? Once boot is successful, try to access the MCAN registers and see if there are accessible. If not then you need to enable MCAN module.
    Also, can you please list down all scenarios that you have tried along with details?

    Thanks & Regards,
    Vivek Dhande.
    Texas Instruments (India) Pvt Ltd
  • Hi,

    The register to check is CM_WKUPAON_ADC_CLKCTRL i.e. 0x4AE0_78A0.

    Regards,
    Rishabh
  • Hi Vivek, Rishabh,

    I commented all the MCAN API's and tried to read CM_WKUPAON_ADC_CLKCTRL register in runtime.
    I am getting the value of 0x4AE0_78A0 = 0x30000, i.e., IDLEST = 0x3 (Module is disabled and cannot be accessed).

    And when I try to enable it in runtime, the usecase is stopped. Please suggest what can be the issue.

    Thanks,
    Abhay
  • Hi Abhay,

    What is the value you are writing to enable it? Ideally you should use PM module enable API.
    Also are you doing the pin mux for MCAN?
    Can you check the MCAN example and see what you are missing.
    PROCESSOR_SDK_VISION_03_06_00_00\ti_components\drivers\pdk_01_10_02_07\packages\ti\csl\example\mcan\mcanEvmLoopback

    Regards,
    Rishabh
  • Hi Rishabh,

    I am enabling MCAN in runtime by calling functions for pinmux followed by MCAN driver API's as below,

    /* Enable MCAN module */
    HW_WR_FIELD32(SOC_L4PER_CM_CORE_BASE+CM_L4PER2_DCAN2_CLKCTRL,
    CM_L4PER2_DCAN2_CLKCTRL_MODULEMODE,
    CM_L4PER2_DCAN2_CLKCTRL_MODULEMODE_ENABLE);
    while (CM_L4PER2_DCAN2_CLKCTRL_IDLEST_FUNC !=
    HW_RD_FIELD32(SOC_L4PER_CM_CORE_BASE+CM_L4PER2_DCAN2_CLKCTRL,
    CM_L4PER2_DCAN2_CLKCTRL_IDLEST))
    {
    /* Wait till MCAN module is enabled */
    }

    /* Enable Auto wakeup */
    fdoe = MCAN_isFDOpEnable(MCAN_MODULE);
    if ((UInt32)TRUE != fdoe)
    {
    configStatus = STW_EFAIL;
    }

    /* wait for memory initialization to happen */
    while (FALSE == MCAN_isMemInitDone(MCAN_MODULE))
    {}

    /* Put MCAN in SW initialization mode */
    MCAN_setOpMode(MCAN_MODULE, MCAN_OPERATION_MODE_SW_INIT);
    while (MCAN_OPERATION_MODE_SW_INIT != MCAN_getOpMode(MCAN_MODULE))
    {}

    /* Initialize MCAN module */
    MCAN_init(MCAN_MODULE, mcan_initParams);
    /* Configure MCAN module */
    MCAN_config(MCAN_MODULE, &configParams);

    /* Configure Bit timings */
    MCAN_setBitTime(MCAN_MODULE, &bitTimes);

    /* Set Extended ID Mask */
    MCAN_setExtIDAndMask(MCAN_MODULE, MCAN_EXT_ID_AND_MASK);

    /* Configure Message RAM Sections */
    MCAN_msgRAMConfig(MCAN_MODULE, mcan_msgRAMConfigParams);

    /* Configure Standard ID filter element */
    MCAN_addStdMsgIDFilter(MCAN_MODULE, 0U, mcan_stdFiltelem);

    /* Configure Extended ID filter element */
    MCAN_addExtMsgIDFilter(MCAN_MODULE, 0U, mcan_extIdFiltelem);

    /* Take MCAN out of the SW initialization mode */
    MCAN_setOpMode(MCAN_MODULE, MCAN_OPERATION_MODE_NORMAL);

    while (MCAN_OPERATION_MODE_NORMAL != MCAN_getOpMode(MCAN_MODULE))
    {}

    I want to again repeat one thing here, MCAN works when I load MLO (sbl_sd_opp_nom_a15_0_release.xa15fg) using JTAG and AppImage using SD card. But the same thing does not work when both MLO and Appimage are kept in SD card.

    Regards,
    Abhay
  • Hi Abhay,

    If you see the example I have referred to you need to use the ADC register for MCAN. TDA3xx has one DCAN and one MCAN & uses DCAN2 for MCAN. TDA2Px has two DCANs and one MCAN & uses ADC register for MCAN.
    You need to update the same. You also need to set the dividers as done in example.

    Gels might be enabling MCAN properly and that's why MLO could be working with CCS. You can try to read ADC_CLKCTRL register to confirm the same.

    Regards,
    Rishabh
  • Hi Rishabh,

    As per your suggestion, I added code to enable ADC_CLKCTRL as shown below,

    /* Enable MCAN clock. */
    HW_WR_FIELD32(SOC_WKUPAON_CM_BASE + CM_WKUPAON_ADC_CLKCTRL,
    CM_WKUPAON_ADC_CLKCTRL_MODULEMODE,
    CM_WKUPAON_ADC_CLKCTRL_MODULEMODE_ENABLE);
    while (CM_WKUPAON_ADC_CLKCTRL_IDLEST_FUNC !=
    HW_RD_FIELD32(SOC_WKUPAON_CM_BASE + CM_WKUPAON_ADC_CLKCTRL,
    CM_WKUPAON_ADC_CLKCTRL_IDLEST))
    {
    /* wait for module to be enabled */
    }

    With above changes MCAN module is working is SD boot as well as QSPI boot modes.
    Thank you very much for your support.

    Regards,
    Abhay