All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Michael Economides <mecono@gmail.com>
Cc: Oliver Hartkopp <socketcan@hartkopp.net>, linux-can@vger.kernel.org
Subject: Re: read() question from newbie
Date: Thu, 19 Apr 2012 10:39:51 +0200	[thread overview]
Message-ID: <4F8FCF57.70900@grandegger.com> (raw)
In-Reply-To: <CABHoAvmnqpHsjeNYZRh-T5dvNYaENXxGFtwN7=_15rmGJTMWcQ@mail.gmail.com>

On 04/19/2012 01:10 AM, Michael Economides wrote:
> Hi Wolfgang,
> 
> I checked and the Freescale BSP I'm using is based on Linux version
> 2.6.24.7-rt21

Do you need rt? Anyway, IIRC, the MPC5121EADS board is supported by the
mainline kernel:

http://lxr.linux.no/#linux+v3.3.2/arch/powerpc/boot/dts/mpc5121ads.dts

There is no need to use the old kernel from Freescale's LTIB
distribution, which uses a special and old Socket-CAN implementation.

Wolfgang.


> On Wed, Apr 18, 2012 at 1:32 PM, Wolfgang Grandegger <wg@grandegger.com> wrote:
>> Hi Michael,
>>
>> On 04/18/2012 10:13 PM, Michael Economides wrote:
>>> Hi Oliver,
>>>
>>> Looking on my scope, it does seem like the baudrate is a little off.
>>>
>>> Here are the commands I use to set up my CAN interface on my Linux board:
>>>
>>> insmod -m candev;
>>
>> Oops, you are using a very very old version of insmod. Are you using
>> Linux 2.4.x? I do remember using "-m" with old Linux 2.4 distributions.
>>
>>> insmod -m mscan-mpc52xx;
>>> insmod -m can;
>>> insmod -m can-raw
>>> ifconfig can0 up;
>>>
>>> ./cantest can0 baud 1000000;
>>>
>>> This "cantest" program uses:
>>>
>>>  ifr.ifr_ifru.ifru_ivalue = baudrate;
>>> ret = ioctl(s, SIOCSCANBAUDRATE, &ifr);
>>>
>>> to set the baudrate.  But it seems from reading other discussions,
>>> that this is not the correct way to set baud rate.
>>
>> That's right, in case you are using a recent kernel version.
>>
>>> I am using the MPC5121 from Freescale, in case that is relevant.
>>
>> What Linux kernel version do you use? Where did you get the drivers
>> above from?
>>
>> Wolfgang.
>>
>>> On Mon, Apr 16, 2012 at 11:08 PM, Oliver Hartkopp
>>> <socketcan@hartkopp.net> wrote:
>>>> On 17.04.2012 06:16, Michael Economides wrote:
>>>>
>>>>
>>>>>>
>>>>>> I assume there is a CAN bus problem:
>>>>>>
>>>>>> - wiring (CAN_L/CAN_H)
>>>>>> - correct CAN termination (2x 120 Ohms)
>>>>>> - different bitrate
>>>>>>
>>>>>
>>>>> I think you are right, but I have checked that, it looks ok.  I will
>>>>> check again.
>>>>>
>>>>> I am using a PCAN USB adapter, and the PCAN software says there is an
>>>>> "acknowledge error" when it sends a frame to my Linux board.
>>>>
>>>>
>>>> This is an indication for a missing counterpart CAN node:
>>>>
>>>> - Wrong connection wiring
>>>> - Wrong termination
>>>> - Wrong bitrate
>>>>
>>>>>
>>>>> When the Linux board tries to send a frame to PCAN, the PCAN software
>>>>> says "form error acknowledge delimiter".
>>>>>
>>>>> It seems this is the same error in both cases, just worded differently.
>>>>
>>>>
>>>> Yes. But this means the same regarding the obvious problems.
>>>>
>>>>>
>>>>> In your opinion, is this most likely a hardware issue?  Or is there
>>>>> still some way I could be doing something wrong at the software level?
>>>>
>>>>
>>>> Did you swap CAN_H / CAN_L ??
>>>>
>>>> It's definitely one of the three points above. No SW problem ...
>>>>
>>>> Try to add a third CAN node - if you have one.
>>>>
>>>> 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
>>>
>>>
>>
> 
> 


  reply	other threads:[~2012-04-19  8:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABHoAvngDnUfh6w7NXQksrmeLq52_cRp809rFZ+HriwYpZqo9w@mail.gmail.com>
2012-03-02 22:09 ` read() question from newbie Michael Economides
2012-03-03  9:05   ` Oliver Hartkopp
2012-03-05 17:49     ` Michael Economides
2012-03-05 22:19       ` Oliver Hartkopp
2012-03-05 22:22         ` Oliver Hartkopp
2012-03-06 18:53           ` Michael Economides
2012-03-06 20:14             ` Oliver Hartkopp
2012-04-17  4:16               ` Michael Economides
2012-04-17  6:08                 ` Oliver Hartkopp
2012-04-18 20:13                   ` Michael Economides
2012-04-18 20:32                     ` Wolfgang Grandegger
2012-04-18 23:10                       ` Michael Economides
2012-04-19  8:39                         ` Wolfgang Grandegger [this message]
2012-04-18 20:59                     ` Marc Kleine-Budde
2012-04-18 21:21                       ` Michael Economides
2012-04-19  7:27                         ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F8FCF57.70900@grandegger.com \
    --to=wg@grandegger.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mecono@gmail.com \
    --cc=socketcan@hartkopp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.