From: Wolfgang Grandegger <wg@domain.hid>
To: Minh GIANG <giang.hminh@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT
Date: Thu, 12 Apr 2012 18:31:41 +0200 [thread overview]
Message-ID: <4F87036D.1050605@domain.hid> (raw)
In-Reply-To: <CAGq8jPgV3aQrz6-Y0LqrjT1HA2udHG887o1EFd4bS5eFvp6gkw@domain.hid>
On 04/12/2012 10:51 AM, Minh GIANG wrote:
> Hello sir,
>
> Here is the message after doing your command:
>
> giang@domain.hid$
> make XENO=/usr/xenomai/bin
> --xeno-cflags is deprecated, use --skin=name --cflags instead
> --xeno-ldflags is deprecated, use --skin=name --ldflags instead
> gcc -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall
> -Werror-implicit-function-declaration -pipe -D__XENO__ -L/usr/xenomai/lib
> -lxenomai -lpthread -lrt -lnative -lrtdm -Xlinker -rpath -Xlinker
That's how the program should be comiled and linked.
> /usr/xenomai/lib cross-link.c -o cross-link
> cross-link.c: In function ‘write_task_proc’:
> cross-link.c:167: warning: format ‘%d’ expects type ‘int’, but argument 2
> has type ‘ssize_t’
> cross-link.c:167: warning: format ‘%d’ expects type ‘int’, but argument 3
> has type ‘ssize_t’
> cross-link.c: In function ‘read_task_proc’:
> cross-link.c:227: warning: format ‘%d’ expects type ‘int’, but argument 2
> has type ‘ssize_t’
> cross-link.c:227: warning: format ‘%d’ expects type ‘int’, but argument 3
> has type ‘ssize_t’
> giang@domain.hid$
> ./cross-link
> Xenomai: binding failed: Operation not permitted.
> giang@domain.hid$ su
> Mot de passe :
> root@domain.hids/serial#
> ./cross-link
> main : write-file opened
> main : write-config written
> main : read-file opened
> main : read-config written
> main : write-task created
> main : read-task created
> main : starting write-task
> main : starting read-task
> Nr | write->irq | irq->read | write->read |
> -----------------------------------------------------------
> 0 | 104495 | 617720 | 722215
> 1 | 104649 | 617061 | 721710
> 2 | 104360 | 617820 | 722180
> 3 | 104906 | 617050 | 721956
> 4 | 105794 | 617188 | 722982
> 5 | 103504 | 618103 | 721607
> 6 | 104643 | 617084 | 721727
> 7 | 106633 | 617767 | 724400
>
> oh, it seems to work perfectly, i don't know why it works in this case when
> i lauched it in the terminal linux, i copied exactly the program in Eclipse
> C++ and it doesn't work. Ah the only thing i have changed (otherwise my
> program don't compile in Eclipse), is
>
> static const struct rtser_config read_config = {
> 0xFFFF,
> 115200,
> RTSER_DEF_PARITY,
> RTSER_DEF_BITS,
> RTSER_DEF_STOPB,
> RTSER_DEF_HAND,
> RTSER_DEF_FIFO_DEPTH,
> RTSER_DEF_TIMEOUT,
> RTSER_DEF_TIMEOUT,
> 1000000000, /* 1 s */
> RTSER_RX_TIMESTAMP_HISTORY,
> RTSER_EVENT_RXPEND,
> };
>
> static const struct rtser_config write_config = {
> RTSER_SET_BAUD | RTSER_SET_TIMESTAMP_HISTORY,
> 115200,
> RTSER_DEF_TIMESTAMP_HISTORY,
> /* the rest implicitely remains default */
> };
>
> maybe, i don't compile with good parameters in Eclipse?
Yes, that's your problem. And exactly to avoid such problems, Xenomai
provides the script "xeno-config" to retrieve proper compiler and linker
options.
> my version Xenomai 2.6.0
I also recommend to update to a more recent version.
Wolfgang.
next prev parent reply other threads:[~2012-04-12 16:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-29 15:26 [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT Minh GIANG
2012-03-30 6:43 ` Wolfgang Grandegger
[not found] ` <CAGq8jPioLnu+ehj+LA5dL6OWUpxQnUH+Nh01kB088FtsLsSrGA@mail.gmail.com>
[not found] ` <CAGq8jPi4S4TTBy9dLYYnWuWQdX_awhXxu0C93okgFO5vWv_20A@mail.gmail.com>
2012-03-30 13:31 ` Wolfgang Grandegger
2012-03-30 14:34 ` Minh GIANG
2012-03-30 14:48 ` Wolfgang Grandegger
2012-04-02 8:25 ` Minh GIANG
2012-04-02 16:38 ` Wolfgang Grandegger
2012-04-04 9:18 ` Minh GIANG
2012-04-05 10:56 ` Wolfgang Grandegger
2012-04-05 12:36 ` Minh GIANG
[not found] ` <CAGq8jPgON96yy7_wOCSs83QwxVrfSsTn-fe1P+EBZ8-KLMfj0A@mail.gmail.com>
2012-04-11 14:19 ` Wolfgang Grandegger
[not found] ` <CAGq8jPhmG-Zad1EpcVitzW9aY0rvA-4asb2f9Ncfs8FZ6D2CyQ@mail.gmail.com>
2012-04-11 16:10 ` Wolfgang Grandegger
2012-04-11 16:56 ` Gilles Chanteperdrix
2012-04-11 16:59 ` Gilles Chanteperdrix
2012-04-11 19:01 ` Wolfgang Grandegger
2012-04-11 20:51 ` Minh GIANG
2012-04-12 7:52 ` Wolfgang Grandegger
2012-04-12 8:51 ` Minh GIANG
2012-04-12 16:31 ` Wolfgang Grandegger [this message]
2012-04-25 9:11 ` Minh GIANG
2012-04-25 9:27 ` Wolfgang Grandegger
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=4F87036D.1050605@domain.hid \
--to=wg@domain.hid \
--cc=giang.hminh@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.