How can I use CANBus on Apalis TK1?

Dear all,

I want to receive data via CAN bus. What settings do I need to make on the hardware and software?
I could not find any information for Apalis TK1 on the Internet.

Thanks.

We are actually in the final stages of releasing this one as per the following ticket on our road map.

Thank you so much for the reply,

As I understand, CAN communication is not possible for now and you are planning a release to make communication over CAN Bus on Apalis TK1. What kind of release do you plan? Is it kind of driver for CAN modul? Is there a certain date for this?

Thanks.

As I understand, CAN communication is not possible for now and you are planning a release to make communication over CAN Bus on Apalis TK1. What kind of release do you plan?

Some level of integration will be part of our regular upcoming 2.7b4 Q3 release.

Is it kind of driver for CAN modul?

Yes, there is a driver running on the Apalis TK1 Embedded Linux kernel side as well as matching FreeRTOS firmware running on the K20 microcontroller side.

Is there a certain date for this?

As usual end of September, beginning of October.

Hello again,

In the previous days the new version has been released and Apalis TK1 it seems that to have CAN support.
I downloaded Linux BSP from this link for Apalis TK1.

I wrote the following commands. (reference link)

  • opkg update

  • opkg install canutils iproute2

  • ip link set can0 type can bitrate
    500000

  • ip link set can0 up

Finally I wrote the following command to read the data from the CAN line.

  • candump can0

interface = can0, family = 29, type = 3, proto = 1 comes first but not comes any CAN data.

I kindly request your help.

Thanks.

We’re aware of the issue and are investigating it, I’ll let you know when we have more information.

Hi, do you have any news about using CAN and apalis TK1? Is it working?

Please try this build:
https://share.toradex.com/26q50tdxsw1m3kk

When link is clicked, the following warning is displayed.

This file does not exist anymore!

What is the last situation?

Thanks.

New URL: https://share.toradex.com/2it0uxl9tdtyv3i

Hello,

I downloaded Linux BSP from this link for Apalis TK1. Right now I can send data via CAN.

  • BSP name: Apalis-TK1_LXDE-Image_2.7b5-20171201.tar.bz2

  • Date: 2017-12-05 16:23

However, I can not get any results when I try to read data with the following command.

  • candump can0

interface = can0, family = 29, type = 3, proto = 1 comes first but not comes any CAN data.

Am I doing something wrong, or is the problem still going on?

Thanks.

Can you capture the bus with a logic analyser or a oscilloscope during sending and receiving? What do you use for other devices on the bus? You can send can packets, can you confirm that they are properly received by other devices? Are you able to drop bus speed to 125kb/s for testing?

The updated image works much better, but there are problems yet.
If the data rate is quite high, candump stops to work until the reboot.

After some tests, the critical data rate has been found. When we run cangen on the external transmitter with the gap of 12 ms or less, the problem appears and TK1 receives nothing (tested with candump).

cangen can0 -g 12 -I 123 -L 8 -D i -v -v

CAN bus is set to 1Mbps rate.

Did you succeed to reproduce similar behavior? Should I wait for the update?

Dominik is on leave currently, he will come back to you early next year.

Happy New Year and Merry Christmas! Hope Mr. Dominik has returned.
Similar trouble seems to appear in parallel thread: https://www.toradex.com/community/questions/18964/can-bus-performance-on-tk1.html

Please give some feedback because we have an unpredictable delay in our product output due to its dependence on this issue.

Yes, I’m back and investigating the issue. We can reproduce it and have a possible fix. I’ll let you know when we have more defined timeline for a fix release.

There is a new test build for CAN performance available here:
https://share.toradex.com/ey322cir067fawa (toradex easy installer image)
and directly in toradex easy installer via the 3rd party feed.

Build is compatible only with v1.2A modules.

Successfully tested with:
RX (TX from Apalis imx6q) cangen can0 -g 0.5 -I 42A -L 8 -D i -v -v
TX cangen can0 -g 1 -I 42A -L 8 -D i -v -v

@dominik.tx

We have bought an older revision V1.1a of the TK1. Is there no way of getting CAN to work with this rev?
I had looked thru the issues document, but found nothing regarding CAN in the bug-fixes.

BR
Marc

You’ll need latest beta BSP, but otherwise it should work now also on v1.1 modules.