2011/1/14 Wolfgang Grandegger <[email protected]>

> On 01/14/2011 10:37 AM, Willy Lambert wrote:
> > 2011/1/14 Wolfgang Grandegger <[email protected]>
> >
> >> On 01/14/2011 12:57 AM, Willy Lambert wrote:
> >>> 2011/1/13 Willy Lambert <[email protected]>
> >> ...
> >>> I am stuck with the test case setup, candump shows error messages when
> I
> >> try
> >>> a cansend. I already have tricks with extended or standard data frame
> >>> formats with Ixxat drivers. My motors seems to only accept standard
> >> frames.
> >>> Is there a way to configure this ?
> >>>
> >>> I booted my target with Ixxat driver and run my test cases to validate
> >>> everything is in order. (BIOS options, jumpers, IRQ, wiring). I only
> use
> >> one
> >>> controller on IRQ11 (as it is said as "reserved" in my CPU board IRQ
> >>> mapping)
> >>> I may run my motor and receive SDO from him, everything seems to be OK.
> >>
> >> The hardware seem to work. That's a good starting point.
> >>
> >>> Without changing anything except my init script which load can drivers
> >> (in
> >>> order to load socket can drivers instead of Ixxat ones), I rebooted my
> >> CPU.
> >>>
> >>> Here is the load script :
> >>>
> >>>> modprobe sja1000_isa irq=11 mem=0xD0000
> >>>> ip link set can0 type can bitrate 250000 restart-ms 1000
> >>>> ifconfig can0 up
> >>>>
> >>>
> >>> Here is dmesg answer (which seems correc) :
> >>>
> >>>> [    3.928467] sja1000_isa sja1000_isa.0: sja1000_isa device
> registered
> >>>> (reg_base=0xc00d0000, irq=11)
> >>>> [    3.928646] Legacy sja1000_isa driver for max. 8 devices registered
> >>>> [    3.938877] sja1000_isa sja1000_isa.0: setting BTR0=0x01 BTR1=0x1c
> >>>>
> >>>
> >>> Here is ifconfig result :
> >>>
> >>>> 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:2 errors:0 dropped:0 overruns:0 frame:0
> >>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> >>>>           collisions:0 lg file transmission:10
> >>>>           RX bytes:16 (16.0 B)  TX bytes:0 (0.0 B)
> >>>>           Interruption:11
> >>>>
> >>>
> >>> Here is /proc/iomem
> >>>
> >>>> 00000000-00000fff : reserved
> >>>> 00001000-0009fbff : System RAM
> >>>> 0009fc00-0009ffff : reserved
> >>>> 000a0000-000bffff : Video RAM area
> >>>> 000c0000-000c7fff : Video ROM
> >>>> 000d0000-000d001f : sja1000_isa
> >>>> ...
> >>>>
> >>>
> >>> Here is /proc/interrupts
> >>>
> >>>>            CPU0
> >>>>   0:        215   IO-APIC-edge      timer
> >>>>   1:          8   IO-APIC-edge      i8042
> >>>>   2:          0    XT-PIC-XT        cascade
> >>>>   8:         97   IO-APIC-edge      rtc0
> >>>>  11:          1   IO-APIC-edge      can0
> >>>>  12:          7   IO-APIC-edge      i8042
> >>>>  14:          0   IO-APIC-edge      ata_piix
> >>>>  15:       1017   IO-APIC-edge      ata_piix
> >>>>  19:          0   IO-APIC-fasteoi   uhci_hcd:usb3
> >>>>  23:         14   IO-APIC-fasteoi   ehci_hcd:usb1, uhci_hcd:usb2
> >>>>  40:        411   PCI-MSI-edge      eth0
> >>>> NMI:          0   Non-maskable interrupts
> >>>> LOC:     293000   Local timer interrupts
> >>>> SPU:          0   Spurious interrupts
> >>>> PMI:          0   Performance monitoring interrupts
> >>>> PND:          0   Performance pending work
> >>>> TRM:          0   Thermal event interrupts
> >>>> THR:          0   Threshold APIC interrupts
> >>>> MCE:          0   Machine check exceptions
> >>>> MCP:          1   Machine check polls
> >>>> ERR:          0
> >>>> MIS:          0
> >>>>
> >>>
> >>> I write this command to wake up everybody :
> >>>
> >>>> ./cansend can0 000#0100
> >>>>
> >>>
> >>> And at the same time, in another terminal, I run candump with theses
> >> results
> >>> :
> >>>
> >>>>  ./candump any,0:0,#FFFFFFFF
> >>>>   can0  20000040  [8] 00 00 00 00 00 00 00 00   ERRORFRAME
> >>>>   can0  20000100  [8] 00 00 00 00 00 00 00 00   ERRORFRAME
> >>>>   can0  20000004  [8] 00 04 00 00 00 00 00 71   ERRORFRAME
> >>>>   can0  20000004  [8] 00 10 00 00 00 00 00 81   ERRORFRAME
> >>
> >> The controller goes bus-off.
> >
> >
> > May I ask you how you decode the candump ERRORFRAME ? does the
> > 20000040/20000100/20000004 makes sens ? What the date behind ?
>
> See http://lxr.linux.no/#linux/include/linux/can/error.h
>
> Also "ip -d -s link show can0" should provide some useful statistics.
>

Here is the result of the command, just after booting (no ocr, cdr tuning),
with my 2nd can node poweredOff. So Nothing is received, nothing is sent.

root@alpha:~# ip -d -s link show can0
> 3: 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 1000
>     bitrate 250000 sample-point 0.875
>     tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
>     sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
>     clock 8000000
>     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
> root@alpha:~#
>

Is it normal that it's already in an error state ?






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

Reply via email to