Skip to contentSkip to conversation

Flexcan on i.mx536 Infotainment Platform

Socketcan-users Marc Kleine-Budde 3 participants 5 messages Jun 4, 2012 – Jun 15, 2012 2 messages not in the archive CAN network drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Marc Kleine-Budde

author maintainer
#1 lore raw

Hello Keith,

please switch to the "[email protected]" mailinglist, the berlios list is obsolete.

Quoted 2 lines · Keith Jones

I booted up my new Infotainment demo board after ported 2.6.39 flexcan (flexcan.h flexcan.c) support into my 2.6.35 linux distro.

Use v3.4 or better, this version contains some vital fixes against error irq floods.

Quoted 5 lines

After seeing flexcan driver register and performing the following commands, I get constant interrupts and error packets visualized using my Canoe CANbus sniffer. I am using 250K baud. Did not check termination. No oscilloscope was used as yet. Can not receive any packets. can state goes from ERROR-ACTIVE to ERROR-PASSIVE.

Please check the Termination, do you have a second CAN member on the bus?

Quoted 17 lines

Any clues?

root@freescale ~$ cansend can0 123#1122334455
root@freescale /usr/bin$ ip -d -s link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
link/can
can state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0 bitrate 250000 sample-point 0.875
tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1 clock 24000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 5 5 0
RX: bytes packets errors dropped overrun mcast
80 10 0 0 0 0
TX: bytes packets errors dropped carrier collsns
5 0 0 0 0 0

If the tx error counter goes up, the device may be the only device on the CAN bus. Your sniffer is probably totally passive, which means it doesn't qualify as a second station.

cheers, Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
author maintainer
#2 lore raw
Quoted 4 lines · Marc Kleine-Budde

Hello Keith,

please switch to the "[email protected]" mailinglist, the berlios list is obsolete.

BTW: don't post HTML mails on that list, they won't get through.

cheers, Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#3 lore raw
In reply to Marc Kleine-Budde

On  Monday, June 4, 2012 2:52 PM, Marc Kleine-Budde wrote:

Subject: Re: [Socketcan-users] Flexcan on i.mx536 Infotainment Platform

Quoted 11 lines

Hello Keith,

please switch to the "[email protected]" mailinglist, the berlios list is obsolete.

Quoted 2 lines · Keith Jones

I booted up my new Infotainment demo board after ported 2.6.39 flexcan (flexcan.h flexcan.c) support into my 2.6.35 linux distro.

Use v3.4 or better, this version contains some vital fixes against error irq floods.

Ok moving to v3.4 kernel. I will reply with results.

Quoted 7 lines
Quoted 5 lines

After seeing flexcan driver register and performing the following commands, I get constant interrupts and error packets visualized using my Canoe CANbus sniffer. I am using 250K baud. Did not check termination. No oscilloscope was used as yet. Can not receive any packets. can state goes from ERROR-ACTIVE to ERROR-PASSIVE.

Please check the Termination, do you have a second CAN member on the bus?

I have performed two activities: (1) just the demo board and (2) the demo board and a terminated device. With both, I  observed the same error packet results. I have also attached a scope and observed solid CAN signalling on the bus when the remote is sending J1939 ids. The plan is to retest again after moving to 3.4.

Quoted 18 lines
Quoted 17 lines

Any clues?

root@freescale ~$ cansend can0 123#1122334455
root@freescale /usr/bin$ ip -d -s link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10 link/can
    can state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0 bitrate 250000 sample-point 0.875
    tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
    flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1 clock 24000000
    re-started bus-errors arbit-lost error-warn error-pass bus-off 0          0          0          5          5          0
    RX: bytes  packets  errors  dropped overrun mcast
    80        10      0      0      0      0
    TX: bytes  packets  errors  dropped carrier collsns
    5          0        0      0      0      0

Quoted 3 lines

If the tx error counter goes up, the device may be the only device on the CAN bus. Your sniffer is probably totally passive, which means it doesn't qualify as a second station.

tx error counter does go up and yes, my sniffer is passive.

Quoted 1 line

cheers, Marc

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Hello,

