All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: David Wiebe <dwiebe2@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] more questions
Date: Mon, 27 Jun 2011 13:04:56 +0200	[thread overview]
Message-ID: <4E0863D8.2090402@domain.hid> (raw)
In-Reply-To: <4E07DF44.1060204@domain.hid>

On 06/27/2011 03:39 AM, David Wiebe wrote:
> I'm trying to get an spi port on the beagleboard to work in realtime.
> I didn't know there were other ioctl's. I wrote a program with ioctl, 
> tested it to make sure it worked, which it did, then changed ioctl's to 
> rt_dev_ioctl's in hopes that doing so would enable real time behaviour. 
> The program with rt_dev_ioctl's did not run as desired(no spi). I guess 
> I can't simply change ioctl's with rt_dev_ioctl's to enable real time 
> functionality? Do I have to patch xenomai to enable spi or something?

Hi,

What you have to do is to write a driver for whatever SPI controller you
are using, using the RTDM API.

>> - which driver you have written/loaded to implement this ioctl
> I thought changing ioctl for rt_dev_ioctl was all that was required to 
> implement this device in realtime mode. This device is an spi port.

No.

>> - what you mean by "my program does not perform as it should", what is
>> the return value of this rt_dev_ioctl which is supposed to work?
>>
> I watch my oscilloscope for activity on the spi port. regular ioctl 
> worked, rt_dev_ioctl did not. Both programs ran but only one worked.

There are other ways to debug software than an oscilloscope. Looking at
the functions return values when they have one is a good start.

>>> #2. rtnet. I wrote a test snippet of code to test the ethernet part.
>>> Prepended the appropriate functions with rt_dev_ and same results as in #1.
>>>
>>> I assume that if something wasn't in the library I would get compiler
>>> errors and if the code running on the beagleboard  was bad, I would get
>>> run time errors. I have seen neither.
>> Again, what driver are you trying to use? What happens when you try and
>> configure it?
>>
> So I have to patch the ethernet driver in order for it to work? I though 
> that was taken care of when I patched the kernel with xenomai.

You do not have to patch anything. Again, what you lack is probably an
ethernet driver, or simply to load and configure the rtnet driver for
the hardware you have, exactly like you do with Linux.

If you are going to write drivers, I really suggest you read "Linux
device drivers", then read the RTDM skin documentation to understand the
RTDM API. Note that most of the time, you can "port" a Linux driver to
RTDM or Rtnet, there is even a guide on how to do so for network drivers
in rtnet sources.

-- 
                                                                Gilles.


  reply	other threads:[~2011-06-27 11:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24 16:44 [Xenomai-help] booting suresh reddy
2011-06-24 17:15 ` Gilles Chanteperdrix
2011-06-26  3:17   ` [Xenomai-help] more questions David Wiebe
2011-06-26 15:17     ` Gilles Chanteperdrix
2011-06-27  1:39       ` David Wiebe
2011-06-27 11:04         ` Gilles Chanteperdrix [this message]
2011-06-27 18:33           ` David Wiebe
2011-06-27 21:37             ` [Xenomai-help] More questions - spi/ethernet David Wiebe
2011-06-27 21:41               ` Gilles Chanteperdrix
2011-06-28  4:42                 ` David Wiebe
2011-06-28  8:33                   ` Gilles Chanteperdrix

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=4E0863D8.2090402@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=dwiebe2@domain.hid \
    --cc=xenomai@xenomai.org \
    /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.