linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CAN Interface on Toradex Board
@ 2013-10-23 16:49 Spies, Raphael | BFFT GmbH
  2013-10-23 17:22 ` Oliver Hartkopp
  0 siblings, 1 reply; 7+ messages in thread
From: Spies, Raphael | BFFT GmbH @ 2013-10-23 16:49 UTC (permalink / raw)
  To: linux-can@vger.kernel.org

Hi everyone,


at the moment i try to get a can interface to work on a toradex 
tegra2 evaluation board. in the manual there are some instructions:


http://developer.toradex.com/software-resources/arm-family/linux/linux-%28colibri-t20%29-know-how#CAN

I downloaded the packages from: 

http://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Extra/can-packages.tar.bz2

and installed them on my device. When I try to set my bitrate as explained 

"ip link set can0 type can bitrate 125000"

it quits with 

"RTNETLINK answers: Invalid argument".


A strace command yields a line with


"open("usr/lib/ip/link_can.so", ...) = -1 ENOENT (No such file or directory)".


Does anyone have any idea how can I fix that problem? or in what direction I have to search for solutions?


Thanks a lot,
Raphael Spies



Kernel version 3.1.10-gd831d2d, build as explained on toradex homepage



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: CAN Interface on Toradex Board
  2013-10-23 16:49 CAN Interface on Toradex Board Spies, Raphael | BFFT GmbH
@ 2013-10-23 17:22 ` Oliver Hartkopp
  2013-10-24  6:44   ` AW: " Spies, Raphael | BFFT GmbH
  0 siblings, 1 reply; 7+ messages in thread
From: Oliver Hartkopp @ 2013-10-23 17:22 UTC (permalink / raw)
  To: Spies, Raphael | BFFT GmbH; +Cc: linux-can@vger.kernel.org

On 23.10.2013 18:49, Spies, Raphael | BFFT GmbH wrote:
> Hi everyone,
> 

Hi Raphael,

> 
> at the moment i try to get a can interface to work on a toradex 
> tegra2 evaluation board. in the manual there are some instructions:
> 
> 
> http://developer.toradex.com/software-resources/arm-family/linux/linux-%28colibri-t20%29-know-how#CAN
> 
> I downloaded the packages from: 
> 
> http://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Extra/can-packages.tar.bz2
> 
> and installed them on my device. When I try to set my bitrate as explained 
> 
> "ip link set can0 type can bitrate 125000"
> 
> it quits with 
> 
> "RTNETLINK answers: Invalid argument".

Can you see the can0 interface itself?

E.g. with

ip link show
ip -det link show

or

cat /proc/net/dev

??

Can you see this message from the documentation

[    4.904898] CAN device driver interface
[    4.932793] Colibri EvalBoard V3.1a/MECS Tellurium xPOD CAN Initialisation
[    4.979119] mcp251x spi3.0: probed

when invoking 'dmesg' ?

> 
> 
> A strace command yields a line with
> 
> 
> "open("usr/lib/ip/link_can.so", ...) = -1 ENOENT (No such file or directory)".
> 

This looks like the installed iproute2 package is broken.

My 'ip' does not try to access "usr/lib/ip/link_can.so"

at least the leading slash "/" is missing.

Is it possible that you have a built-in "ip" in your busybox which is invoked
here?

Say

 ls -l `which ip`

to check if 'ip' is linked to the busybox binary.

Regards,
Oliver

> 
> Does anyone have any idea how can I fix that problem? or in what direction I have to search for solutions?
> 
> 
> Thanks a lot,
> Raphael Spies
> 
> 
> 
> Kernel version 3.1.10-gd831d2d, build as explained on toradex homepage



^ permalink raw reply	[flat|nested] 7+ messages in thread

* AW: CAN Interface on Toradex Board
  2013-10-23 17:22 ` Oliver Hartkopp
@ 2013-10-24  6:44   ` Spies, Raphael | BFFT GmbH
  2013-10-24  7:28     ` Wolfgang Grandegger
  0 siblings, 1 reply; 7+ messages in thread
From: Spies, Raphael | BFFT GmbH @ 2013-10-24  6:44 UTC (permalink / raw)
  To: 'Oliver Hartkopp'; +Cc: linux-can@vger.kernel.org

Hello everyone,

thanks for the help so far..


> 	Can you see the can0 interface itself?

Yes, I Can see the can interface. IP Link shows:

