* [Xenomai-help] Problem accesing I2C without using Linux kernel
@ 2011-06-19 13:16 Andrey Nechypurenko
2011-06-19 13:20 ` Gilles Chanteperdrix
0 siblings, 1 reply; 15+ messages in thread
From: Andrey Nechypurenko @ 2011-06-19 13:16 UTC (permalink / raw)
To: xenomai
Hi,
I am working on real-time control application using BeagleBoard
and Xenomai. Some sensors are connected to the second i2c bus. It
is necessary to collect sensor data strictly periodically and
that is why I would prefer to query the sensors from xenomai
thread.
I can read sensor data from user space using kernel interface,
i.e. via /dev/i2c-2 file. However, as I understand, doing it from
the xenomai thread will lead to the context switch and degrade
the real-time performance (introduce unpredictable delays and all
other badnesses :-) ). That is why I decide to try to access
OMAP's i2c controller directly without using kernel driver and
/dev file system.
For this purposes, I simply poke the relevant parts from u-boot
sources and thought that it should work. Unfortunately it is
not. I am getting the "Bus error" message which is coming not
from my test program and then the program quits.
I am suspecting that there is some kind of conflict with
kernel. I am not experienced enough with kernel internals and
that is why the questions I would like to ask are: a) whether my
assumption about possible conflict with kernel is reasonable, b)
would it help to recompile the kernel with i2c support completely
disabled and c) if such kernel will work at all on BB? Please
note, that for this application I do not need any power
management and no display output.
Just for the sake of completeness, and if somebody is interested
in more details, here is the brief outline of what I did and how
it fails. I was doing the following steps:
1. Open /dev/mem and memory map the I2C 2 region at
0x48072000 (as defined in the TRM which is in meanwhile become
my most popular reading :-) ):
fd = open("/dev/mem", O_RDWR | O_SYNC);
i2c_base = mmap(NULL, sizeof(i2c_base),
PROT_READ | PROT_WRITE,
MAP_SHARED, fd, I2C_DEFAULT_BASE);
Where I2C_DEFAULT_BASE is 0x48072000 and i2c_base is the
structure with corresponding controller registers, i.e.:
struct i2c {
unsigned short rev; /* 0x00 */
unsigned short res1;
unsigned short ie; /* 0x04 */
unsigned short res2;
unsigned short stat; /* 0x08 */
. . .
2. Try to read the status of the i2c controller:
if(readw(&i2c_base->con) & I2C_CON_EN)
This is the very first attempt to read from the mapped memory
and this call fails resulting in the "Bus error" message printed
on the console and application seams to be killed. Here the
readw() function is just a define which simply returns the
content of the memory address passed as parameter. But just to
exclude possible mistakes here I was even trying to access the
memory directly:
if(i2c_base->con & I2C_CON_EN)
But even this line gives the same "Bus error" message. So it
seams like I can not access this memory at all.
I would really appreciate if someone can provide some
explanations and suggestions about possible reasons why my
approach fails and what I can do to fix it.
Thank you,
Andrey.
---------------------------------
http://veter-project.blogspot.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Problem accesing I2C without using Linux kernel
2011-06-19 13:16 [Xenomai-help] Problem accesing I2C without using Linux kernel Andrey Nechypurenko
@ 2011-06-19 13:20 ` Gilles Chanteperdrix
[not found] ` <BANLkTinVUd-R1cpD+40MGZZckzGhwrqRvw@domain.hid>
0 siblings, 1 reply; 15+ messages in thread
From: Gilles Chanteperdrix @ 2011-06-19 13:20 UTC (permalink / raw)
To: Andrey Nechypurenko; +Cc: xenomai
On 06/19/2011 03:16 PM, Andrey Nechypurenko wrote:
> Hi,
>
> I am working on real-time control application using BeagleBoard
> and Xenomai. Some sensors are connected to the second i2c bus. It
> is necessary to collect sensor data strictly periodically and
> that is why I would prefer to query the sensors from xenomai
> thread.
>
> I can read sensor data from user space using kernel interface,
> i.e. via /dev/i2c-2 file. However, as I understand, doing it from
> the xenomai thread will lead to the context switch and degrade
> the real-time performance (introduce unpredictable delays and all
> other badnesses :-) ). That is why I decide to try to access
> OMAP's i2c controller directly without using kernel driver and
> /dev file system.
>
> For this purposes, I simply poke the relevant parts from u-boot
> sources and thought that it should work. Unfortunately it is
> not. I am getting the "Bus error" message which is coming not
> from my test program and then the program quits.
>
> I am suspecting that there is some kind of conflict with
> kernel. I am not experienced enough with kernel internals and
> that is why the questions I would like to ask are: a) whether my
> assumption about possible conflict with kernel is reasonable, b)
> would it help to recompile the kernel with i2c support completely
> disabled and c) if such kernel will work at all on BB? Please
> note, that for this application I do not need any power
> management and no display output.
>
> Just for the sake of completeness, and if somebody is interested
> in more details, here is the brief outline of what I did and how
> it fails. I was doing the following steps:
>
> 1. Open /dev/mem and memory map the I2C 2 region at
> 0x48072000 (as defined in the TRM which is in meanwhile become
> my most popular reading :-) ):
>
> fd = open("/dev/mem", O_RDWR | O_SYNC);
> i2c_base = mmap(NULL, sizeof(i2c_base),
> PROT_READ | PROT_WRITE,
> MAP_SHARED, fd, I2C_DEFAULT_BASE);
What is the value of i2c_base here? If it is MAP_FAILED, then mmap
failed. And one reason for failing would be that sizeof(i2c_base) is not
a multiple of the page size.
--
Gilles.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Problem accesing I2C without using Linux kernel
[not found] ` <BANLkTinVUd-R1cpD+40MGZZckzGhwrqRvw@domain.hid>
@ 2011-06-19 13:44 ` Gilles Chanteperdrix
2011-06-19 13:54 ` Gilles Chanteperdrix
2011-06-19 14:06 ` Andrey Nechypurenko
0 siblings, 2 replies; 15+ messages in thread
From: Gilles Chanteperdrix @ 2011-06-19 13:44 UTC (permalink / raw)
To: Andrey Nechypurenko; +Cc: Xenomai help
On 06/19/2011 03:34 PM, Andrey Nechypurenko wrote:
> Hi Gilles,
>
>>> fd = open("/dev/mem", O_RDWR | O_SYNC);
>>> i2c_base = mmap(NULL, sizeof(i2c_base),
>>> PROT_READ | PROT_WRITE,
>>> MAP_SHARED, fd, I2C_DEFAULT_BASE);
>>
>> What is the value of i2c_base here? If it is MAP_FAILED, then mmap
>> failed. And one reason for failing would be that sizeof(i2c_base) is not
>> a multiple of the page size.
>
> In actual code I do check for the errors like below and it seams like
> memory is mapped without errors:
>
> if(i2c_base == NULL)
> {
> fd = open("/dev/mem", O_RDWR | O_SYNC);
> if(fd < 0)
> {
> fprintf(stderr, "Could not open memory\n");
> return;
> }
>
> i2c_base =
> (volatile struct i2c *)mmap(NULL, sizeof(i2c_base),
> PROT_READ | PROT_WRITE,
> MAP_SHARED, fd, I2C_DEFAULT_BASE);
> if(i2c_base == MAP_FAILED)
> {
> fprintf(stderr, "Memory Mapping failed\n");
> close(fd);
> return;
> }
> }
>
> Regarding the size of the memory mapped block - i2c_base is a pointer
> and that is why, the mmap invocation above is incorrect. It should be
> mmap(NULL, sizeof(struct i2c). This is a typo resulted by multiple
> experiments I was doing. sizeof(struct i2c) is 64 and event with this
> value, the same "Bus error" message is printed and the application
> quits.
Ok. I would pass the size of an entire page anyway, I do not think
mapping anything not aligned on a page boundary makes sense.
If it still fails, enable CONFIG_DEBUG_USER in kernel configuration,
pass user_debug=29 on kernel command line, and post the user debug log
upon failure, then the disassembly of the function where the SIGBUS happens.
Note that this mailing list is probably not the best place to ask your
question, since we mostly talk about Xenomai here, and your issue does
not seem to have anything to do with Xenomai.
Please keep the discussion public.
--
Gilles.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Problem accesing I2C without using Linux kernel
2011-06-19 13:44 ` Gilles Chanteperdrix
@ 2011-06-19 13:54 ` Gilles Chanteperdrix
2011-06-19 14:06 ` Andrey Nechypurenko
1 sibling, 0 replies; 15+ messages in thread
From: Gilles Chanteperdrix @ 2011-06-19 13:54 UTC (permalink / raw)
To: Andrey Nechypurenko; +Cc: Xenomai help
On 06/19/2011 03:44 PM, Gilles Chanteperdrix wrote:
> On 06/19/2011 03:34 PM, Andrey Nechypurenko wrote:
>> Hi Gilles,
>>
>>>> fd = open("/dev/mem", O_RDWR | O_SYNC);
>>>> i2c_base = mmap(NULL, sizeof(i2c_base),
>>>> PROT_READ | PROT_WRITE,
>>>> MAP_SHARED, fd, I2C_DEFAULT_BASE);
>>>
>>> What is the value of i2c_base here? If it is MAP_FAILED, then mmap
>>> failed. And one reason for failing would be that sizeof(i2c_base) is not
>>> a multiple of the page size.
>>
>> In actual code I do check for the errors like below and it seams like
>> memory is mapped without errors:
>>
>> if(i2c_base == NULL)
>> {
>> fd = open("/dev/mem", O_RDWR | O_SYNC);
>> if(fd < 0)
>> {
>> fprintf(stderr, "Could not open memory\n");
>> return;
>> }
>>
>> i2c_base =
>> (volatile struct i2c *)mmap(NULL, sizeof(i2c_base),
>> PROT_READ | PROT_WRITE,
>> MAP_SHARED, fd, I2C_DEFAULT_BASE);
>> if(i2c_base == MAP_FAILED)
>> {
>> fprintf(stderr, "Memory Mapping failed\n");
>> close(fd);
>> return;
>> }
>> }
>>
>> Regarding the size of the memory mapped block - i2c_base is a pointer
>> and that is why, the mmap invocation above is incorrect. It should be
>> mmap(NULL, sizeof(struct i2c). This is a typo resulted by multiple
>> experiments I was doing. sizeof(struct i2c) is 64 and event with this
>> value, the same "Bus error" message is printed and the application
>> quits.
>
> Ok. I would pass the size of an entire page anyway, I do not think
> mapping anything not aligned on a page boundary makes sense.
>
> If it still fails, enable CONFIG_DEBUG_USER in kernel configuration,
> pass user_debug=29 on kernel command line, and post the user debug log
> upon failure, then the disassembly of the function where the SIGBUS happens.
>
> Note that this mailing list is probably not the best place to ask your
> question, since we mostly talk about Xenomai here, and your issue does
> not seem to have anything to do with Xenomai.
>
> Please keep the discussion public.
Second stupid questions: are you sure all the clocks needed to get that
I2C module running are enabled?
--
Gilles.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Problem accesing I2C without using Linux kernel
2011-06-19 13:44 ` Gilles Chanteperdrix
2011-06-19 13:54 ` Gilles Chanteperdrix
@ 2011-06-19 14:06 ` Andrey Nechypurenko
2011-06-19 14:11 ` Gilles Chanteperdrix
1 sibling, 1 reply; 15+ messages in thread
From: Andrey Nechypurenko @ 2011-06-19 14:06 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Xenomai help
> Ok. I would pass the size of an entire page anyway, I do not think
> mapping anything not aligned on a page boundary makes sense.
>
> If it still fails, enable CONFIG_DEBUG_USER in kernel configuration,
> pass user_debug=29 on kernel command line, and post the user debug log
> upon failure, then the disassembly of the function where the SIGBUS happens.
Ok, Thank you for suggestions! I'll try it.
> Note that this mailing list is probably not the best place to ask your
> question, since we mostly talk about Xenomai here, and your issue does
> not seem to have anything to do with Xenomai.
I understand. Do you have an idea what list might be more appropriate
for it? I did also post the same question to the BeagleBoard mail
list.
> Please keep the discussion public.
Sorry, just hit "Reply" instead of "Reply to all" :-) .
> Second stupid questions: are you sure all the clocks needed to get that
> I2C module running are enabled?
The module works. I think kernel configured it properly because I can
use user space utility for example i2cdetect and see my sensors
detected on the bus. At the moment where I was trying to read the
status I did not made any reconfiguration before. So my assumption was
that the module is already configured properly and at least an attempt
to read the status should succede.
Thank you,
Andrey.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Problem accesing I2C without using Linux kernel
2011-06-19 14:06 ` Andrey Nechypurenko
@ 2011-06-19 14:11 ` Gilles Chanteperdrix
2011-06-19 14:21 ` Andrey Nechypurenko
0 siblings, 1 reply; 15+ messages in thread
From: Gilles Chanteperdrix @ 2011-06-19 14:11 UTC (permalink / raw)
To: Andrey Nechypurenko; +Cc: Xenomai help
On 06/19/2011 04:06 PM, Andrey Nechypurenko wrote:
>> Note that this mailing list is probably not the best place to ask your
>> question, since we mostly talk about Xenomai here, and your issue does
>> not seem to have anything to do with Xenomai.
>
> I understand. Do you have an idea what list might be more appropriate
> for it? I did also post the same question to the BeagleBoard mail
> list.
Ok, maybe you will get better support there. There may also be some IRC
channel somewhere, where you can get a more interactive help.
>> Second stupid questions: are you sure all the clocks needed to get that
>> I2C module running are enabled?
>
> The module works. I think kernel configured it properly because I can
> use user space utility for example i2cdetect and see my sensors
> detected on the bus. At the moment where I was trying to read the
> status I did not made any reconfiguration before. So my assumption was
> that the module is already configured properly and at least an attempt
> to read the status should succede.
To be sure of that, you would have to be sure that the clocks are not
disabled when the device is not opened. To check this, either check the
kernel sources, or try and open the i2c device, and keep it open before
you mmap /dev/mem
--
Gilles.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Problem accesing I2C without using Linux kernel
2011-06-19 14:11 ` Gilles Chanteperdrix
@ 2011-06-19 14:21 ` Andrey Nechypurenko
2011-06-19 16:57 ` Gilles Chanteperdrix
0 siblings, 1 reply; 15+ messages in thread
From: Andrey Nechypurenko @ 2011-06-19 14:21 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Xenomai help
>> The module works. I think kernel configured it properly because I can
>> use user space utility for example i2cdetect and see my sensors
>> detected on the bus. At the moment where I was trying to read the
>> status I did not made any reconfiguration before. So my assumption was
>> that the module is already configured properly and at least an attempt
>> to read the status should succede.
>
> To be sure of that, you would have to be sure that the clocks are not
> disabled when the device is not opened. To check this, either check the
> kernel sources, or try and open the i2c device, and keep it open before
> you mmap /dev/mem
Just tried your suggestion but unfortunately it does not change enything.
Thank you!
Andrey.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Problem accesing I2C without using Linux kernel
2011-06-19 14:21 ` Andrey Nechypurenko
@ 2011-06-19 16:57 ` Gilles Chanteperdrix
2011-06-19 20:24 ` Andrey Nechypurenko
0 siblings, 1 reply; 15+ messages in thread
From: Gilles Chanteperdrix @ 2011-06-19 16:57 UTC (permalink / raw)
To: Andrey Nechypurenko; +Cc: Xenomai help
On 06/19/2011 04:21 PM, Andrey Nechypurenko wrote:
>>> The module works. I think kernel configured it properly because I can
>>> use user space utility for example i2cdetect and see my sensors
>>> detected on the bus. At the moment where I was trying to read the
>>> status I did not made any reconfiguration before. So my assumption was
>>> that the module is already configured properly and at least an attempt
>>> to read the status should succede.
>>
>> To be sure of that, you would have to be sure that the clocks are not
>> disabled when the device is not opened. To check this, either check the
>> kernel sources, or try and open the i2c device, and keep it open before
>> you mmap /dev/mem
>
> Just tried your suggestion but unfortunately it does not change enything.
>
There may be (at least) two possible reasons:
- the clocks are disabled, you need to check the kernel source to know
if that is the case;
- or the compiler generated a byte access to the 32 bits register, not
knowing the alignment of mmap return value, you need to send the
disassembly as I requested to know if that is the case.
--
Gilles.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Problem accesing I2C without using Linux kernel
2011-06-19 16:57 ` Gilles Chanteperdrix
@ 2011-06-19 20:24 ` Andrey Nechypurenko
2011-06-20 0:00 ` [Xenomai-help] Beagleboard Xenomai David Wiebe
0 siblings, 1 reply; 15+ messages in thread
From: Andrey Nechypurenko @ 2011-06-19 20:24 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Xenomai help
The problem disapears when I run the custom patched kernel with
removed i2c bus 2 initialization. In this case there is no "Bus error"
message and my test program works just fine. So I conclude that it was
indeed some kind of conflict between kernel and my code trying to talk
directly to the i2c controller.
Once again thank you Gilles for prompt response and suggestions!
Regards,
Andrey.
On Sun, Jun 19, 2011 at 6:57 PM, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:
> On 06/19/2011 04:21 PM, Andrey Nechypurenko wrote:
>>>> The module works. I think kernel configured it properly because I can
>>>> use user space utility for example i2cdetect and see my sensors
>>>> detected on the bus. At the moment where I was trying to read the
>>>> status I did not made any reconfiguration before. So my assumption was
>>>> that the module is already configured properly and at least an attempt
>>>> to read the status should succede.
>>>
>>> To be sure of that, you would have to be sure that the clocks are not
>>> disabled when the device is not opened. To check this, either check the
>>> kernel sources, or try and open the i2c device, and keep it open before
>>> you mmap /dev/mem
>>
>> Just tried your suggestion but unfortunately it does not change enything.
>>
>
> There may be (at least) two possible reasons:
> - the clocks are disabled, you need to check the kernel source to know
> if that is the case;
> - or the compiler generated a byte access to the 32 bits register, not
> knowing the alignment of mmap return value, you need to send the
> disassembly as I requested to know if that is the case.
>
> --
> Gilles.
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Xenomai-help] Beagleboard Xenomai
2011-06-19 20:24 ` Andrey Nechypurenko
@ 2011-06-20 0:00 ` David Wiebe
2011-06-20 5:02 ` [Xenomai-help] Compiling program with xenomai support David Wiebe
0 siblings, 1 reply; 15+ messages in thread
From: David Wiebe @ 2011-06-20 0:00 UTC (permalink / raw)
To: xenomai
Hello all,
I compiled 2.6.35.9 with the Xenomai patch and am running it on my
beagleboard C4.
David
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Xenomai-help] Compiling program with xenomai support
2011-06-20 0:00 ` [Xenomai-help] Beagleboard Xenomai David Wiebe
@ 2011-06-20 5:02 ` David Wiebe
2011-06-20 7:14 ` Gilles Chanteperdrix
0 siblings, 1 reply; 15+ messages in thread
From: David Wiebe @ 2011-06-20 5:02 UTC (permalink / raw)
To: xenomai
Hello,
I'm having a bit of trouble compiling a my test program and was
wondering if anyone could shed a bit of light on my troubles. I'm using
code sourcery as my cross compiler.
<START>
arm-none-linux-gnueabi-gcc test2.c -o test2 -I
/home/david/xenomai-2.5.6.test/include/
In file included from
/home/david/xenomai-2.5.6.test/include/nucleus/thread.h:25,
from
/home/david/xenomai-2.5.6.test/include/nucleus/sched.h:31,
from
/home/david/xenomai-2.5.6.test/include/native/task.h:25,
from test2.c:11:
/home/david/xenomai-2.5.6.test/include/nucleus/types.h:41:32: error:
asm/xenomai/system.h: No such file or directory
In file included from
/home/david/xenomai-2.5.6.test/include/nucleus/thread.h:25,
from
/home/david/xenomai-2.5.6.test/include/nucleus/sched.h:31,
from
/home/david/xenomai-2.5.6.test/include/native/task.h:25,
from test2.c:11:
/home/david/xenomai-2.5.6.test/include/nucleus/types.h:103: error:
expected '=', ',', ';', 'asm' or '__attribute__' before 'xnflags_t'
<END>
I cannot find a directory in any of the relevant working directories
with the pathnames the errors mention.
Thanks,
David
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Compiling program with xenomai support
2011-06-20 5:02 ` [Xenomai-help] Compiling program with xenomai support David Wiebe
@ 2011-06-20 7:14 ` Gilles Chanteperdrix
2011-06-20 8:06 ` David Wiebe
0 siblings, 1 reply; 15+ messages in thread
From: Gilles Chanteperdrix @ 2011-06-20 7:14 UTC (permalink / raw)
To: David Wiebe; +Cc: xenomai
On 06/20/2011 07:02 AM, David Wiebe wrote:
> /home/david/xenomai-2.5.6.test/include/nucleus/types.h:41:32: error:
> asm/xenomai/system.h: No such file or directory
Could you show us the arguments you pass to Xenomai "configure" script?
Normally, the "asm" directory is created by Xenomai install rule.
Posting your test code would also help us try and reproduce this issue.
--
Gilles.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Compiling program with xenomai support
2011-06-20 7:14 ` Gilles Chanteperdrix
@ 2011-06-20 8:06 ` David Wiebe
2011-06-20 11:13 ` Gilles Chanteperdrix
0 siblings, 1 reply; 15+ messages in thread
From: David Wiebe @ 2011-06-20 8:06 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
On 11-06-20 12:14 AM, Gilles Chanteperdrix wrote:
> On 06/20/2011 07:02 AM, David Wiebe wrote:
>> /home/david/xenomai-2.5.6.test/include/nucleus/types.h:41:32: error:
>> asm/xenomai/system.h: No such file or directory
> Could you show us the arguments you pass to Xenomai "configure" script?
> Normally, the "asm" directory is created by Xenomai install rule.
>
> Posting your test code would also help us try and reproduce this issue.
>
Of course!
<test2.c>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <signal.h>
#include <sys/mman.h>
#include <native/task.h>
#include <native/timer.h>
#define TIMESLEEP 1000000000 /* 1 sec */
int main(void)
{
}
<!test2.c>
<The configure script>
./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi
--enable-arm-mach=omap3
<!The configure script>
<The make install>
make DESTDIR=/home/david/sdir/ install
<!The make install>
Thanks!
David
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Compiling program with xenomai support
2011-06-20 8:06 ` David Wiebe
@ 2011-06-20 11:13 ` Gilles Chanteperdrix
2011-06-20 19:04 ` David Wiebe
0 siblings, 1 reply; 15+ messages in thread
From: Gilles Chanteperdrix @ 2011-06-20 11:13 UTC (permalink / raw)
To: David Wiebe; +Cc: xenomai
On 06/20/2011 10:06 AM, David Wiebe wrote:
> On 11-06-20 12:14 AM, Gilles Chanteperdrix wrote:
>> On 06/20/2011 07:02 AM, David Wiebe wrote:
>>> /home/david/xenomai-2.5.6.test/include/nucleus/types.h:41:32: error:
>>> asm/xenomai/system.h: No such file or directory
>> Could you show us the arguments you pass to Xenomai "configure" script?
>> Normally, the "asm" directory is created by Xenomai install rule.
>>
>> Posting your test code would also help us try and reproduce this issue.
>>
> Of course!
>
> <test2.c>
> #include <stdio.h>
> #include <stdlib.h>
> #include <fcntl.h>
> #include <unistd.h>
> #include <sys/stat.h>
> #include <sys/types.h>
> #include <sys/ioctl.h>
> #include <signal.h>
> #include <sys/mman.h>
>
> #include <native/task.h>
> #include <native/timer.h>
>
> #define TIMESLEEP 1000000000 /* 1 sec */
>
>
> int main(void)
> {
> }
> <!test2.c>
>
> <The configure script>
> ./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi
> --enable-arm-mach=omap3
> <!The configure script>
>
> <The make install>
> make DESTDIR=/home/david/sdir/ install
> <!The make install>
Then, the header should be found under
/home/david/sdir/usr/xenomai/include/xenomai
In order to compile your test you should use xeno-config.
Typing, for instance:
CFLAGS=`DESTDIR=/home/david/sdir /home/david/sdir/usr/xenomai/bin/bin/xeno-config --skin native --cflags`
LDFLAGS=`DESTDIR=/home/david/sdir /home/david/sdir/usr/xenomai/bin/bin/xeno-config --skin native --ldflags`
arm-none-linux-gnueabi-gcc -o test2 $CFLAGS test2.c $LDFLAGS
--
Gilles.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Xenomai-help] Compiling program with xenomai support
2011-06-20 11:13 ` Gilles Chanteperdrix
@ 2011-06-20 19:04 ` David Wiebe
0 siblings, 0 replies; 15+ messages in thread
From: David Wiebe @ 2011-06-20 19:04 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
On 11-06-20 04:13 AM, Gilles Chanteperdrix wrote:
> On 06/20/2011 10:06 AM, David Wiebe wrote:
>> On 11-06-20 12:14 AM, Gilles Chanteperdrix wrote:
>>> On 06/20/2011 07:02 AM, David Wiebe wrote:
>>>> /home/david/xenomai-2.5.6.test/include/nucleus/types.h:41:32: error:
>>>> asm/xenomai/system.h: No such file or directory
>>> Could you show us the arguments you pass to Xenomai "configure" script?
>>> Normally, the "asm" directory is created by Xenomai install rule.
>>>
>>> Posting your test code would also help us try and reproduce this issue.
>>>
>> Of course!
>>
>> <test2.c>
>> #include<stdio.h>
>> #include<stdlib.h>
>> #include<fcntl.h>
>> #include<unistd.h>
>> #include<sys/stat.h>
>> #include<sys/types.h>
>> #include<sys/ioctl.h>
>> #include<signal.h>
>> #include<sys/mman.h>
>>
>> #include<native/task.h>
>> #include<native/timer.h>
>>
>> #define TIMESLEEP 1000000000 /* 1 sec */
>>
>>
>> int main(void)
>> {
>> }
>> <!test2.c>
>>
>> <The configure script>
>> ./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi
>> --enable-arm-mach=omap3
>> <!The configure script>
>>
>> <The make install>
>> make DESTDIR=/home/david/sdir/ install
>> <!The make install>
> Then, the header should be found under
> /home/david/sdir/usr/xenomai/include/xenomai
>
> In order to compile your test you should use xeno-config.
>
> Typing, for instance:
>
> CFLAGS=`DESTDIR=/home/david/sdir /home/david/sdir/usr/xenomai/bin/bin/xeno-config --skin native --cflags`
> LDFLAGS=`DESTDIR=/home/david/sdir /home/david/sdir/usr/xenomai/bin/bin/xeno-config --skin native --ldflags`
> arm-none-linux-gnueabi-gcc -o test2 $CFLAGS test2.c $LDFLAGS
>
>
Gilles,
Thank you for the info. My example program compiled. I fixed the typos
and reposted.
CFLAGS=`DESTDIR=/home/david/sdir /home/david/sdir/usr/xenomai/bin/xeno-config --skin native --cflags`
LDFLAGS=`DESTDIR=/home/david/sdir /home/david/sdir/usr/xenomai/bin/xeno-config --skin native --ldflags`
arm-none-linux-gnueabi-gcc -o test2 $CFLAGS test2.c $LDFLAGS
Sincerely,
David
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2011-06-20 19:04 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-19 13:16 [Xenomai-help] Problem accesing I2C without using Linux kernel Andrey Nechypurenko
2011-06-19 13:20 ` Gilles Chanteperdrix
[not found] ` <BANLkTinVUd-R1cpD+40MGZZckzGhwrqRvw@domain.hid>
2011-06-19 13:44 ` Gilles Chanteperdrix
2011-06-19 13:54 ` Gilles Chanteperdrix
2011-06-19 14:06 ` Andrey Nechypurenko
2011-06-19 14:11 ` Gilles Chanteperdrix
2011-06-19 14:21 ` Andrey Nechypurenko
2011-06-19 16:57 ` Gilles Chanteperdrix
2011-06-19 20:24 ` Andrey Nechypurenko
2011-06-20 0:00 ` [Xenomai-help] Beagleboard Xenomai David Wiebe
2011-06-20 5:02 ` [Xenomai-help] Compiling program with xenomai support David Wiebe
2011-06-20 7:14 ` Gilles Chanteperdrix
2011-06-20 8:06 ` David Wiebe
2011-06-20 11:13 ` Gilles Chanteperdrix
2011-06-20 19:04 ` David Wiebe
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.