Hi Marc,

On 06/14/2011 11:14 AM, Marc Kleine-Budde wrote:
> On 06/13/2011 08:23 PM, Robin Holt wrote:
>> My starting point for the kernel is the source provided by freescale
>> with their P1010RDB board's SDK which is based upon the 2.6.35 kernel.
> 
> It's a board with a PowerPC processor, isn't it? I don't know which
> driver freescale ships with their SDK. The mainline kernel supports the
> flexcan core since 2.6.36 (for ARM), I've never tested the driver on a
> powerpc. However it works out of the box for freescales i.MX processors
> (mx25, mx38, mx35).

The P1010 is one of Freescale's QorIQ Multicore processor. At a closer
look, it has two Flexcan controllers which they also call eCAN. As we do
not have device tree bindings, it will not be supported yet by the
mainline Flexcan driver.

>> I have applied all the changes in the 2.6.35.y stable tree maintained
>> by Greg K-H.  I have configured both the flexcan interface statically
>> linked into the kernel and the vcan driver as a loadable module.

There must be special patches from Freescale.

>> I also have the can-utils installed in rootfs.
>>
>> I have built a simple 3-meter cable with Pins 2, 3, and 7 connected
>> together on both ends and pins 2 and 7 terminated with 120 ohm resistors
>> on each end.

OK, but check if there is already 120 Ohm termination on the board.

>> Following boot, I do/see:
>>
>> # ip link set can0 type can bitrate 125000 triple-sampling on
>> # ifconfig can0 up
>> # ip link set can1 type can bitrate 125000 triple-sampling on
> 
> I usually don't use triple-sampling.

Yes, please try first without "triple-sampling".

>> # ifconfig can1 up
>> # 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 <TRIPLE-SAMPLING> state ERROR-ACTIVE (berr-counter tx 0 rx 0) 
>> restart-ms 0 
>>     bitrate 125000 sample-point 0.875 
>>     tq 500 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 200000000
>>     re-started bus-errors arbit-lost error-warn error-pass bus-off
>>     0          0          0          0          0          0         
>>     RX: bytes  packets  errors  dropped overrun mcast   
>>     0          0        0       0       0       0      
>>     TX: bytes  packets  errors  dropped carrier collsns 
>>     0          0        0       0       0       0      
>> # ip -d -s link show can1
>> 3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 
>> 10
>>     link/can 
>>     can <TRIPLE-SAMPLING> state ERROR-ACTIVE (berr-counter tx 0 rx 0) 
>> restart-ms 0 
>>     bitrate 125000 sample-point 0.875 
>>     tq 500 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 200000000
>>     re-started bus-errors arbit-lost error-warn error-pass bus-off
>>     0          0          0          0          0          0         
>>     RX: bytes  packets  errors  dropped overrun mcast   
>>     0          0        0       0       0       0      
>>     TX: bytes  packets  errors  dropped carrier collsns 
>>     0          0        0       0       0       0      
>> # candump -e any,0:0,#FFFFFFFF &
>> # cansend can0 123#1122334455667788
>> #   can0  20000044  [8] 00 10 00 00 00 00 00 00   ERRORFRAME
>>      controller-problem{rx-error-passive}
>>      bus-off
>> # ip -d -s link show can0
>> 2: can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 
>> 10
>>     link/can 
>>     can <TRIPLE-SAMPLING> state BUS-OFF (berr-counter tx 0 rx 0) restart-ms 
>> 0 
>>     bitrate 125000 sample-point 0.875 
>>     tq 500 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 200000000
>>     re-started bus-errors arbit-lost error-warn error-pass bus-off
>>     0          0          0          1          1          1         
>>     RX: bytes  packets  errors  dropped overrun mcast   
>>     8          1        0       0       0       0      
>>     TX: bytes  packets  errors  dropped carrier collsns 
>>     8          0        0       0       0       0      
>> # ip -d -s link show can1
>> 3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 
>> 10
>>     link/can 
>>     can <TRIPLE-SAMPLING> state ERROR-ACTIVE (berr-counter tx 0 rx 0) 
>> restart-ms 0 
>>     bitrate 125000 sample-point 0.875 
>>     tq 500 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 200000000
>>     re-started bus-errors arbit-lost error-warn error-pass bus-off
>>     0          0          0          0          0          0         
>>     RX: bytes  packets  errors  dropped overrun mcast   
>>     0          0        0       0       0       0      
>>     TX: bytes  packets  errors  dropped carrier collsns 
>>     0          0        0       0       0       0      
>>
>>
>> Any help/guidance will be greatly appreciated.
> 
> Check the board documentation if external termination is needed. Recheck
> your cabling, you need a 1-to-1 cable connecting pins 2-2, 3-3 and 7-7,
> if sub-d on the board has the standard CAN pinout[1]

A short-circuiut will cause bus-offs. Most likely the cabling is not OK.

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

Reply via email to