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.

TDA4AL-Q1: can_fd receives message drop frame

Part Number: TDA4AL-Q1

HI,

At present, can automatically receives the packets sent by the millimeter wave module after the system is powered on. However, during the test, we found that our code would lose frames, and the data tested using canoe did not lose frames.

SDK version: 8.6.0

Thanks

  • Hello,

    Please check the nominal rate and data rate are set as per CAN instance.

    Regards

    Tarun Mukesh

  • Hi,

    Maybe the description is not clear, let me describe my problem again.

    Background

    1. I used CANOE and the development program to test the reception of radar signals at the same time. The number of packets with several different ids counted by CANOE was equal and there was no frame loss, but the number of different ids counted by the development program was very different, so a large number of frame loss was suspected.
    2. According to the log captured during the test, the packets sent by the radar are sent in a sequential cycle, but the program will have the phenomenon that the same packet is received twice within 1ms, and there will be packet loss of other ids before

    Program

    FIFO size = 5
    watermark = 3
    OP mode = 1(overwrite)

    question

    1. Can the current problem be solved by modifying the FIFO size?
    2. Why are there multiple reads of the same data? Is the data in the FIFO overwritten?

  • Two more questions:

    1) if I set the FIFO size to 16 and watermark to 8, and when the last message ends, if there are seven messages stored in FIFO, how will the program retrieve them? Is there any mechanism to trigger interrupts, etc; so that the program can read FIFO again?

    2) we now find that the number of packets sent by our sending module does not match the number of interrupts triggered by our TDA4. For example: Watermark 8, the sender sent 4,010 frames, but only 500 interrupts,500 * 8 = 4,000; TDA4 only received 4,000 frames; some interrupts are missing? How to solve this problem?

    This is the interrupt priority of CAN and should have the interrupt configured to the highest priority:

    thanks

  • Hello,

    Please allow me some time to go through your comments.Meanwhile could you please confirm which SDK version ,PDK or MCAL driver , which instance and on which core as well ?

    Regards

    Tarun Mukesh

  • SDK version: 8.6.0

    The CAN driver runs on mcu2-1;

    The Can driver is MCAN4;

    thanks

  • Hello li liu,

    I have few questions on your comments.

    Is TDA4x device acting as an receiver ? on the other end you have connected to conoe or other device ?

    If you are using TDA4x as a receiver then you have configured both RxFIFO0 and RxFIFO1 ?

    FIFO size = 5
    watermark = 3
    OP mode = 1(overwrite)

    Your FIFO size has been configured for 5 and watermark for every 3 frames and also selected overwrite mode.

    The issue you're facing with the radar signal reception seems to be related to the handling of packets in your program and the potential overflow or overwrite in the FIFO (First-In, First-Out) buffer.

    Let's break down your questions:

    FIFO Size Modification:

    Can the current problem be solved by modifying the FIFO size?
    Increasing the FIFO size might help mitigate the issue if the problem is due to the FIFO being too small to handle the incoming packets effectively. However, simply increasing the size might not completely resolve the problem if the issue lies elsewhere in the handling or processing of the packets.
    Multiple Reads of the Same Data:

    Why are there multiple reads of the same data? Is the data in the FIFO overwritten?
    The multiple reads of the same data within a short time frame (within 1ms) could be caused by:
    Overwriting data: If the FIFO is set to overwrite mode (as indicated by your configuration with OP mode = 1), it means that when the FIFO is full and a new packet arrives, it will overwrite the oldest data in the FIFO. This could lead to receiving the same packet multiple times if the overwrite happens before the program has processed the previous packet.
    Timing issues: If the program reads data from the FIFO at a faster rate than new data is coming in, it might inadvertently read the same data multiple times before new packets arrive.

    Solutions can be :

    Ensure the FIFO is read and processed at a pace that matches the incoming packet rate. Consider adjusting the FIFO settings or buffering strategy to handle data more efficiently. Check for any synchronization issues or race conditions in the code that could cause multiple reads of the same data

    1) if I set the FIFO size to 16 and watermark to 8, and when the last message ends, if there are seven messages stored in FIFO, how will the program retrieve them? Is there any mechanism to trigger interrupts, etc; so that the program can read FIFO again?

    After the watermark is reached , it will trigger an interrupt that's how it works by default if you configure watermark.

    we now find that the number of packets sent by our sending module does not match the number of interrupts triggered by our TDA4. For example: Watermark 8, the sender sent 4,010 frames, but only 500 interrupts,500 * 8 = 4,000; TDA4 only received 4,000 frames; some interrupts are missing? How to solve this problem?

    After every 8 frames as per your configuration it would have triggered 1 interrupt

    Regards

    Tarun Mukesh

  • Dear Tarun Mukesh:

    Still running on MCU2-1; now we have FIFO size set to 32 and FIFO waterMark set to 16; it will work fine when only one CAN path receives data But when two CAN (MCAN1 and MCAN4) are working at the same time; MCU2-1 is stuck; what is the reason; is there a problem with FIFO configuration?

    Both can uses FIFO0; the parameters are configured as follows; they are all configured the same;

    Thanks

  • Hello li liu,

    No it shouldn't be the FIFO configuration. Are you using PDK example ? Can you please connect debugger and see where it is struck ?

    Regards

    Tarun Mukesh

  • At present, the conclusion is that the performance decline leads to the untimely fetching of fifo data. As a result, the fifo is full, resulting in no print of the received log.

  • okay.

    Do you still need support on this thread ?  please let me know what is your expectation ?

    Regards

    Tarun Mukesh 

  • There are still some questions. I'm a little confused about the watermark Settings.

    1. Is there more msg in the FIFO than watermark, so the system will keep triggering interrupts?

    2. I want to read out all the MSGS in the FIFO, but I did not find a function for this, could you please inform me?

    3. If a device sends 20 packets to me within 50ms, the frame interval may reach 200us, so in order to receive data without losing frames, what is the appropriate watermark for me?

    Thanks

  • Hello li liu,

    A request from my side, If this question is resolved can we close this one .Can you please post another E2E thread with these questions ? I shall answer the same their as it more generic question than SDK based and can be helpful in future

    Regards

    Tarun Mukesh