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.

IWR6843ISK: CAN-FD Transmit error

Part Number: IWR6843ISK
Other Parts Discussed in Thread: MMWAVEICBOOST,

Hi,

I'm use IWR6843ISK + MMWAVEICBOOST with SDK 3.5 and PCAN-USB FD.

 

I want to transmit periodically collected data(by I2C) simply using CAN-FD.

I used the CAN-FD Driver example source. (SOC Clock set, CAN-FD Initialize, etc)

When transmit periodically, It occur transmit error.

Below is error info and source code.

            retVal = CANFD_transmitData (txMsgObjHandle, msgId, CANFD_MCANFrameType_FD, MCAN_APP_TEST_DATA_SIZE, &txData[0], &errCode);
            Task_sleep(5U);
            iterationCount++;
            if (retVal < 0)
            {
                System_printf ("Error: CANFD transmit data for failed [Error code %d]\n", errCode);

                System_printf("Debug: Number of iterations              : %d\n", iterationCount);
                System_printf("Debug: Number of messages transmitted    : %d\n", gTxPkts);
                System_printf("Debug: Number of messages received       : %d\n", gRxPkts);
                System_printf("Debug: Error Status Interrupt            : %d\n", gErrStatusInt);
                System_printf("Debug: Error Reason                      : %d\n", gErrorReason);
                System_printf("\n\n");

                msgObjStats.handle = txMsgObjHandle;
                optionTLV.type = CANFD_Option_MCAN_MSG_OBJECT_STATS;
                optionTLV.length = sizeof(CANFD_MCANMsgObjectStats);
                optionTLV.value = (void*) &msgObjStats;

                retVal =  CANFD_getOptions(canHandle, &optionTLV, &errCode);
                if (retVal < 0)
                {
                    System_printf ("Error: CANFD get stats failed [Error code %d]\n", errCode);
                }

                System_printf("Debug: Message Identifier                : 0x%x\n", msgObjStats.startMsgIdentifier);
                System_printf("Debug: Direction                         : %s\n", (msgObjStats.direction == 0) ? "Receive" : "Transmit");
                System_printf("Debug: Number of interrupts received     : %d\n", msgObjStats.interruptsRxed);
                System_printf("Debug: Number of messages processed      : %d\n", msgObjStats.messageProcessed);
                System_printf("\n\n");


                optionTLV.type = CANFD_Option_MCAN_ERROR_COUNTER;
                optionTLV.length = sizeof(CANFD_MCANErrCntStatus);
                optionTLV.value = (void*) &errCounter;

                retVal =  CANFD_getOptions(canHandle, &optionTLV, &errCode);
                if (retVal < 0)
                {
                    System_printf ("Error: CANFD get error counter failed [Error code %d]\n", errCode);
                }

                System_printf("Debug: Receive passive status            : %d\n", errCounter.rpStatus);
                System_printf("Debug: Transmit Error Counter            : %d\n", errCounter.transErrLogCnt);
                System_printf("Debug: Receive Error Counter             : %d\n", errCounter.recErrCnt);
                System_printf("Debug: Error Logging Counter             : %d\n", errCounter.canErrLogCnt);
                System_printf("\n\n");

                optionTLV.type = CANFD_Option_MCAN_PROTOCOL_STATUS;
                optionTLV.length = sizeof(CANFD_MCANProtocolStatus);
                optionTLV.value = (void*) &protoStatus;

                retVal =  CANFD_getOptions(canHandle, &optionTLV, &errCode);
                if (retVal < 0)
                {
                    System_printf ("Error: CANFD get protocol status failed [Error code %d]\n", errCode);
                }

                System_printf("Debug: LEC                               : %d\n", protoStatus.lastErrCode);
                System_printf("Debug: Activity                          : %d\n", protoStatus.act);
                System_printf("Debug: Error Passive                     : %d\n", protoStatus.errPassive);
                System_printf("Debug: Warning Status                    : %d\n", protoStatus.warningStatus);
                System_printf("Debug: Bus Off Status                    : %d\n", protoStatus.busOffStatus);
                System_printf("Debug: Data Phase LEC                    : %d\n", protoStatus.dlec);
                System_printf("Debug: Rx ESI flag                       : %d\n", protoStatus.resi);
                System_printf("Debug: Rx BRS flag                       : %d\n", protoStatus.rbrs);
                System_printf("Debug: Rx CAN FD                         : %d\n", protoStatus.rfdf);
                System_printf("Debug: Protocol Exception Event          : %d\n", protoStatus.pxe);
                System_printf("Debug: TDC value                         : %d\n", protoStatus.tdcv);
                System_printf("\n\n");

            }
 

 

