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.

Linux/AM4378: CAN messages lost

Part Number: AM4378

Tool/software: Linux

Dear,

We are using the board broadly based on AM4378 and arago sitara linux. We receive CAN data continuously . When I receive multiple CAN data  with higher speed (less than 10ms), my data got lost. 

We are using Qt based environment and we are using separate “threads” in program to receive and process the CAN data.For loosing data is very crucial for us. 

How do i solve this problem?

Regards,

Winiston.P

  • Hi,

    Which TI SDK are you using? What is the reason that you think that you are losing data?

    One issue that has been seen before is the socket for transferring data has been opened as SOCK_DGRAM which is not a reliable method of transferring packets. Is this socket being used here?

    Are you able to reproduce the lost data using the cansend and candump utilities that come with the TI SDK?

    Best Regards,
    Schuyler
  • Dear Schuyler,

    We use SDK 4.01 and we developed application in QT to receive CAN data.

    We have more than 30 device ids in our CAN node. But we do not need all device id datas. I need only 10 device datas. This 30 device id data may overload CAN network and this may be a reason to loose data.  I do not know, How to filter those unwanted device id and datas. Can i use candump to filter unwanted data in QT application? If I can, How do i use candump to filter unwanted data in QT application.

    We do not use SOCK_DGRAM for transferring data. Which is the reliable method to transfer data?

    We could not check/reproduce lost data because it is installed in vehicle. I can not simulate data on the desk. But our required data got lost. Any way, i will check it and update you soon.

    Regards,

    Winiston.P

  • Hi Winiston,

    cansend and candump are standalone utilities that test basic can send and receive. SOCK_STREAM is preferred over SOCK_DGRAM.

    I think you will need some sort of CAN analyzer to verify that the data was actually sent on the CANBUS.

    Best Regards,
    Schuyler
  • Dear Schuyler,

    Thanks. Now i want to receive data using candump utility with idmask. I meant to say that i want to receive certain id's data only using idmask.

    Is it possible to set more than one idmask ?  (example: candump vcan0,92345678:DFFFFFFF    , candump vcan0,91876543:DFFFFFFF ,  candump vcan0,91562314:DFFFFFFF ) so that i can filter unwanted ids on the can node.

    How do i use  candump  received data to QT application? Please send any example program or hint.

    Regards,

    Winiston.p

  • Hi,

    I don't know if it is possible to do what you are asking concerning ID masks on the canutils apps. I can't answer if candump could be to pass data to a QT application.

    TI only recommends using the cansend and candump to test the interface and TI does not support the canutils that come with the SDK, this is its own community. Also TI does not build in the vcan support on the default kernel config that ships with the Linux SDK and TI does not have any examples on using vcan.

    As a suggestion here are the sources to canutils. If the app does not do what you need it to do you could modify the candump source file to perhaps do what you need. You will also need to turn on CONFIG_CAN_VCAN in the kernel config and rebuild.

    github.com/.../can-utils

    Best Regards,
    Schuyler
  • Have you checked the queue lengths, if those should be bigger? 

    For receive: /proc/sys/net/core/netdev_max_backlog (echo 300000 > /proc/sys/net/core/netdev_max_backlog)

    For transfer: txqueuelen (/sbin/ifconfig can0 txqueuelen 1000)

    JHi