2011/1/14 Willy Lambert <[email protected]> > > > 2011/1/14 Willy Lambert <[email protected]> > > 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 ? >> >> >> > After have add ocr + cdr tuning as suggested I have this (my motor has a > node ID of 0x21) : > > root@alpha:/opt/can# ./cansend can0 721#R >> root@alpha:/opt/can# ./cansend can0 000#0121 >> root@alpha:/opt/can# ./cansend can0 721#R >> root@alpha:/opt/can# ./cansend can0 000#0221 >> root@alpha:/opt/can# ./cansend can0 721#R >> root@alpha:/opt/can# ./cansend can0 000#0121 >> root@alpha:/opt/can# ./cansend can0 721#R >> root@alpha:/opt/can# ./cansend can0 000#8121 >> root@alpha:/opt/can# ./cansend can0 000#8221 >> >> root@alpha:/opt/can# ./candump any,0:0,#FFFFFFFF >> can0 721 [1] 00 >> can0 721 [0] remote request >> can0 721 [1] 7F >> can0 0 [2] 01 21 >> can0 1A1 [2] 60 00 >> can0 721 [0] remote request >> can0 721 [1] 85 >> can0 0 [2] 02 21 >> can0 721 [0] remote request >> can0 721 [1] 04 >> can0 0 [2] 01 21 >> can0 1A1 [2] 60 00 >> can0 721 [0] remote request >> can0 721 [1] 85 >> can0 0 [2] 81 21 >> can0 721 [1] 00 >> can0 0 [2] 82 21 >> can0 721 [1] 00 >> > > So it seems to communicating :) > > > During a "stress test" I have 2 controller error messages :
39 <http://lxr.linux.no/linux+*/include/linux/can/error.h#L39>#define CAN_ERR_CRTL_TX_WARNING <http://lxr.linux.no/linux+*/+code=CAN_ERR_CRTL_TX_WARNING> 0x08 /* reached warning level for TX errors */ <http://lxr.linux.no/linux+*/include/linux/can/error.h#L40> <http://lxr.linux.no/linux+*/+code=CAN_ERR_CRTL_RX_PASSIVE> 41 <http://lxr.linux.no/linux+*/include/linux/can/error.h#L41>#define CAN_ERR_CRTL_TX_PASSIVE <http://lxr.linux.no/linux+*/+code=CAN_ERR_CRTL_TX_PASSIVE> 0x20 /* reached error passive status TX */ canplayer file : > #start nodes > (0.000) can1 000#8100 > (1.000) can1 000#01.00 > (1.200) can1 721#R > > #Faulhaber command mode > (1.500) can1 321#FD.FF.FF.FF.FF > #motion enable > (1.700) can1 321#0F.00.00.00.00 > (1.900) can1 721#R > > #envoi d'une vitesse > (2.000) can1 321#93.FF.04.00.00 > #envoi d'une vitesse nulle > (5.000) can1 321#93.00.00.00.00 > > (6.000) can1 321#93.00.01.00.00 > (6.500) can1 321#93.00.02.00.00 > (7.000) can1 321#93.00.03.00.00 > (7.500) can1 321#93.00.04.00.00 > (8.000) can1 321#93.00.05.00.00 > (8.500) can1 321#93.00.06.00.00 > (9.000) can1 321#93.00.07.00.00 > (9.500) can1 321#93.00.08.00.00 > (10.000) can1 321#93.00.09.00.00 > (10.500) can1 321#93.00.10.00.00 > (11.000) can1 321#93.00.11.00.00 > (11.500) can1 321#93.00.12.00.00 > (12.000) can1 321#93.00.13.00.00 > (12.500) can1 321#93.00.14.00.00 > (13.000) can1 321#93.00.15.00.00 > (13.500) can1 321#93.00.16.00.00 > (14.000) can1 321#93.00.17.00.00 > (14.500) can1 321#93.00.18.00.00 > (15.000) can1 321#93.00.19.00.00 > (15.500) can1 321#93.00.20.00.00 > > > (18.000) can1 321#93.00.19.00.00 > (18.500) can1 321#93.00.18.00.00 > (19.000) can1 321#93.00.17.00.00 > (19.500) can1 321#93.00.16.00.00 > (20.000) can1 321#93.00.15.00.00 > (20.500) can1 321#93.00.14.00.00 > (21.000) can1 321#93.00.13.00.00 > (21.500) can1 321#93.00.12.00.00 > (22.000) can1 321#93.00.11.00.00 > (22.500) can1 321#93.00.10.00.00 > (23.000) can1 321#93.00.09.00.00 > (23.500) can1 321#93.00.08.00.00 > (24.000) can1 321#93.00.07.00.00 > (24.500) can1 321#93.00.06.00.00 > (25.000) can1 321#93.00.05.00.00 > (25.500) can1 321#93.00.04.00.00 > (26.000) can1 321#93.00.03.00.00 > (26.500) can1 321#93.00.02.00.00 > (27.000) can1 321#93.00.01.00.00 > (27.500) can1 321#93.00.00.00.00 > root@alpha:/opt/can# > candump view : can0 0 [2] 81 00 > can0 721 [1] 00 > can0 0 [2] 01 00 > can0 1A1 [2] 60 00 > can0 721 [0] remote request > can0 321 [5] FD FF FF FF FF > can0 721 [1] 05 > can0 321 [5] 0F 00 00 00 00 > can0 721 [0] remote request > can0 1A1 [2] 27 00 > can0 721 [1] 85 > can0 321 [5] 93 FF 04 00 00 > can0 321 [5] 93 00 00 00 00 > can0 321 [5] 93 00 01 00 00 > can0 321 [5] 93 00 02 00 00 > can0 321 [5] 93 00 03 00 00 > can0 321 [5] 93 00 04 00 00 > can0 321 [5] 93 00 05 00 00 > can0 321 [5] 93 00 06 00 00 > can0 321 [5] 93 00 07 00 00 > can0 321 [5] 93 00 08 00 00 > can0 321 [5] 93 00 09 00 00 > can0 321 [5] 93 00 10 00 00 > can0 321 [5] 93 00 11 00 00 > can0 321 [5] 93 00 12 00 00 > can0 321 [5] 93 00 13 00 00 > can0 321 [5] 93 00 14 00 00 > can0 321 [5] 93 00 15 00 00 > can0 321 [5] 93 00 16 00 00 > can0 321 [5] 93 00 17 00 00 > can0 321 [5] 93 00 18 00 00 > can0 321 [5] 93 00 19 00 00 > can0 321 [5] 93 00 20 00 00 > can0 321 [5] 93 00 19 00 00 > can0 321 [5] 93 00 18 00 00 > can0 321 [5] 93 00 17 00 00 > can0 321 [5] 93 00 16 00 00 > can0 321 [5] 93 00 15 00 00 > can0 321 [5] 93 00 14 00 00 > can0 321 [5] 93 00 13 00 00 > can0 321 [5] 93 00 12 00 00 > can0 321 [5] 93 00 11 00 00 > can0 321 [5] 93 00 10 00 00 > can0 321 [5] 93 00 09 00 00 > can0 321 [5] 93 00 08 00 00 > can0 20000004 [8] 00 08 00 00 00 00 67 0C ERRORFRAME > can0 20000004 [8] 00 20 00 00 00 00 87 0C ERRORFRAME > can0 721 [1] 00 > can0 321 [5] 93 00 07 00 00 > can0 321 [5] 93 00 06 00 00 > can0 321 [5] 93 00 05 00 00 > can0 321 [5] 93 00 04 00 00 > can0 321 [5] 93 00 03 00 00 > can0 321 [5] 93 00 02 00 00 > can0 321 [5] 93 00 01 00 00 > can0 321 [5] 93 00 00 00 00 > May this be due to wiring quality ? > > > > >> >> >> >> >>> >>> Wolfgang. >>> >> >> >
_______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
