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.

AWR1642BOOST-ODS: CAN Visulizer displayed CAN messages for seconds, then stoped

Expert 2050 points
Part Number: AWR1642BOOST-ODS
Other Parts Discussed in Thread: AWR1642, AWR1642BOOST

I run lab0005 demo in AWR1642BOOST-ODs.

In debug mode, I can see the function Can_Transmit_Schedule is continuously called. 

Open CAN Visualizer and press [initialize] button, Message Reading window show the incoming CAN messages. The messages updating for few seconds, then Rcv Time and Data do not update any more. 

To my understanding, as the device continuously transmit CAN message, the messages catched by CAN Visualizer should update continuouly. 

Is it a issue? 

Thanks

  • Hello Ree,

    Does it call CANFD_transmitData function within Can_Transmit_Schedule function?

    I would suggest you verify the AWR1642ODS CAN interface with mmwave demo driver test application first to check if that board (with CAN connection) is fine for CAN communication.

    C:\ti\mmwave_sdk_03_05_00_01\packages\ti\drivers\can\test

    Regards,

    Jitendra

  • Hi Jitendra,

    Yes. It call CANFD_transmitData function within Can_Transmit_Schedule function

    In lab0005 demo mms_main.c, I modified the code for checking the issue. The code is given as below:

    int32_t Can_Transmit_Schedule( uint32_t msg_id,
                uint8_t *txmsg, uint32_t len)
    {
    
        volatile uint32_t                   index = 0;
        int32_t                     retVal = 0;
        int32_t                     errCode = 0;
    
        System_printf ("MEssage %x  len %d\n", msg_id, len);
        if(frameType == CANFD_MCANFrameType_FD)
        {
            Task_sleep(1);
    
            while(len > 64U)
            {
                System_printf ("frameType:FD; len > 64U\n");
                retVal = CANFD_transmitData (txMsgObjHandle, msg_id, CANFD_MCANFrameType_FD, 64U, &txmsg[index], &errCode);
                index = index + 64U;
                len = len - 64U;
                if(retVal < 0)
                {
                   System_printf("Debug: Error transmitting CAN_FD (len > 64U) data %x , Errcode %x\n", retVal, errCode);
                   /*if CANFD is in use, delay 5 seconds and send again*/
    if(errCode == CANFD_EINUSE){ System_printf("CAN FD is in Use\n"); Task_sleep(5); } retVal = CANFD_transmitData (txMsgObjHandle, msg_id, CANFD_MCANFrameType_FD, 64U, &txmsg[index], &errCode); } Task_sleep(1); } System_printf ("frameType:FD; len < 64U\n"); retVal = CANFD_transmitData (txMsgObjHandle, msg_id, CANFD_MCANFrameType_FD, len, &txmsg[index], &errCode); if(retVal < 0) { System_printf("Debug: Error transmitting CAN_FD data %x , Errcode %x\n", retVal, errCode); /*if CAN FD is in use, delay 5 seconds and send again */
    if(errCode == CANFD_EINUSE){ System_printf("CAN FD is in Use\n"); Task_sleep(5); } retVal = CANFD_transmitData (txMsgObjHandle, msg_id, CANFD_MCANFrameType_CLASSIC, len, &txmsg[index], &errCode); } }

    I run application in the debug mode. If select CANFD_MCANFrameType_CLASSIC or NOT connect to the CANFD adapter(IPEH-004022-018192), it works ok. But if connect to CAN FD adapter and select CANFD_MCANFrameType_FD, it works normally for few seconds, then starts continueously throw errors with error code fffff252. Plese see the error logs as below:

    frameType:FD; len > 64U
    frameType:FD; len > 64U
    frameType:FD; len < 64U
    MEssage b1  len 28
    frameType:FD; len < 64U
    MEssage c1  len 40
    frameType:FD; len < 64U
    MEssage d1  len 8
    frameType:FD; len < 64U
    MEssage d1  len 148
    frameType:FD; len > 64U
    frameType:FD; len > 64U
    Debug: Error transmitting CAN_FD (len > 64U) data ffffffff , Errcode fffff252
    CAN FD is in Use
    frameType:FD; len < 64U
    Debug: Error transmitting CAN_FD data ffffffff , Errcode fffff252
    CAN FD is in Use
    MEssage b1  len 28
    frameType:FD; len < 64U
    Debug: Error transmitting CAN_FD data ffffffff , Errcode fffff252
    CAN FD is in Use
    MEssage c1  len 40
    frameType:FD; len < 64U
    Debug: Error transmitting CAN_FD data ffffffff , Errcode fffff252
    CAN FD is in Use
    MEssage d1  len 8
    frameType:FD; len < 64U
    Debug: Error transmitting CAN_FD data ffffffff , Errcode fffff252
    CAN FD is in Use
    

    As you can see, the error is CANFD_EINUSE. In the above code, I added Task_sleep(5) to send the message later. But it doesn't help. 

    Is there any solutions for solving CANFD_EINUSE error? 

    For TI CAN Visualizer, the bit rate setting is:

    f_clock_mhz=40, nom_brp=5, nom_tseg1=5, nom_tseg2=2, nom_sjw=1, data_brp=1, data_tseg1=4, data_tseg2=3, data_sjw=1

    In mms_main.c, the CAN is initialized as below:

    #if 1
        mcanBitTimingParams.nomBrp      = 0x2U;
        mcanBitTimingParams.nomPropSeg  = 0x8U;
        mcanBitTimingParams.nomPseg1    = 0x6U;
        mcanBitTimingParams.nomPseg2    = 0x5U;
        mcanBitTimingParams.nomSjw      = 0x1U;
    #else
        /*500Kbps NomBitRate: (40)/(((6+5+4)+1)*5)*/
        mcanBitTimingParams.nomBrp      = 0x5U;
        mcanBitTimingParams.nomPropSeg  = 0x6U;
        mcanBitTimingParams.nomPseg1    = 0x5U;
        mcanBitTimingParams.nomPseg2    = 0x4U;
        mcanBitTimingParams.nomSjw      = 0x1U;
    #endif
    
    #if 1 //5 Mbps
        mcanBitTimingParams.dataBrp     = 0x1U;
        mcanBitTimingParams.dataPropSeg = 0x2U;
        mcanBitTimingParams.dataPseg1   = 0x2U;
        mcanBitTimingParams.dataPseg2   = 0x3U;
        mcanBitTimingParams.dataSjw     = 0x1U;
    #else //2 Mbps
        mcanBitTimingParams.dataBrp     = 0x4U;
        mcanBitTimingParams.dataPropSeg = 01U;
        mcanBitTimingParams.dataPseg1   = 0x2U;
        mcanBitTimingParams.dataPseg2   = 0x1U;
        mcanBitTimingParams.dataSjw     = 0x1U;
    
    #endif

    It looks like the Visualizer and AWR1642 Board have some different parameters and values. Does it cause the problem? 

    In addition, as I mentioned above, it happens when work with CAN FD adapter, I use IPEH-004022.

    Thanks

  • Thanks JG,

    Last two threads you recommended are not resolved too. As my description above, I added Task_sleep(5) that is recommended in the first thread, but it doesn't work.

    Regards

  • Hi,

    We need to check if we have a IPEH-004022 to reproduce the issue

    This should take a few days

    thank you

    cesar

  • Hi Cesar, have you reproduced the issue? 

    Kind regards

  • Hi,

    Not yet.

    I have some challenges to find a IPEH-004022.

    Let me get back to you early next week

    thank you

    Cesar

  • Hi Cesar,

    Thank you very much!

  • Hi,

    I have reviewed the history of several related threads. 

    Here is my understanding

    1) Using "mmwave_automotive_toolbox_3_2_0\labs\lab0005_object_data_over_can"

    2) Using AWR1642-BOOST EVM

    3) Using CAN USB adapter -

    4) Flashed pre-built binaries "lab0005_object_data_over_can\odoc-target\pre-built-Binaries\AWR1642BOOST\xwr16xx_odoc_ti_design_lab.bin"

    5) Configured the EVM to use CAN as described in the EVM UG.

    6) Open the CAN Visualizer

    This is how this lab has been tested at release time.

    Are you following these steps?

    thank you

    Cesar

  • Hi Cesar,

    Happy new year. 

    Yes. I did the test following these steps. But the TI CAN Visualizer doesn't display CAN messages as I expected.

    When open the CAN Visualizer and press the [Initialize] button, visualizer shows the CAN messages immediately, but then automatically stops reading CAN message very quickly. Captured screen is given as below. 

    Thanks

  • Hi Cesar, 

    Any update for this thread?

    Thanks

  • Hi,

    I was not able to reproduce the problem you see.

    Were you able to check with a scope that you see activity on the CAN lines after the Visualizer freezes?

    Could you try on a PC with Windows 7?

    Thank you

    Cesar