On 04/12/2012 10:51 AM, Minh GIANG wrote:
> Hello sir,
>
> Here is the message after doing your command:
>
> giang@debianrt:~/Documents/xenomai-2.6.0/examples/rtdm/profiles/serial$
> 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@debianrt:~/Documents/xenomai-2.6.0/examples/rtdm/profiles/serial$
> ./cross-link
> Xenomai: binding failed: Operation not permitted.
> giang@debianrt:~/Documents/xenomai-2.6.0/examples/rtdm/profiles/serial$ su
> Mot de passe :
> root@debianrt:/home/giang/Documents/xenomai-2.6.0/examples/rtdm/profiles/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.
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help