All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: CAN Data Transfer not happening at 1Mbps
       [not found] ` <4ED62A07621E9C41B8CB2F608655EF45053759D1-7aE7LFdIys/Tuj3VkTsHpK9mtlLuIFWGZeezCHUQhQ4@public.gmane.org>
@ 2012-02-02 14:50   ` Wolfgang Grandegger
  2012-02-03  4:11     ` [Socketcan-users] " Nikhil Kamath
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Grandegger @ 2012-02-02 14:50 UTC (permalink / raw)
  To: Nikhil Kamath; +Cc: socketcan-users-0fE9KPoRgkgATYTw5x5z8w, Linux-CAN

On 02/02/2012 03:24 PM, Nikhil Kamath wrote:
> Hi,
> I am having a i.Mx35 PDK board   running linux-2.6.35 kernel. CAN communication is done using the socket CAN driver  taken from the mainline kernel.

This means you are not using a mainline kernel, right? Are you using
Freescale's ltib linux-2.6.35 tree?

> Issue - Data transfer not happening at 1Mbps bitrate  , works fine on other bitrates.
> 
> Please help in resolving the issue.

- From what kernel version is the Flexcan driver derived?
- What does "dmesg" report when you load the driver?
- What does "ip -d -s link show can0" report after an unsuccessful
  transfer?
- What does "candump -e any,0:0,#FFFFFFFF" report while sending
  messages?

Wolfgang.

PS:

please do not use this mailing list any longer but send your questions
to the new "linux-can" mailing list address "linux-can-u79uwXL29TY76Z2rM5mHXA@public.gmane.org".
For subscription or mailing list archives please have a look to:

   http://vger.kernel.org/vger-lists.html#linux-can

Mail archives of the new linux-can mailing list can be found at:

   http://dir.gmane.org/gmane.linux.can
   http://marc.info/?l=linux-can&r=1&w=2

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

* RE: [Socketcan-users] CAN Data Transfer not happening at 1Mbps
  2012-02-02 14:50   ` CAN Data Transfer not happening at 1Mbps Wolfgang Grandegger
@ 2012-02-03  4:11     ` Nikhil Kamath
  2012-02-03  8:07       ` Wolfgang Grandegger
  0 siblings, 1 reply; 5+ messages in thread
From: Nikhil Kamath @ 2012-02-03  4:11 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: Linux-CAN

Hi Wolfgang,
Below are the details you asked for:

-This means you are not using a mainline kernel, right? Are you using Freescale's ltib linux-2.6.35 tree?
Yes , I am not using a mainline kernel , it's from the Freescale's LTIB tree.


- From what kernel version is the Flexcan driver derived?
I integrated the FlexCAN driver present in linux-2.6.38 mainline Kernel. I am not using the FlexCAN driver given by Freescale since it had issues , for e.g. I used to get the following error -RTNETLINK answers: Operation not supported.

- What does "dmesg" report when you load the driver?
flexcan netdevice driver
flexcan flexcan.0: device registered (reg_base=c8978000, irq=43)
flexcan flexcan.0: writing ctrl=0x25292004

-What does "ip -d -s link show can0" report after an unsuccessful
  transfer?
root@freescale ~$ ip -d -s link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
    link/can
    can state ERROR-PASSIVE restart-ms 0
    bitrate 1007575 sample-point 0.727
    tq 90 prop-seg 3 phase-seg1 4 phase-seg2 3 sjw 1
    flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
    clock 66500000
    re-started bus-errors arbit-lost error-warn error-pass bus-off
    0          0          0          1          1          0
    RX: bytes  packets  errors  dropped overrun mcast
    19         5        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    2          0        0       0       0       0


-What does "candump -e any,0:0,#FFFFFFFF" report while sending
  messages?
I received a message saying invalid option for 'e' in the above command, I tried using  'L' option instead to check if something gets logged , but at 1 Mbps logging was not happening.


Further , this is the log I got when I executed the following command -
root@freescale ~$ ip link set can0 up type can bitrate 1000000
flexcan flexcan.0: bitrate error 0.7%
flexcan flexcan.0: writing ctrl=0x051ae052

Thanks and regards,
Nikhil


-----Original Message-----
From: Wolfgang Grandegger [mailto:wg@grandegger.com]
Sent: Thursday, February 02, 2012 8:20 PM
To: Nikhil Kamath
Cc: socketcan-users@lists.berlios.de; Linux-CAN
Subject: Re: [Socketcan-users] CAN Data Transfer not happening at 1Mbps

On 02/02/2012 03:24 PM, Nikhil Kamath wrote:
> Hi,
> I am having a i.Mx35 PDK board   running linux-2.6.35 kernel. CAN communication is done using the socket CAN driver  taken from the mainline kernel.

This means you are not using a mainline kernel, right? Are you using Freescale's ltib linux-2.6.35 tree?