2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT qlen 10
    link/can 
    can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0 
    bitrate 0 sample-point 0.000 
    tq 0 prop-seg 0 phase-seg1 0 phase-seg2 0 sjw 0
    sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
    clock 12000000

>	when invoking 'dmesg' ?

[    2.067414] CAN device driver interface
[    2.079435] sja1000 CAN netdevice driver
[    2.092644] sja1000_platform sja1000_platform.0: sja1000_platform device registered (reg_base=c9800000, irq=192)
...
[    5.051783] can: controller area network core (rev 20090105 abi 8)
[    5.063383] NET: Registered protocol family 29
[    5.072990] can: raw protocol (rev 20090105)
[    5.082193] can: broadcast manager protocol (rev 20090105 t)


> 	This looks like the installed iproute2 package is broken.

I downloaded them from the given link in the documentation:
http://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Extra/can-packages.tar.bz2
on the distribution in the image V2 of Toradex there is due to the hardfloat architecture no working package manager, so I have to install them manually


>	 ls -l `which ip`
>	 to check if 'ip' is linked to the busybox binary.

"Which ip" gives "/bin/ip" and is in my opinion linked to iproute2

Regards,
Raphael

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: AW: CAN Interface on Toradex Board
  2013-10-24  6:44   ` AW: " Spies, Raphael | BFFT GmbH
@ 2013-10-24  7:28     ` Wolfgang Grandegger
  2013-10-24  7:39       ` AW: " Spies, Raphael | BFFT GmbH
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Grandegger @ 2013-10-24  7:28 UTC (permalink / raw)
  To: Spies, Raphael | BFFT GmbH; +Cc: Oliver Hartkopp, linux-can

On Thu, 24 Oct 2013 06:44:30 +0000, "Spies, Raphael | BFFT GmbH"

<raphael.spies@bfft.de> wrote:

> Hello everyone,

> 

> thanks for the help so far..

> 

> 

>> 	Can you see the can0 interface itself?

> 

> Yes, I Can see the can interface. IP Link shows:

> 

> 2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT qlen 10

>     link/can 

>     can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0 

>     bitrate 0 sample-point 0.000 

>     tq 0 prop-seg 0 phase-seg1 0 phase-seg2 0 sjw 0

>     sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1

>     clock 12000000

> 

>>	when invoking 'dmesg' ?

> 

> [    2.067414] CAN device driver interface

> [    2.079435] sja1000 CAN netdevice driver

> [    2.092644] sja1000_platform sja1000_platform.0: sja1000_platform

> device registered (reg_base=c9800000, irq=192)

> ...

> [    5.051783] can: controller area network core (rev 20090105 abi 8)

> [    5.063383] NET: Registered protocol family 29

> [    5.072990] can: raw protocol (rev 20090105)

> [    5.082193] can: broadcast manager protocol (rev 20090105 t)

> 

> 

>> 	This looks like the installed iproute2 package is broken.

> 

> I downloaded them from the given link in the documentation:

>

http://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Extra/can-packages.tar.bz2

> on the distribution in the image V2 of Toradex there is due to the

> hardfloat architecture no working package manager, so I have to install

> them manually

> 

> 

>>	 ls -l `which ip`

>>	 to check if 'ip' is linked to the busybox binary.

> 

> "Which ip" gives "/bin/ip" and is in my opinion linked to iproute2



What does "ip link help" list?



Wolfgang.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* AW: AW: CAN Interface on Toradex Board
  2013-10-24  7:28     ` Wolfgang Grandegger
