I am trying to use the CAN bus on the imx6 apalis for a Qt application.
What I currently have done (commands in bold):
ip link set up can0 type can bitrate 1000000
ifconfig
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:38
ip -details link show can0
2: can0: mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 599724
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
bitrate 1000000 sample-point 0.733
tq 66 prop-seg 5 phase-seg1 5 phase-seg2 4 sjw 1
flexcan: tseg1 4…16 tseg2 2…8 sjw 1…4 brp 1…256 brp-inc 1
clock 30000000numtxqueues 599724 numrxqueues 599724 gso_max_size 599724 gso_max_segs 599724
My Qt application detects the can0 interface, but does not seem to be able to use it.
Are there any steps I am missing?
max.tx
July 23, 2019, 1:59pm
2
Hi
Did you have a look on how to access CAN from the command line?
I know that that Qt has some abstraction to access a CAN bus, however we at Toradex have no experience with it. Since CAN on Apalis iMX6 is provided as a socket can interface the Qt component should be able to make use of it.
Max
Hello,
I have looked at that page.
I ran my Qt Demo and tried to send a few frames and check the details for the can interface as follows.
ip -details link show can0
2: can0: mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 599724
can state ERROR-WARNING (berr-counter tx 128 rx 0) restart-ms 0
bitrate 1000000 sample-point 0.733
tq 66 prop-seg 5 phase-seg1 5 phase-seg2 4 sjw 1
flexcan: tseg1 4…16 tseg2 2…8 sjw 1…4 brp 1…256 brp-inc 1
clock 30000000numtxqueues 599724 numrxqueues 599724 gso_max_size 599724 gso_max_segs 599724
The can bus interface changed from ERROR-ACTIVE to ERROR-WARNING.
Additionally my app prints out the following error: Controller problem: reached warning level for TX errors.
Does this help identify any issues?
Hi @orichardson
I have the same errors with Qt and also can state is ERROR-WARNING, have you found any solution to this ?
Best,
Marek