> Issue - Data transfer not happening at 1Mbps bitrate  , works fine on other bitrates.
>
> Please help in resolving the issue.

- From what kernel version is the Flexcan driver derived?
- What does "dmesg" report when you load the driver?
- What does "ip -d -s link show can0" report after an unsuccessful
  transfer?
- What does "candump -e any,0:0,#FFFFFFFF" report while sending
  messages?

Wolfgang.

PS:

please do not use this mailing list any longer but send your questions to the new "linux-can" mailing list address "linux-can@vger.kernel.org".
For subscription or mailing list archives please have a look to:

   http://vger.kernel.org/vger-lists.html#linux-can

Mail archives of the new linux-can mailing list can be found at:

   http://dir.gmane.org/gmane.linux.can
   http://marc.info/?l=linux-can&r=1&w=2


Larsen & Toubro Limited

www.larsentoubro.com

This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.

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

* Re: [Socketcan-users] CAN Data Transfer not happening at 1Mbps
  2012-02-03  4:11     ` [Socketcan-users] " Nikhil Kamath
@ 2012-02-03  8:07       ` Wolfgang Grandegger
  2012-02-03 15:46         ` Oliver Hartkopp
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Grandegger @ 2012-02-03  8:07 UTC (permalink / raw)
  To: Nikhil Kamath; +Cc: Linux-CAN

On 02/03/2012 05:11 AM, Nikhil Kamath wrote:
> Hi Wolfgang,
> Below are the details you asked for:
> 
> -This means you are not using a mainline kernel, right? Are you using Freescale's ltib linux-2.6.35 tree?
> Yes , I am not using a mainline kernel , it's from the Freescale's LTIB tree.
> 
> 
> - From what kernel version is the Flexcan driver derived?
> I integrated the FlexCAN driver present in linux-2.6.38 mainline Kernel. I am not using the FlexCAN driver given by Freescale since it had issues , for e.g. I used to get the following error -RTNETLINK answers: Operation not supported.

OK.

> - What does "dmesg" report when you load the driver?
> flexcan netdevice driver
> flexcan flexcan.0: device registered (reg_base=c8978000, irq=43)
> flexcan flexcan.0: writing ctrl=0x25292004
> 
> -What does "ip -d -s link show can0" report after an unsuccessful
>   transfer?
> root@freescale ~$ ip -d -s link show can0
> 2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
>     link/can
>     can state ERROR-PASSIVE restart-ms 0
>     bitrate 1007575 sample-point 0.727
>     tq 90 prop-seg 3 phase-seg1 4 phase-seg2 3 sjw 1
>     flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
>     clock 66500000
>     re-started bus-errors arbit-lost error-warn error-pass bus-off
>     0          0          0          1          1          0
>     RX: bytes  packets  errors  dropped overrun mcast
>     19         5        0       0       0       0
>     TX: bytes  packets  errors  dropped carrier collsns
>     2          0        0       0       0       0

The CAN controller has reached the error passive state. It seems that
there are electrical problems on the CAN bus, e.g. improper termination
or bit-timing.

> -What does "candump -e any,0:0,#FFFFFFFF" report while sending
>   messages?
> I received a message saying invalid option for 'e' in the above command, I tried using  'L' option instead to check if something gets logged , but at 1 Mbps logging was not happening.

Your version of candump seems to be quite old. Just try without "-e" but
the statistics above already points to the problem.

> Further , this is the log I got when I executed the following command -
> root@freescale ~$ ip link set can0 up type can bitrate 1000000
> flexcan flexcan.0: bitrate error 0.7%

That might make the trouble. The built-in algorithm to determine the
bit-timing parameters does not work well for your clock frequency. Try
to add "sjw=4" to the ip command.

Wolfgang.


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

* Re: [Socketcan-users] CAN Data Transfer not happening at 1Mbps
  2012-02-03  8:07       ` Wolfgang Grandegger
@ 2012-02-03 15:46         ` Oliver Hartkopp
       [not found]           ` <4ED62A07621E9C41B8CB2F608655EF450537D6D7@POCITMSEXMB02.LntUniverse.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Hartkopp @ 2012-02-03 15:46 UTC (permalink / raw)
  To: Wolfgang Grandegger, Nikhil Kamath; +Cc: Linux-CAN

On 03.02.2012 09:07, Wolfgang Grandegger wrote:

> On 02/03/2012 05:11 AM, Nikhil Kamath wrote:
>> Hi Wolfgang,
>> Below are the details you asked for:
>>
>> -This means you are not using a mainline kernel, right? Are you using Freescale's ltib linux-2.6.35 tree?
>> Yes , I am not using a mainline kernel , it's from the Freescale's LTIB tree.
>>
>>
>> - From what kernel version is the Flexcan driver derived?
>> I integrated the FlexCAN driver present in linux-2.6.38 mainline Kernel. I am not using the FlexCAN driver given by Freescale since it had issues , for e.g. I used to get the following error -RTNETLINK answers: Operation not supported.