@ 2013-10-24  7:39       ` Spies, Raphael | BFFT GmbH
  2013-10-24 22:50         ` Mirza Krak
  2013-10-25 18:24         ` Wolfgang Grandegger
  0 siblings, 2 replies; 7+ messages in thread
From: Spies, Raphael | BFFT GmbH @ 2013-10-24  7:39 UTC (permalink / raw)
  To: 'Wolfgang Grandegger'; +Cc: 'linux-can@vger.kernel.org'


> -----Ursprüngliche Nachricht-----
> Von: linux-can-owner@vger.kernel.org [mailto:linux-can-
> owner@vger.kernel.org] Im Auftrag von Wolfgang Grandegger
> Gesendet: Donnerstag, 24. Oktober 2013 09:28
> An: Spies, Raphael | BFFT GmbH
> Cc: Oliver Hartkopp; linux-can@vger.kernel.org
> Betreff: Re: AW: CAN Interface on Toradex Board
> 
> On Thu, 24 Oct 2013 06:44:30 +0000, "Spies, Raphael | BFFT GmbH"
> 
> <raphael.spies@bfft.de> wrote:
> 
> > Hello everyone,
> 
> >
> 
> > thanks for the help so far..
> 
> >
> 
> >
> 
> >> 	Can you see the can0 interface itself?
> 
> >
> 
> > Yes, I Can see the can interface. IP Link shows:
> 
> >
> 
> > 2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT
> qlen
> > 10
> 
> >     link/can
> 
> >     can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0
> 
> >     bitrate 0 sample-point 0.000
> 
> >     tq 0 prop-seg 0 phase-seg1 0 phase-seg2 0 sjw 0
> 
> >     sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
> 
> >     clock 12000000
> 
> >
> 
> >>	when invoking 'dmesg' ?
> 
> >
> 
> > [    2.067414] CAN device driver interface
> 
> > [    2.079435] sja1000 CAN netdevice driver
> 
> > [    2.092644] sja1000_platform sja1000_platform.0: sja1000_platform
> 
> > device registered (reg_base=c9800000, irq=192)
> 
> > ...
> 
> > [    5.051783] can: controller area network core (rev 20090105 abi 8)
> 
> > [    5.063383] NET: Registered protocol family 29
> 
> > [    5.072990] can: raw protocol (rev 20090105)
> 
> > [    5.082193] can: broadcast manager protocol (rev 20090105 t)
> 
> >
> 
> >
> 
> >> 	This looks like the installed iproute2 package is broken.
> 
> >
> 
> > I downloaded them from the given link in the documentation:
> 
> >
> 
> http://developer.toradex.com/files/toradex-
> dev/uploads/media/Colibri/Linux/Extra/can-packages.tar.bz2
> 
> > on the distribution in the image V2 of Toradex there is due to the
> 
> > hardfloat architecture no working package manager, so I have to
> > install
> 
> > them manually
> 
> >
> 
> >
> 
> >>	 ls -l `which ip`
> 
> >>	 to check if 'ip' is linked to the busybox binary.
> 
> >
> 
> > "Which ip" gives "/bin/ip" and is in my opinion linked to iproute2
> 
> 
> 
> What does "ip link help" list?

sh-4.2# ip link help
Usage: ip link add [link DEV] [ name ] NAME
                   [ txqueuelen PACKETS ]
                   [ address LLADDR ]
                   [ broadcast LLADDR ]
                   [ mtu MTU ]
                   type TYPE [ ARGS ]
       ip link delete DEV type TYPE [ ARGS ]

       ip link set { dev DEVICE | group DEVGROUP } [ { up | down } ]
	                  [ arp { on | off } ]
	                  [ dynamic { on | off } ]
	                  [ multicast { on | off } ]
	                  [ allmulticast { on | off } ]
	                  [ promisc { on | off } ]
	                  [ trailers { on | off } ]
	                  [ txqueuelen PACKETS ]
	                  [ name NEWNAME ]
	                  [ address LLADDR ]
	                  [ broadcast LLADDR ]
	                  [ mtu MTU ]
	                  [ netns PID ]
	                  [ netns NAME ]
			  [ alias NAME ]
	                  [ vf NUM [ mac LLADDR ]
				   [ vlan VLANID [ qos VLAN-QOS ] ]
				   [ rate TXRATE ] ] 
				   [ spoofchk { on | off} ] ] 
			  [ master DEVICE ]
			  [ nomaster ]
       ip link show [ DEVICE | group GROUP ]

TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | can | bridge }


Raphael

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: AW: AW: CAN Interface on Toradex Board
  2013-10-24  7:39       ` AW: " Spies, Raphael | BFFT GmbH
@ 2013-10-24 22:50         ` Mirza Krak
  2013-10-25 18:24         ` Wolfgang Grandegger
  1 sibling, 0 replies; 7+ messages in thread
From: Mirza Krak @ 2013-10-24 22:50 UTC (permalink / raw)
  To: Spies, Raphael | BFFT GmbH, 'Wolfgang Grandegger'
  Cc: 'linux-can@vger.kernel.org'

Hi.

I am also an user of Tegra 2 module from toradex and I haven't had any 
similar issues. Which eval board are you running? Have you tried the 
canconfig tool? Have you tried building iproute2 with the bitbake, this 
is what I have used without any issues. Don't know the state of the 
packages available for download.