Below is receive and trace info in PCAN-View.

It occur stuff error and form error.

 

Any advice on why get this errors?

 

Thanks.

  • Hi,

    Are you running the CANFD driver example itself, or did you import this code into a demo? Additionally, does it show errors for the first messages that are sent, or does the error not show up until later?

    Best Regards,
    Alec

  • I did import CANFD driver example code into CCS.

    In code, driver error show after sending a certain amount of messages. but, on trace of PCAN-View, Stuff Error show for the first messages.

    The attached file is the trace log of PCAN-View.

    canfd_example_log.zip

    Thanks.

  • Hi,

    To remove the risk that something did not get migrated over properly, could you try the Object Data Over CAN demo from the mmWave Automotive Toolbox? It is labeled as a demo for the 16xx devices, but I believe that it should function properly on your 68xx device. 

    Best Regards,
    Alec

  • Thank you for reply,

    I'm trying to run the Object Data Over CAN demo on IWR6843ISK, but I got open configuration failed error.

    But I solved my problem. I changed the data bit rate from 5 Mbit/s to 4 Mbit/s, and it works well.

     

    I know that the data phase transmission rate of CAN-FD is up to 5Mbits (some say 8Mbits).

    Cloud you give me some advice as to why the stuff error occurs when using 5Mbit/s?

     

    Thanks.

  • Hi,

    Be sure that the bit rates in your PCAN tool match the bit rates set in your program, or you will likely see errors due to the mismatch. As a sidenote, please be aware that there is a bit rate limitation due to the CAN transceiver(TCAN1042) used on the mmwaveICBoost device. You can find the part number listed in our data sheet and refer to the TCAN's data sheet to be certain, but I believe 5 Mb/s is the maximum for this transceiver. The transceiver is also an easy part to switch out if/when you design your own board in order to best meet your criteria.

    Best Regards,
    Alec

  • Hi,

    I obviously matched the bit rate settings of the PCAN tool and my program. (Normal is 1Mbit/s, Data is 5Mbit/s at occur error)

        /* Configuring 1Mbps and 5Mbps as nominal and data bit-rate respectively
            Prop seg: 8
            Ph seg 1: 6
            Ph Seg2 : 5
            Sync jump: 1
            BRP(Baud rate Prescaler): 2
    
            Nominal Bit rate = (40)/(((8+6+5)+1)*BRP) = 1Mhz
    
            Timing Params for Data Bit rate:
            Prop seg: 2
            Ph seg 1: 2
            Ph Seg2 : 3
            Sync jump: 1
            BRP(Baud rate Prescaler): 1
    
            Nominal Bit rate = (40)/(((2+2+3)+1)*BRP) = 5Mhz
        */
    
        mcanBitTimingParams.nomBrp      = 0x2U;
        mcanBitTimingParams.nomPropSeg  = 0x8U;
        mcanBitTimingParams.nomPseg1    = 0x6U;
        mcanBitTimingParams.nomPseg2    = 0x5U;
        mcanBitTimingParams.nomSjw      = 0x1U;
    
        /*5MHz*/
        mcanBitTimingParams.dataBrp     = 0x1U;
        mcanBitTimingParams.dataPropSeg = 0x2U;
        mcanBitTimingParams.dataPseg1   = 0x2U;
        mcanBitTimingParams.dataPseg2   = 0x3U;
        mcanBitTimingParams.dataSjw     = 0x1U;

    And the TCAN used in mmwaveICBost is a "G" option product, so it appears to be usable up to 5 Mbit/s.

     

    I did a search on the forum and found the link below. Any issues about this? (My IWR6843ISK is Rev. D and mmwaveICBoost is Rev. B)

    https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/880016/awr1843boost-rev-c-evm-can-fd-can-t-achieve-5mbps-sometimes-rev-b-evm-is-working-fine?tisearch=e2e-sitesearch&keymatch=can%25252525252520fd%25252525252520receive#

     

    Thanks.

  • Hi,

    I have not received this feedback recently from any other customers, so I don't expect an issue, but I can collect our PCAN device and verify it next week.

    Best Regards,
    Alec