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.

IWR1642BOOST: IWR1642,add CANFD to ppl lab

Part Number: IWR1642BOOST

I want to add CANFD to people counting  lab.CANFD unit test is successful.

CANFD has been successfully added and PC has received data.But occasionally there are data sending errors.

CANFD unit test does not have this problem.

Why do mistakes happen occasionally?

How can it be solved?

The console display and code are as follows.

thank you

  • Hello,

    I am looking into this error but need more time to respond. I will follow up with you early next week.

    Best Regards,

    Jackson

  • Hello,

    When you say the unit test is successful, you have run through the CANFD unit tests as described in this e2e post? Were there no errors reported with this test?

    What do you mean there are occasional errors? Do most of the transmissions work and a few cause an error? Or sometimes the CAN port doesn't work at all until power cycling?

    Regards,

    Jackson

  • CANFD Unit Test Menu
    Please select the type of test to execute:
    1. MCAN Internal loopback test
    2. MCAN External loopback test
    3. MCAN Multiple Tx test
    4. MCAN External Tx/Rx test
    5. MCAN EVM-EVM test
    6. MCAN Tx Cancel test
    7. MCAN Power down test

    3. MCAN Multiple Tx test is successful.During the operation of the program, no error has been reported.So I changed my program according to unit test 3.

    Unit test can send messages with multiple ID,I deleted this function and let the ID be only 0xc1.

    But in the process of ppl lab running, it will occasionally report error.

    temp = (uint8_t*)SOC_translateAddress(dessage.body.detObj.tlv[itemldx].address,SOC_TranslateAddr_Dir_FROM_OTHER_CPU,NULL);

    For example,there are 24 numbers in variable temp,the first eight numbers and the last eight numbers can be sent successfully, but the middle eight numbers fail.Then the program goes into while (retval < 0){},and the failed data will be sent again until successful(It's usually repeated 3-4 times before success).

    ppl lab can run and data also can be sent by CANFD.

    However, due to the sending error, the program entered into while (retval < 0),the output will be delayed at sometimes.

  • Does this pattern of 8 good, 8 bad, 8 good sends continue? Sometimes all the numbers are successful right?

    Have you looked at the signals on an oscilloscope to see that the signal integrity is good?

    Regards,

    Jackson

  • Yes, it happened as you described it.

    "While (i > 8U) {} " this cycle always succeeds at the first time, and may fail at the second time.

    I checked it with an oscilloscope.The positive pole of oscilloscope is connected to CANH, and the negative pole is connected to CANL

    When sending error, the oscilloscope does not detect the waveform output.

    When the sending is successful, the oscilloscope can detect the waveform and use the decoding function to analyze.

    Where might I have a problem with my program?

    thank you

  • Did you leave the debug statements (system_printf) in from the MultipleTX test code?

            for(index = 0; index < 5U ; index++)
            {
                retVal = CANFD_transmitData (txMsgObjHandle1[index], txMsgObjectParams1[index].msgIdentifier, CANFD_MCANFrameType_CLASSIC, 8U, &txData[0], &errCode);
                if (retVal < 0)
                {
                    System_printf ("Error: CANFD instance 0 transmit data retry failed [Error code %d]\n", errCode);
                }
                Task_sleep(1);
            }

    If you run in debug mode these should print out any error. Can you please post a copy of the debug log when running this section of code? It looks like you have some above but maybe add some in for the successful TX events? 

    Also, the 1 good, 1 bad, 1 good error that sometimes works seems like a timing issue. Did you leave the task_sleep(1) command in the CAN transmit code? Can you try increasing this slightly to see if that changes the behavior?

    Regards,

    Jackson

  • I used to use task_ sleep(1),Now I've increased the delay to 5 ms, task_ sleep(5).

    The problem is solved.

    thank you