And also why don't ask toradex support for this?

mvh
Mirza

*******************************************************************
Mirza Krak
Host Mobility AB
mirza.krak@hostmobility.com
Anders Personsgatan 12, 416 64 Göteborg
Sweden
www.hostmobility.com <http://www.hostmobility.com>
Direct: +46 31 31 32 704
Phone: +46 31 31 32 700
Fax: +46 31 80 67 51
Mobile: +46 730 28 06 22
*******************************************************************


On 2013-10-24 09:39, Spies, Raphael | BFFT GmbH wrote:
>
>> -----Ursprüngliche Nachricht-----
>> Von: linux-can-owner@vger.kernel.org [mailto:linux-can-
>> owner@vger.kernel.org] Im Auftrag von Wolfgang Grandegger
>> Gesendet: Donnerstag, 24. Oktober 2013 09:28
>> An: Spies, Raphael | BFFT GmbH
>> Cc: Oliver Hartkopp; linux-can@vger.kernel.org
>> Betreff: Re: AW: CAN Interface on Toradex Board
>>
>> On Thu, 24 Oct 2013 06:44:30 +0000, "Spies, Raphael | BFFT GmbH"
>>
>> <raphael.spies@bfft.de> wrote:
>>
>>> Hello everyone,
>>
>>>
>>
>>> thanks for the help so far..
>>
>>>
>>
>>>
>>
>>>> 	Can you see the can0 interface itself?
>>
>>>
>>
>>> Yes, I Can see the can interface. IP Link shows:
>>
>>>
>>
>>> 2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT
>> qlen
>>> 10
>>
>>>      link/can
>>
>>>      can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0
>>
>>>      bitrate 0 sample-point 0.000
>>
>>>      tq 0 prop-seg 0 phase-seg1 0 phase-seg2 0 sjw 0
>>
>>>      sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
>>
>>>      clock 12000000
>>
>>>
>>
>>>> 	when invoking 'dmesg' ?
>>
>>>
>>
>>> [    2.067414] CAN device driver interface
>>
>>> [    2.079435] sja1000 CAN netdevice driver
>>
>>> [    2.092644] sja1000_platform sja1000_platform.0: sja1000_platform
>>
>>> device registered (reg_base=c9800000, irq=192)
>>
>>> ...
>>
>>> [    5.051783] can: controller area network core (rev 20090105 abi 8)
>>
>>> [    5.063383] NET: Registered protocol family 29
>>
>>> [    5.072990] can: raw protocol (rev 20090105)
>>
>>> [    5.082193] can: broadcast manager protocol (rev 20090105 t)
>>
>>>
>>
>>>
>>
>>>> 	This looks like the installed iproute2 package is broken.
>>
>>>
>>
>>> I downloaded them from the given link in the documentation:
>>
>>>
>>
>> http://developer.toradex.com/files/toradex-
>> dev/uploads/media/Colibri/Linux/Extra/can-packages.tar.bz2
>>
>>> on the distribution in the image V2 of Toradex there is due to the
>>
>>> hardfloat architecture no working package manager, so I have to
>>> install
>>
>>> them manually
>>
>>>
>>
>>>
>>
>>>> 	 ls -l `which ip`
>>
>>>> 	 to check if 'ip' is linked to the busybox binary.
>>
>>>
>>
>>> "Which ip" gives "/bin/ip" and is in my opinion linked to iproute2
>>
>>
>>
>> What does "ip link help" list?
>
> sh-4.2# ip link help
> Usage: ip link add [link DEV] [ name ] NAME
>                     [ txqueuelen PACKETS ]
>                     [ address LLADDR ]
>                     [ broadcast LLADDR ]
>                     [ mtu MTU ]
>                     type TYPE [ ARGS ]
>         ip link delete DEV type TYPE [ ARGS ]
>
>         ip link set { dev DEVICE | group DEVGROUP } [ { up | down } ]
> 	                  [ arp { on | off } ]
> 	                  [ dynamic { on | off } ]
> 	                  [ multicast { on | off } ]
> 	                  [ allmulticast { on | off } ]
> 	                  [ promisc { on | off } ]
> 	                  [ trailers { on | off } ]
> 	                  [ txqueuelen PACKETS ]
> 	                  [ name NEWNAME ]
> 	                  [ address LLADDR ]
> 	                  [ broadcast LLADDR ]
> 	                  [ mtu MTU ]
> 	                  [ netns PID ]
> 	                  [ netns NAME ]
> 			  [ alias NAME ]
> 	                  [ vf NUM [ mac LLADDR ]
> 				   [ vlan VLANID [ qos VLAN-QOS ] ]
> 				   [ rate TXRATE ] ]
> 				   [ spoofchk { on | off} ] ]
> 			  [ master DEVICE ]
> 			  [ nomaster ]
>         ip link show [ DEVICE | group GROUP ]
>
> TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | can | bridge }
>
>
> Raphael
> N�����r��y���b�X��ǧv�^�)޺{.n�+����{�q���^n�r���z�\x1a��h����&��\x1e�G���h�\x03(�階�ݢj"��\x1a�^[m�����z�ޖ���f���h���~�mml==
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: CAN Interface on Toradex Board
  2013-10-24  7:39       ` AW: " Spies, Raphael | BFFT GmbH
  2013-10-24 22:50         ` Mirza Krak
@ 2013-10-25 18:24         ` Wolfgang Grandegger
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Grandegger @ 2013-10-25 18:24 UTC (permalink / raw)
  To: Spies, Raphael | BFFT GmbH; +Cc: 'linux-can@vger.kernel.org'

On 10/24/2013 09:39 AM, Spies, Raphael | BFFT GmbH wrote:
> 
>> -----Ursprüngliche Nachricht-----
>> Von: linux-can-owner@vger.kernel.org [mailto:linux-can-
>> owner@vger.kernel.org] Im Auftrag von Wolfgang Grandegger
>> Gesendet: Donnerstag, 24. Oktober 2013 09:28
>> An: Spies, Raphael | BFFT GmbH
>> Cc: Oliver Hartkopp; linux-can@vger.kernel.org
>> Betreff: Re: AW: CAN Interface on Toradex Board
>>
>> On Thu, 24 Oct 2013 06:44:30 +0000, "Spies, Raphael | BFFT GmbH"
>>
>> <raphael.spies@bfft.de> wrote:

...

>> What does "ip link help" list?
> 
> sh-4.2# ip link help
> Usage: ip link add [link DEV] [ name ] NAME
>                    [ txqueuelen PACKETS ]
>                    [ address LLADDR ]
>                    [ broadcast LLADDR ]
>                    [ mtu MTU ]
>                    type TYPE [ ARGS ]
>        ip link delete DEV type TYPE [ ARGS ]
> 
>        ip link set { dev DEVICE | group DEVGROUP } [ { up | down } ]
> 	                  [ arp { on | off } ]
> 	                  [ dynamic { on | off } ]
> 	                  [ multicast { on | off } ]
> 	                  [ allmulticast { on | off } ]
> 	                  [ promisc { on | off } ]
> 	                  [ trailers { on | off } ]
> 	                  [ txqueuelen PACKETS ]
> 	                  [ name NEWNAME ]
> 	                  [ address LLADDR ]
> 	                  [ broadcast LLADDR ]
> 	                  [ mtu MTU ]
> 	                  [ netns PID ]
> 	                  [ netns NAME ]
> 			  [ alias NAME ]
> 	                  [ vf NUM [ mac LLADDR ]
> 				   [ vlan VLANID [ qos VLAN-QOS ] ]
> 				   [ rate TXRATE ] ] 
> 				   [ spoofchk { on | off} ] ] 
> 			  [ master DEVICE ]
> 			  [ nomaster ]
>        ip link show [ DEVICE | group GROUP ]
> 
> TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | can | bridge }

Looks good and therefore I assume that "ip link set can0 type can help"
also works. Anyway, I think the tool does not match for some reason.
Could you try to build the "ip" program from the iproute2 suite [1]
yourself?

[1]
http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2

Wolfgang.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-25 18:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23 16:49 CAN Interface on Toradex Board Spies, Raphael | BFFT GmbH
2013-10-23 17:22 ` Oliver Hartkopp
2013-10-24  6:44   ` AW: " Spies, Raphael | BFFT GmbH
2013-10-24  7:28     ` Wolfgang Grandegger
2013-10-24  7:39       ` AW: " Spies, Raphael | BFFT GmbH
2013-10-24 22:50         ` Mirza Krak
2013-10-25 18:24         ` Wolfgang Grandegger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).