I forgot to switch to the new Linux-CAN mailing list... doing it now.

Quoted 8 lines · Wolfgang Grandegger
Quoted 7 lines · Keith Jones

Hello,

I booted up my new Infotainment demo board after ported 2.6.39 flexcan (flexcan.h flexcan.c) support into my 2.6.35 linux distro.

After seeing flexcan driver register and performing the following commands, I get constant interrupts and error packets visualized using my Canoe CANbus sniffer. I am using 250K baud. Did not check termination. No oscilloscope was used as yet. Can not receive any packets. can state goes from ERROR-ACTIVE to ERROR-PASSIVE.

Quoted 8 lines
Quoted 1 line

Any clues?

Is there at least one more CAN node on the bus acknowledging the message? If not, the behavior is normal. Also improper termination or bit-timing could cause bus errors.

Is Flexcan known to work on that hardware and software? The transceivers might still be off, etc.

The 2.6.35 kernel you use, is it from Freescale? If that's the case, you need also to port the platform code for the Flexcan controller.

Wolfgang.

Quoted 90 lines
Quoted 79 lines

--------------------------------------------------

.
.

vcan: Virtual CAN interface driver
CAN device driver interface
flexcan netdevice driver
flexcan flexcan.0: device registered (reg_base=e09f0000, irq=82) flexcan flexcan.1: device registered (reg_base=e09f8000, irq=83) .
.
.
----------------------------------------------------------------

root@freescale ~$ ip link set can0 up type can bitrate 250000 root@freescale /usr/bin$ ip -d -s link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
link/can
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 bitrate 250000 sample-point 0.875
tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1 clock 24000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 4 4 0
RX: bytes packets errors dropped overrun mcast
64 8 0 0 0 0
TX: bytes packets errors dropped carrier collsns
4 0 0

root@freescale ~$ cansend can0 123#1122334455
root@freescale /usr/bin$ ip -d -s link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
link/can
can state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0 bitrate 250000 sample-point 0.875
tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1 clock 24000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 5 5 0
RX: bytes packets errors dropped overrun mcast
80 10 0 0 0 0
TX: bytes packets errors dropped carrier collsns
5 0 0 0 0 0
root@freescale /usr/bin$ cat /proc/interrupts
CPU0

  1:       1491    MXC_TZIC  mxsdhci
  2:          0    MXC_TZIC  mxsdhci
  6:          1    MXC_TZIC  mxc_sdma
  8:          2    MXC_TZIC  mxc_nd
  9:          0    MXC_TZIC  VPU_CODEC_IRQ
 10:          0    MXC_TZIC  mxc_ipu
 11:          2    MXC_TZIC  mxc_ipu
 12:          0    MXC_TZIC  ydx
 14:          0    MXC_TZIC  usb_wakeup, ehci_hcd:usb2
 16:          0    MXC_TZIC  usb_wakeup, ehci_hcd:usb3
 18:          0    MXC_TZIC  usb_wakeup, fsl-usb2-otg, ehci_hcd:usb1, fsl-usb2-udc
 24:          0    MXC_TZIC  mxc_rtc
 28:          0    MXC_TZIC  ahci
 31:       4093    MXC_TZIC  mxcintuart
 36:          1    MXC_TZIC  CSPI_IRQ
 39:      69290    MXC_TZIC  i.MX Timer Tick
 63:        198    MXC_TZIC  imx-i2c
 64:         60    MXC_TZIC  imx-i2c
 66:          0    MXC_TZIC  asrc
 69:          0    MXC_TZIC  mxc_iim
 73:          0    MXC_TZIC  dvfs
 82:    1283596    MXC_TZIC  can0
 84:          0    MXC_TZIC  g12
129:          0           -  mxsdhci
132:          0           -  mxsdhci
191:          0           -  eth0

Err: 0
root@freescale /usr/bin$

Quoted 4 lines

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

#6 lore raw
Quoted 3 lines · Wolfgang Grandegger

Hello,

I forgot to switch to the new Linux-CAN mailing list... doing it now.

I just realized that the message has already been discussed on this mailing list... sorry for the extra noise.

Wolfgang.