Eric G Eric G - 1 year ago 107
Linux Question

Linux 2.6 on imx: Can't log sent CAN frames using candump

I have a custom build linux 2.6 running on a imx CPU. CAN communication with external nodes works like a charm, but the frames that I send to the nodes from my app is not printed when using "candump can0" in the terminal (when I run the same app on my host using a usb-CAN dongle this problem does not occur).

When extended CAN frames are sent they show up using candump.

I understand that it might be convenient that messages that is sent is filtered, but I should be possible to choose.

Any clues are welcome. I'm thinking that it might be some filtering in the driver that causes this.

The FLexCAN driver has the following config files:

abort br_propseg dump_rx_mb loopback state
wakeup bcc br_pseg1 dump_xmit_mb maxmb
std_msg xmit_maxmb bitrate br_pseg2

ext_msg modals subsystem boff_rec br_rjw
fifo power tsyn br_clksrc driver
listen smp uevent br_presdiv

dump_reg local_priority srx_dis wak_src

Answer Source

Alright, I have been at this issue many times but given up. But know I stumbled on the solution:

The setting file called srx_dis in the FlexCAN folder controls this behaviour. So, if you want to be able to read the CAN frames you send on the imx53_loco, do the following:

ifconfig can0 down
echo 0 > /sys/bus/platform/devices/FlexCAN.0/srx_dis
ifconfig can0 up

The reason I want to do this is for creating a service tool on the same device which can log all CAN frames.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download