> -----Mensaje original-----
> De: Wolfgang Grandegger [mailto:[email protected]]
> Enviado el: Monday, March 14, 2011 5:12 PM
> Para: Jorge Fernandez Monteagudo
> CC: [email protected]
> Asunto: Re: [Socketcan-users] Setting the clock, ocr and cdr values
>
> On 03/14/2011 05:02 PM, Jorge Fernandez Monteagudo wrote:
> >
> > Hi, I have something running...
> >
> > I've installed the last iproute2:
> >
> > # cd /opt/iproute2-2.6.37/ip
> > # ./ip link set can0 type can bitrate 1000000
> > # ifconfig can0 up
> > 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:8061 errors:0 dropped:0 overruns:0 frame:0
> > TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> > collisions:0 txqueuelen:10
> > RX bytes:8061 (7.8 KiB) TX bytes:0 (0.0 B)
> > Interrupt:21
> >
>
> What does "./ip -d -s link show can0" report?
>
7: 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 1000000 sample-point 0.750
tq 125 prop-seg 2 phase-seg1 3 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
20999 20999 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
> > # dmesg
> > ...
> > device 0000:01:03.0: setting BTR0=0x00 BTR1=0x14
>
> OK, that's the BTR0/1 for a 16 MHz oscillator.
>
> >
> > # cat /proc/net/can/stats
> >
> > 0 transmitted frames (TXF)
> > 7410 received frames (RXF)
> > 4 matched frames (RXMF)
> >
> > 0 % total match ratio (RXMR)
> > 0 frames/s total tx rate (TXR)
> > 0 frames/s total rx rate (RXR)
> >
> > 0 % current match ratio (CRXMR)
> > 0 frames/s current tx rate (CTXR)
> > 9 frames/s current rx rate (CRXR)
> >
> > 27 % max match ratio (MRXMR)
> > 0 frames/s max tx rate (MTXR)
> > 11 frames/s max rx rate (MRXR)
> >
> > 0 current receive list entries (CRCV)
> > 1 maximum receive list entries (MRCV)
> >
> > # cd /opt/socketcan/can-utils
> > # ./candump can0 0:0,#FFFFFFFF
> > SIOCGIFINDEX: No such device
>
> Try
>
> ./candump can0,0:0,#FFFFFFF or even better
> ./candump any,0:0,#FFFFFFFF
>
Yes, the first one is working for me!
# ./candump can0,0:0,#FFFFFFFF
can0 721 [1] 7F
can0 720 [1] 05
can0 724 [1] 05
can0 725 [1] 05
can0 722 [1] 05
can0 723 [1] 7F
can0 70C [1] 7F
can0 729 [1] 7F
can0 70B [1] 7F
can0 71F [1] 7F
can0 714 [1] 7F
> > The can0 device is up and receiving frames? but I can read them.
> > Maybe the /dev/can0 is not set properly, because I'm using the
> > old one:
> >
> > # ls -al /dev/can0
> > crw-rw-rw- 1 root root 91, 0 2011-03-11 14_39 /dev/can0
>
> SocketCAN is a *network* driver (and not a character device driver).
>
> Wolfgang.
Thanks a lot!
Regards,
Jorge
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o CONFIDENCIAL. Si no es vd. el destinatario indicado,
queda notificado de que la utilización, divulgación y/o copia sin autorización
está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje
por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.
This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by professional privilege.
If you are not the intended recipient you are hereby notified that any
dissemination, copy or disclosure of this communication is strictly prohibited
by law. If this message has been received in error, please immediately notify
us via e-mail and delete it.
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users