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.

TDA4VM: MCAN Demo trigger interrupt unexpectedly in vision_app environment

Part Number: TDA4VM


we run the mcan example demo in pdk package in SBL way and it runs well in mcu1_0.

but after we move the demo into vision_app directory and try to run in SPL way,interrupt is triggered unexpectedly in mcu1_0.

when Tx finish sending data , the interrupt is  still triggered continuously in mcu1_0 and the value of MCAN_IR can't be cleared .

following is the issue log:

      

soc_2023-02-10_20-29-40.log             

  • Hi,

    Can you please share some information on how you have integrated this demo in the vision apps? Are you enabling mcu1_0 in vision apps and running openvx framework on mcu1_0? 

    I see you are accessing 0xe331001a location for irqstatus, is it correct location? or is it the irq status? Also are you following same way for clearing the interrupt? 

    Regards,

    Brijesh

  • Thank you for reply my question. 

    we put the example "

    ti-processor-sdk-rtos-j721e-evm-08_04_00_06/pdk_jacinto_08_04_00_21/packages/ti/csl/example/mcan/mcanEvmLoopback/mcan_evm_loopback_app_main_k3" into "

    ti-processor-sdk-rtos-j721e-evm-08_04_00_06/vision_apps/platform/j721e/rtos/mcu1_0",and change the boot way from SBL to SPL. We have enabled mcu1_0 in vision apps and not run openvx framwork on mcu1_0 only add the module "mcan_evm_loopback_app_main_k3".

         I don"t know why produce the irqstatus 0xe331001a, only read the irq status in the location produce  0x8000000. and I have  cleared  the interrupt but  the interrupt cannot be cleared .

         Interrupt handling is attached below,

    static void App_mcanIntr0ISR(uintptr_t arg)
    {
    uint32_t intrStatus;
    CAN_MSG_FIELD_T *msg_info;
    uint32_t intrStatus_test;
    MCAN_ProtocolStatus protStatus;

    MCAN_getProtocolStatus(gMcanModAddr, &protStatus);
    App_ConsolePrintf("CAN:App_mcanIntr0ISR from gMcanModAddr, lastErrCode = 0x%x, dlec = 0x%x \n",protStatus.lastErrCode,protStatus.dlec);


    intrStatus = MCAN_getIntrStatus(gMcanModAddr);
    App_ConsolePrintf("CAN:App_mcanIntr0ISR from gMcanModAddr,intrStatus = 0x%x. \n",intrStatus);
    MCAN_clearIntrStatus(gMcanModAddr_lpbk, intrStatus);
    intrStatus_test = MCAN_getIntrStatus(gMcanModAddr);
    App_ConsolePrintf("CAN:App_mcanIntr0ISR from gMcanModAddr,intrStatus_test= 0x%x. \n",intrStatus_test);

    if (MCAN_INTR_SRC_TRANS_COMPLETE ==
    (intrStatus & MCAN_INTR_SRC_TRANS_COMPLETE))
    {
    gMcanIsrIntr0Flag = 0U;
    }

    if (MCAN_INTR_SRC_DEDICATED_RX_BUFF_MSG ==
    (intrStatus & MCAN_INTR_SRC_DEDICATED_RX_BUFF_MSG))
    {
    gMcanIsrIntr1Flag = 0U;
    }

    intrStatus = MCAN_getIntrStatus(gMcanModAddr_lpbk);
    App_ConsolePrintf("CAN:App_mcanIntr0ISR from gMcanModAddr_lpbk,intrStatus = 0x%x. \n",intrStatus);
    MCAN_clearIntrStatus(gMcanModAddr_lpbk, intrStatus);
    intrStatus_test = MCAN_getIntrStatus(gMcanModAddr_lpbk);
    App_ConsolePrintf("CAN:App_mcanIntr0ISR from gMcanModAddr_lpbk,intrStatus_test = 0x%x. \n",intrStatus_test);

    if (MCAN_INTR_SRC_TRANS_COMPLETE ==
    (intrStatus & MCAN_INTR_SRC_TRANS_COMPLETE))
    {
    gMcanIsrIntr0Flag_lpbk = 0U;
    }

    if (MCAN_INTR_SRC_DEDICATED_RX_BUFF_MSG ==
    (intrStatus & MCAN_INTR_SRC_DEDICATED_RX_BUFF_MSG))
    {
    gMcanIsrIntr1Flag_lpbk = 0U;
    }
    }

  • Hi Renf shi,

    what does "yqq :app ...." in the log represents ? I don't see that part in the mentioned code. Could you share more details of it ?

    MCAN_getProtocolStatus(gMcanModAddr, &protStatus);
    App_ConsolePrintf("CAN:App_mcanIntr0ISR from gMcanModAddr, lastErrCode = 0x%x, dlec = 0x%x \n",protStatus.lastErrCode,protStatus.dlec);


    intrStatus = MCAN_getIntrStatus(gMcanModAddr);
    App_ConsolePrintf("CAN:App_mcanIntr0ISR from gMcanModAddr,intrStatus = 0x%x. \n",intrStatus);
    MCAN_clearIntrStatus(gMcanModAddr_lpbk, intrStatus);
    intrStatus_test = MCAN_getIntrStatus(gMcanModAddr);
    App_ConsolePrintf("CAN:App_mcanIntr0ISR from gMcanModAddr,intrStatus_test= 0x%x. \n",intrStatus_test);

    if ISR  is called, all the prints has to come but i see only one print and later were skipped which shouldn't happen.

    Using JTAG debugger, Kindly keep a break point and step through App_mcanIntr0ISR , it would be preferable using memory browser if you write the

    intrstatus into MCAN_IR address and check whether this clears or not.

    Regards

    Tarun Mukesh

  • I‘m sorry that the log "yqq:App" is replaced  by"CAN:App".

     Now,i catched the log again, following is the issue log and source code.

    5_2023-02-21_20-12-20.logcanManage_byd.c

  • using

     I have used JTAG debugger , cannot clear the MCAN_IR ,the value go to its original state soon

  • Hello,

    Observations from the log:

    LEC = 0x2 , which indicates form error and details of this can be found in this FAQ

     https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/08_02_00_05/exports/docs/pdk_jacinto_08_02_00_21/docs/userguide/jacinto/faq/faq_can.html

    due to this in ISR , intrStatus = 0x8000000  . 27th bit is set and MCAN_INTR_SRC_DEDICATED_RX_BUFF_MSG is the 19th bit required to make gMcanIsrIntr1Flag = 0. but never getting satisfied .

    As gMcanIsrIntr1Flag is not going to zero 

    while (gMcanIsrIntr1Flag)
    {}
     
    in the APP_mcanRxTest() keeps on going.
    But why does MCU_MCAN1 IR register showing the values is still not clear here ?
    Regards
    Tarun Mukesh
  • Hi,

    I know what you said ,my question is the same config have error in  "ti-processor-sdk-rtos-j721e-evm-08_04_00_06/vision_apps/platform/j721e/rtos/mcu1_0" but normal in "ti-processor-sdk-rtos-j721e-evm-08_04_00_06/pdk_jacinto_08_04_00_21/packages/ti/csl/example/mcan/mcanEvmLoopback/mcan_evm_loopback_app_main_k3",  and i stopped  send canfd data use another node, the interrupt is  still triggered continuously in mcu1_0 and connot stopped.

  • Hi,

     

    Can you please share the changes you did as a patch in vision apps? 

    ti-processor-sdk-rtos-j721e-evm-08_04_00_06/pdk_jacinto_08_04_00_21/packages/ti/csl/example/mcan/mcanEvmLoopback/mcan_evm_loopback_app_main_k3" into "

    ti-processor-sdk-rtos-j721e-evm-08_04_00_06/vision_apps/platform/j721e/rtos/mcu1_0",and change the boot way from SBL to SPL. We have enabled mcu1_0 in vision apps and not run openvx framwork on mcu1_0 only add the module "mcan_evm_loopback_app_main_k3".

    To comprehend the flow of API's from main.c in vision apps to API's in mcan_evm_loopback_app_main.c

    and also confirm the below points

    1) Is  PDK CAN example and vision Apps CAN example running on same environment  ? 

       

        Receiver's test (Option 2)  was opted as seen in the log for vision apps. The external CAN emulator(Other node) configuration is same or not for PDK

        and   vision apps ?

    2) Are you running  any other features on other cores ? i.e, Is there any core configuring the CAN module too ?

    3) After moving PDK CAN to Vision apps , is the entire SDK compiled or only vision apps ? if only vision apps could you please do entire SDK clean build

    & let me know .

    Regards

    Tarun Mukesh