(..)

>> Further , this is the log I got when I executed the following command -
>> root@freescale ~$ ip link set can0 up type can bitrate 1000000
>> flexcan flexcan.0: bitrate error 0.7%
> 
> That might make the trouble. The built-in algorithm to determine the
> bit-timing parameters does not work well for your clock frequency. Try
> to add "sjw=4" to the ip command.


Hi Wolfgang,

to set the sjw value with the ip tool is not implemented in
linux/drivers/net/can/dev.c in 2.6.38 nor in 2.6.35 ...

Maybe Nikhil can update all the stuff in linux/drivers/net/can from the
latest 3.2 kernel.

Alternatively the sjw setting support can be added to older versions by
applying this patch:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=2e1143742789463c00ed5e7f9bf471f2b707b493

Regards,
Oliver

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

* Re: [Socketcan-users] CAN Data Transfer not happening at 1Mbps
       [not found]           ` <4ED62A07621E9C41B8CB2F608655EF450537D6D7@POCITMSEXMB02.LntUniverse.com>
@ 2012-02-03 19:27             ` Wolfgang Grandegger
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Grandegger @ 2012-02-03 19:27 UTC (permalink / raw)
  To: Nikhil Kamath; +Cc: Oliver Hartkopp, Linux-CAN

On 02/03/2012 04:54 PM, Nikhil Kamath wrote:
> Thanks a lot. I will test by applying the patch .

For a quick try, you can also use (instead of "bitrate 1000000"):

  tq 90 prop-seg 3 phase-seg1 4 phase-seg2 3 sjw 4

Wolfgang.

> Regards,
> Nikhil
> ________________________________
> From: Oliver Hartkopp
> Sent: 03-02-2012 PM 09:19
> To: Wolfgang Grandegger; Nikhil Kamath
> Cc: Linux-CAN
> Subject: Re: [Socketcan-users] CAN Data Transfer not happening at 1Mbps
> 
> On 03.02.2012 09:07, Wolfgang Grandegger wrote:
> 
>> On 02/03/2012 05:11 AM, Nikhil Kamath wrote:
>>> Hi Wolfgang,
>>> Below are the details you asked for:
>>>
>>> -This means you are not using a mainline kernel, right? Are you using Freescale's ltib linux-2.6.35 tree?
>>> Yes , I am not using a mainline kernel , it's from the Freescale's LTIB tree.
>>>
>>>
>>> - From what kernel version is the Flexcan driver derived?
>>> I integrated the FlexCAN driver present in linux-2.6.38 mainline Kernel. I am not using the FlexCAN driver given by Freescale since it had issues , for e.g. I used to get the following error -RTNETLINK answers: Operation not supported.
> 
> (..)
> 
>>> Further , this is the log I got when I executed the following command -
>>> root@freescale ~$ ip link set can0 up type can bitrate 1000000
>>> flexcan flexcan.0: bitrate error 0.7%
>>
>> That might make the trouble. The built-in algorithm to determine the
>> bit-timing parameters does not work well for your clock frequency. Try
>> to add "sjw=4" to the ip command.
> 
> 
> Hi Wolfgang,
> 
> to set the sjw value with the ip tool is not implemented in
> linux/drivers/net/can/dev.c in 2.6.38 nor in 2.6.35 ...
> 
> Maybe Nikhil can update all the stuff in linux/drivers/net/can from the
> latest 3.2 kernel.
> 
> Alternatively the sjw setting support can be added to older versions by
> applying this patch:
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=2e1143742789463c00ed5e7f9bf471f2b707b493
> 
> Regards,
> Oliver
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> Larsen & Toubro Limited
> 
> www.larsentoubro.com
> 
> This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
> 


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

end of thread, other threads:[~2012-02-03 19:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4ED62A07621E9C41B8CB2F608655EF45053759D1@POCITMSEXMB02.LntUniverse.com>
     [not found] ` <4ED62A07621E9C41B8CB2F608655EF45053759D1-7aE7LFdIys/Tuj3VkTsHpK9mtlLuIFWGZeezCHUQhQ4@public.gmane.org>
2012-02-02 14:50   ` CAN Data Transfer not happening at 1Mbps Wolfgang Grandegger
2012-02-03  4:11     ` [Socketcan-users] " Nikhil Kamath
2012-02-03  8:07       ` Wolfgang Grandegger
2012-02-03 15:46         ` Oliver Hartkopp
     [not found]           ` <4ED62A07621E9C41B8CB2F608655EF450537D6D7@POCITMSEXMB02.LntUniverse.com>
2012-02-03 19:27             ` Wolfgang Grandegger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.