Hi Wolfgang, thanks for your great debug tips.
Here is the output of the various commands:
r...@overo:~# ip link set can0 up type can bitrate 250000
r...@overo:~# ------------[ cut here ]------------
WARNING: at
/home/plejd/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/socketcan-modules-0.0+svnr1064-r46/trunk/kernel/2.6/drivers/net/can/mcp251x.c:796
mcp251x_irq_work_handler+0x244/0x5c0 [mcp251x]()
Modules linked in: mcp251x can_dev
[<c00f45d4>] (unwind_backtrace+0x0/0xdc) from [<c0116278>]
(warn_slowpath_common+0x4c/0x80)
[<c0116278>] (warn_slowpath_common+0x4c/0x80) from [<bf008ef8>]
(mcp251x_irq_work_handler+0x244/0x5c0 [mcp251x])
[<bf008ef8>] (mcp251x_irq_work_handler+0x244/0x5c0 [mcp251x]) from
[<c0126d1c>] (worker_thread+0x19c/0x218)
[<c0126d1c>] (worker_thread+0x19c/0x218) from [<c012a6b0>] (kthread+0x78/0x80)
[<c012a6b0>] (kthread+0x78/0x80) from [<c00f0800>] (kernel_thread_exit+0x0/0x8)
---[ end trace 28b396a9ed8a4478 ]---
NOHZ: local_softirq_pending 08
r...@overo:~# candump any,0:0,#ffffffff &
r...@overo:~# can: controller area network core (rev 20090105 abi 8)
NET: Registered protocol family 29
can: raw protocol (rev 20090105)
r...@overo:~# cansend can0 000#
can0 20000004 [8] 00 20 00 00 00 00 00 00 ERRORFRAME
caNOHZ: local_softirq_pending 08
n0 20000040 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
r...@ovenohz: local_softirq_pending 08
ro:~# can0 20000040 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
can0 20000040 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
can0 20000040 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
can0 20000004 [8] 00 20 00 00 00 00 00 00 ERRORFRAME
can0 20000040 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
can0 20000040 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
can0 20000040 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
can0 20000040 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
can0 20000040 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
can0 20000004 [8] 00 20 00 00 00 00 00 00 ERRORFRAME
can0 20000040 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
can0 20000004 [8] 00 20 00 00 00 00 00 00 ERRORFRAME
r...@overo:~# ip -d -s link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP qlen 10
link/can
can state ERROR-ACTIVE restart-ms 0
bitrate 250000 sample-point 0.850
tq 200 prop-seg 8 phase-seg1 8 phase-seg2 3 sjw 1
: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 10000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 5 5 11
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
r...@overo:~#
---
Even if I don't understand why the problem is I'm very delighted to be
able to see it in the software, have used an oscillosope to check the
signal previously and from what I could see there it appears to be
running at 1Mbit instead of 250kbit as requested. Where my fault
finding has ended now is that the chip doesn't seams to enter
configuration mode and therefore isn't setting the bittimiing
correctly either. If this is because of the reset instruction not
being correct or something else is still unknown to me however.
Hope the additional information can help you guide me further.
Kindest regards,
//Erik
On Wed, Sep 30, 2009 at 9:37 AM, Wolfgang Grandegger <[email protected]>
wrote:
> Erik Calissendorff wrote:
>> Hi I have tried to get the mcp251x driver to work with the Overo
>> Gumstix for sometime now.
>>
>> I finally got the driver and the SPI communication to work with kernel
>> 2.6.31 and was thereafter able to use iproute to initiate the bitrate,
>> which didn't work with previous kernel versions. But I still can't see
>
> Hm, could you please be more precise? What did not work which what
> version of the kernel, iproute2 and Socket-CAN?
>
>> any data sent or received on the can0 interface. I have inserted print
>> statements in the module to be able to debug it but I'm still stuck.
>> If someone could point me in the right direction it would be highly
>> appreciated. I'm running the modules from SVN rev 1064.
>
> I suspect either a electrical problem on the CAN bus or with the SPI
> transfer. Chris already commented on that latter. Here just some useful
> commands for debugging:
>
> - Run "candump any,0:0,#ffffffff" to check if messages are received.
> including error messages.
>
> - The "ip" program has some nice statistics information:
>
> "ip -d -s link show can0"
>
> Wolfgang.
>
>
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users