Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-25 Thread Minh GIANG
hello,

Thank you for helping me solve my problem.

You recommend me to update to a more recent version. But I think the
xenomai version 2.6.0 is the lastest version over http://www.xenomai.org
 site.

By the way, i have a short question. When i make run cross-link program, i
don't understand why there is a leak memory. Even if, i try to remove all
parasite in while loop, but the leak memory is always constant. i think the
problem comes from rt_dev_write() or rt_dev_read() which don't release the
memory buffer. im wrong?


On Thu, Apr 12, 2012 at 6:31 PM, Wolfgang Grandegger w...@grandegger.comwrote:

 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 = {
  0x,
  115200,
  RTSER_DEF_PARITY,
  RTSER_DEF_BITS,
  RTSER_DEF_STOPB,
  RTSER_DEF_HAND,
  RTSER_DEF_FIFO_DEPTH,
  RTSER_DEF_TIMEOUT,
  RTSER_DEF_TIMEOUT,
  10, /* 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
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-25 Thread Wolfgang Grandegger
On 04/25/2012 11:11 AM, Minh GIANG wrote:
 hello,
 
 Thank you for helping me solve my problem.
 
 You recommend me to update to a more recent version. But I think the
 xenomai version 2.6.0 is the lastest version over http://www.xenomai.org
  site.

You are right. The latest fixes are in the git repository, which you can
get with the following command:

  $ git clone git://git.xenomai.org/xenomai-2.6.git

 By the way, i have a short question. When i make run cross-link program, i
 don't understand why there is a leak memory. Even if, i try to remove all
 parasite in while loop, but the leak memory is always constant. i think the
 problem comes from rt_dev_write() or rt_dev_read() which don't release the
 memory buffer. im wrong?

What makes you think that there is a memory leak? How do you observe it
and what is running while your are testing with cross-link?

Wolfgang.


___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-12 Thread Wolfgang Grandegger
On 04/11/2012 10:51 PM, Minh GIANG wrote:
 ok for CC, i was afraid of spam everyone by my mail. I answer your
 questions.
 
 - non, i didn't modify cross-link program  (even if i used to modify this
 program to make it run, but it worked the same way)
 
 - Xenomai 2.6

What version (cat /proc/xenomai/version)?

 
 - Linux 2.6.38 and patch Adeos 2.6.38 of course
 
 - i build the program in Eclipse C++ so my command in setting configuration
 is
 
 command :   g++
 All options:   -l/usr/xenomai/include -O3 -wall -c -fmessage-length=0

That bogous! Please try the image created as shown below:

  $ cd xenomai-2.6-path/examples/rtdm/profiles/serial
  $ make XENO=/usr/xenomai/bin

Wolfgang.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-12 Thread Minh GIANG
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
/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 = {
0x,
115200,
RTSER_DEF_PARITY,
RTSER_DEF_BITS,
RTSER_DEF_STOPB,
RTSER_DEF_HAND,
RTSER_DEF_FIFO_DEPTH,
RTSER_DEF_TIMEOUT,
RTSER_DEF_TIMEOUT,
10, /* 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?
my version Xenomai 2.6.0


On Thu, Apr 12, 2012 at 9:52 AM, Wolfgang Grandegger w...@grandegger.comwrote:

 On 04/11/2012 10:51 PM, Minh GIANG wrote:
  ok for CC, i was afraid of spam everyone by my mail. I answer your
  questions.
 
  - non, i didn't modify cross-link program  (even if i used to modify this
  program to make it run, but it worked the same way)
 
  - Xenomai 2.6

 What version (cat /proc/xenomai/version)?

 
  - Linux 2.6.38 and patch Adeos 2.6.38 of course
 
  - i build the program in Eclipse C++ so my command in setting
 configuration
  is
 
  command :   g++
  All options:   -l/usr/xenomai/include -O3 -wall -c -fmessage-length=0

 That bogous! Please try the image created as shown below:

  $ cd xenomai-2.6-path/examples/rtdm/profiles/serial
  $ make XENO=/usr/xenomai/bin

 Wolfgang.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-12 Thread Wolfgang Grandegger
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 = {
 0x,
 115200,
 RTSER_DEF_PARITY,
 RTSER_DEF_BITS,
 RTSER_DEF_STOPB,
 RTSER_DEF_HAND,
 RTSER_DEF_FIFO_DEPTH,
 RTSER_DEF_TIMEOUT,
 RTSER_DEF_TIMEOUT,
 10, /* 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
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-11 Thread Wolfgang Grandegger
Hi,

On 04/05/2012 02:46 PM, Minh GIANG wrote:
 i'm sorry sir, what i displayed just in the last mail, isn't good, because
 i removed rt_dev_ioctl(...) in cross-link program
 And then, with  rt_dev_ioctl( RTSER_RTIOC_WAIT_EVENT ).
 
 [93076.465077] base=0x2f8 iir=0x4
 [93076.465082] base=0x2f8 status=0x0
 [93076.465084] base=0x2f8 iir=0x1

TX on rtser0:

 [93076.556794] base=0x3f8 iir=0x2
 [93076.556799] base=0x3f8 status=0x0
 [93076.556801] base=0x3f8 iir=0x1

RX of 8 chars on rtser1:

 [93076.557819] base=0x2f8 iir=0x4
 [93076.557823] base=0x2f8 status=0x0
 [93076.557825] base=0x2f8 iir=0x1

 [93076.558860] base=0x2f8 iir=0x4
 [93076.558865] base=0x2f8 status=0x0
 [93076.558867] base=0x2f8 iir=0x1

 [93076.559898] base=0x2f8 iir=0x4
 [93076.559901] base=0x2f8 status=0x0
 [93076.559903] base=0x2f8 iir=0x1

 [93076.560943] base=0x2f8 iir=0x4
 [93076.560946] base=0x2f8 status=0x0
 [93076.560948] base=0x2f8 iir=0x1

 [93076.561969] base=0x2f8 iir=0x4
 [93076.561971] base=0x2f8 status=0x0
 [93076.561973] base=0x2f8 iir=0x1

 [93076.563006] base=0x2f8 iir=0x4
 [93076.563009] base=0x2f8 status=0x0
 [93076.563011] base=0x2f8 iir=0x1

 [93076.564012] base=0x2f8 iir=0x4
 [93076.564012] base=0x2f8 status=0x0
 [93076.564012] base=0x2f8 iir=0x1

 [93076.564012] base=0x2f8 iir=0x4
 [93076.564012] base=0x2f8 status=0x0
 [93076.564012] base=0x2f8 iir=0x1

TX on rtser0:

 [93076.656766] base=0x3f8 iir=0x2
 [93076.656770] base=0x3f8 status=0x0
 [93076.656772] base=0x3f8 iir=0x1

RX on rtser1:

 [93076.657793] base=0x2f8 iir=0x4
 [93076.657795] base=0x2f8 status=0x0
 [93076.657797] base=0x2f8 iir=0x1

... and so on.

This looks completely normal and I'm really puzzled why the
rt_dev_ioctl(RTSER_RTIOC_WAIT_EVENT) does not work as expected. Ah, I
just realized that the following patch was not yet applied:

https://mail.gna.org/public/xenomai-core/2011-11/msg9.html

I think it will fix your problem.

Wolfgang.


___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-11 Thread Gilles Chanteperdrix
On 04/11/2012 04:19 PM, Wolfgang Grandegger wrote:
 Hi,
 
 On 04/05/2012 02:46 PM, Minh GIANG wrote:
 i'm sorry sir, what i displayed just in the last mail, isn't good, because
 i removed rt_dev_ioctl(...) in cross-link program
 And then, with  rt_dev_ioctl( RTSER_RTIOC_WAIT_EVENT ).

 [93076.465077] base=0x2f8 iir=0x4
 [93076.465082] base=0x2f8 status=0x0
 [93076.465084] base=0x2f8 iir=0x1
 
 TX on rtser0:
 
 [93076.556794] base=0x3f8 iir=0x2
 [93076.556799] base=0x3f8 status=0x0
 [93076.556801] base=0x3f8 iir=0x1
 
 RX of 8 chars on rtser1:
 
 [93076.557819] base=0x2f8 iir=0x4
 [93076.557823] base=0x2f8 status=0x0
 [93076.557825] base=0x2f8 iir=0x1
 
 [93076.558860] base=0x2f8 iir=0x4
 [93076.558865] base=0x2f8 status=0x0
 [93076.558867] base=0x2f8 iir=0x1
 
 [93076.559898] base=0x2f8 iir=0x4
 [93076.559901] base=0x2f8 status=0x0
 [93076.559903] base=0x2f8 iir=0x1
 
 [93076.560943] base=0x2f8 iir=0x4
 [93076.560946] base=0x2f8 status=0x0
 [93076.560948] base=0x2f8 iir=0x1
 
 [93076.561969] base=0x2f8 iir=0x4
 [93076.561971] base=0x2f8 status=0x0
 [93076.561973] base=0x2f8 iir=0x1
 
 [93076.563006] base=0x2f8 iir=0x4
 [93076.563009] base=0x2f8 status=0x0
 [93076.563011] base=0x2f8 iir=0x1
 
 [93076.564012] base=0x2f8 iir=0x4
 [93076.564012] base=0x2f8 status=0x0
 [93076.564012] base=0x2f8 iir=0x1
 
 [93076.564012] base=0x2f8 iir=0x4
 [93076.564012] base=0x2f8 status=0x0
 [93076.564012] base=0x2f8 iir=0x1
 
 TX on rtser0:
 
 [93076.656766] base=0x3f8 iir=0x2
 [93076.656770] base=0x3f8 status=0x0
 [93076.656772] base=0x3f8 iir=0x1
 
 RX on rtser1:
 
 [93076.657793] base=0x2f8 iir=0x4
 [93076.657795] base=0x2f8 status=0x0
 [93076.657797] base=0x2f8 iir=0x1
 
 ... and so on.
 
 This looks completely normal and I'm really puzzled why the
 rt_dev_ioctl(RTSER_RTIOC_WAIT_EVENT) does not work as expected. Ah, I
 just realized that the following patch was not yet applied:
 
 https://mail.gna.org/public/xenomai-core/2011-11/msg9.html
 
 I think it will fix your problem.

Sorry, it looks like I completely forgot this patch. Could you rebase it
on the current contents of xenomai-2.6 so that I can merge it?

-- 
Gilles.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-11 Thread Gilles Chanteperdrix
On 04/11/2012 06:56 PM, Gilles Chanteperdrix wrote:
 On 04/11/2012 04:19 PM, Wolfgang Grandegger wrote:
 Hi,

 On 04/05/2012 02:46 PM, Minh GIANG wrote:
 i'm sorry sir, what i displayed just in the last mail, isn't good, because
 i removed rt_dev_ioctl(...) in cross-link program
 And then, with  rt_dev_ioctl( RTSER_RTIOC_WAIT_EVENT ).

 [93076.465077] base=0x2f8 iir=0x4
 [93076.465082] base=0x2f8 status=0x0
 [93076.465084] base=0x2f8 iir=0x1

 TX on rtser0:

 [93076.556794] base=0x3f8 iir=0x2
 [93076.556799] base=0x3f8 status=0x0
 [93076.556801] base=0x3f8 iir=0x1

 RX of 8 chars on rtser1:

 [93076.557819] base=0x2f8 iir=0x4
 [93076.557823] base=0x2f8 status=0x0
 [93076.557825] base=0x2f8 iir=0x1

 [93076.558860] base=0x2f8 iir=0x4
 [93076.558865] base=0x2f8 status=0x0
 [93076.558867] base=0x2f8 iir=0x1

 [93076.559898] base=0x2f8 iir=0x4
 [93076.559901] base=0x2f8 status=0x0
 [93076.559903] base=0x2f8 iir=0x1

 [93076.560943] base=0x2f8 iir=0x4
 [93076.560946] base=0x2f8 status=0x0
 [93076.560948] base=0x2f8 iir=0x1

 [93076.561969] base=0x2f8 iir=0x4
 [93076.561971] base=0x2f8 status=0x0
 [93076.561973] base=0x2f8 iir=0x1

 [93076.563006] base=0x2f8 iir=0x4
 [93076.563009] base=0x2f8 status=0x0
 [93076.563011] base=0x2f8 iir=0x1

 [93076.564012] base=0x2f8 iir=0x4
 [93076.564012] base=0x2f8 status=0x0
 [93076.564012] base=0x2f8 iir=0x1

 [93076.564012] base=0x2f8 iir=0x4
 [93076.564012] base=0x2f8 status=0x0
 [93076.564012] base=0x2f8 iir=0x1

 TX on rtser0:

 [93076.656766] base=0x3f8 iir=0x2
 [93076.656770] base=0x3f8 status=0x0
 [93076.656772] base=0x3f8 iir=0x1

 RX on rtser1:

 [93076.657793] base=0x2f8 iir=0x4
 [93076.657795] base=0x2f8 status=0x0
 [93076.657797] base=0x2f8 iir=0x1

 ... and so on.

 This looks completely normal and I'm really puzzled why the
 rt_dev_ioctl(RTSER_RTIOC_WAIT_EVENT) does not work as expected. Ah, I
 just realized that the following patch was not yet applied:

 https://mail.gna.org/public/xenomai-core/2011-11/msg9.html

 I think it will fix your problem.
 
 Sorry, it looks like I completely forgot this patch. Could you rebase it
 on the current contents of xenomai-2.6 so that I can merge it?
 
Actually, the patches are merged in xenomai-2.6 repository. The problem
we have is simply that xenomai 2.6.0 is too old.

-- 
Gilles.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-11 Thread Wolfgang Grandegger
On 04/11/2012 06:59 PM, Gilles Chanteperdrix wrote:
 On 04/11/2012 06:56 PM, Gilles Chanteperdrix wrote:
 On 04/11/2012 04:19 PM, Wolfgang Grandegger wrote:
 Hi,

 On 04/05/2012 02:46 PM, Minh GIANG wrote:
 i'm sorry sir, what i displayed just in the last mail, isn't good, because
 i removed rt_dev_ioctl(...) in cross-link program
 And then, with  rt_dev_ioctl( RTSER_RTIOC_WAIT_EVENT ).

 [93076.465077] base=0x2f8 iir=0x4
 [93076.465082] base=0x2f8 status=0x0
 [93076.465084] base=0x2f8 iir=0x1

 TX on rtser0:

 [93076.556794] base=0x3f8 iir=0x2
 [93076.556799] base=0x3f8 status=0x0
 [93076.556801] base=0x3f8 iir=0x1

 RX of 8 chars on rtser1:

 [93076.557819] base=0x2f8 iir=0x4
 [93076.557823] base=0x2f8 status=0x0
 [93076.557825] base=0x2f8 iir=0x1

 [93076.558860] base=0x2f8 iir=0x4
 [93076.558865] base=0x2f8 status=0x0
 [93076.558867] base=0x2f8 iir=0x1

 [93076.559898] base=0x2f8 iir=0x4
 [93076.559901] base=0x2f8 status=0x0
 [93076.559903] base=0x2f8 iir=0x1

 [93076.560943] base=0x2f8 iir=0x4
 [93076.560946] base=0x2f8 status=0x0
 [93076.560948] base=0x2f8 iir=0x1

 [93076.561969] base=0x2f8 iir=0x4
 [93076.561971] base=0x2f8 status=0x0
 [93076.561973] base=0x2f8 iir=0x1

 [93076.563006] base=0x2f8 iir=0x4
 [93076.563009] base=0x2f8 status=0x0
 [93076.563011] base=0x2f8 iir=0x1

 [93076.564012] base=0x2f8 iir=0x4
 [93076.564012] base=0x2f8 status=0x0
 [93076.564012] base=0x2f8 iir=0x1

 [93076.564012] base=0x2f8 iir=0x4
 [93076.564012] base=0x2f8 status=0x0
 [93076.564012] base=0x2f8 iir=0x1

 TX on rtser0:

 [93076.656766] base=0x3f8 iir=0x2
 [93076.656770] base=0x3f8 status=0x0
 [93076.656772] base=0x3f8 iir=0x1

 RX on rtser1:

 [93076.657793] base=0x2f8 iir=0x4
 [93076.657795] base=0x2f8 status=0x0
 [93076.657797] base=0x2f8 iir=0x1

 ... and so on.

 This looks completely normal and I'm really puzzled why the
 rt_dev_ioctl(RTSER_RTIOC_WAIT_EVENT) does not work as expected. Ah, I
 just realized that the following patch was not yet applied:

 https://mail.gna.org/public/xenomai-core/2011-11/msg9.html

 I think it will fix your problem.

 Sorry, it looks like I completely forgot this patch. Could you rebase it
 on the current contents of xenomai-2.6 so that I can merge it?

 Actually, the patches are merged in xenomai-2.6 repository. The problem
 we have is simply that xenomai 2.6.0 is too old.

Argh, you are right. Sorry for the noise.

Wolfgang.



___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-11 Thread Minh GIANG
ok for CC, i was afraid of spam everyone by my mail. I answer your
questions.

- non, i didn't modify cross-link program  (even if i used to modify this
program to make it run, but it worked the same way)

- Xenomai 2.6

- Linux 2.6.38 and patch Adeos 2.6.38 of course

- i build the program in Eclipse C++ so my command in setting configuration
is

command :   g++
All options:   -l/usr/xenomai/include -O3 -wall -c -fmessage-length=0

Well, i will soon rebuild my kernel with this patch

Goodbye

On Wed, Apr 11, 2012 at 9:01 PM, Wolfgang Grandegger w...@grandegger.comwrote:

 On 04/11/2012 06:59 PM, Gilles Chanteperdrix wrote:
  On 04/11/2012 06:56 PM, Gilles Chanteperdrix wrote:
  On 04/11/2012 04:19 PM, Wolfgang Grandegger wrote:
  Hi,
 
  On 04/05/2012 02:46 PM, Minh GIANG wrote:
  i'm sorry sir, what i displayed just in the last mail, isn't good,
 because
  i removed rt_dev_ioctl(...) in cross-link program
  And then, with  rt_dev_ioctl( RTSER_RTIOC_WAIT_EVENT ).
 
  [93076.465077] base=0x2f8 iir=0x4
  [93076.465082] base=0x2f8 status=0x0
  [93076.465084] base=0x2f8 iir=0x1
 
  TX on rtser0:
 
  [93076.556794] base=0x3f8 iir=0x2
  [93076.556799] base=0x3f8 status=0x0
  [93076.556801] base=0x3f8 iir=0x1
 
  RX of 8 chars on rtser1:
 
  [93076.557819] base=0x2f8 iir=0x4
  [93076.557823] base=0x2f8 status=0x0
  [93076.557825] base=0x2f8 iir=0x1
 
  [93076.558860] base=0x2f8 iir=0x4
  [93076.558865] base=0x2f8 status=0x0
  [93076.558867] base=0x2f8 iir=0x1
 
  [93076.559898] base=0x2f8 iir=0x4
  [93076.559901] base=0x2f8 status=0x0
  [93076.559903] base=0x2f8 iir=0x1
 
  [93076.560943] base=0x2f8 iir=0x4
  [93076.560946] base=0x2f8 status=0x0
  [93076.560948] base=0x2f8 iir=0x1
 
  [93076.561969] base=0x2f8 iir=0x4
  [93076.561971] base=0x2f8 status=0x0
  [93076.561973] base=0x2f8 iir=0x1
 
  [93076.563006] base=0x2f8 iir=0x4
  [93076.563009] base=0x2f8 status=0x0
  [93076.563011] base=0x2f8 iir=0x1
 
  [93076.564012] base=0x2f8 iir=0x4
  [93076.564012] base=0x2f8 status=0x0
  [93076.564012] base=0x2f8 iir=0x1
 
  [93076.564012] base=0x2f8 iir=0x4
  [93076.564012] base=0x2f8 status=0x0
  [93076.564012] base=0x2f8 iir=0x1
 
  TX on rtser0:
 
  [93076.656766] base=0x3f8 iir=0x2
  [93076.656770] base=0x3f8 status=0x0
  [93076.656772] base=0x3f8 iir=0x1
 
  RX on rtser1:
 
  [93076.657793] base=0x2f8 iir=0x4
  [93076.657795] base=0x2f8 status=0x0
  [93076.657797] base=0x2f8 iir=0x1
 
  ... and so on.
 
  This looks completely normal and I'm really puzzled why the
  rt_dev_ioctl(RTSER_RTIOC_WAIT_EVENT) does not work as expected. Ah, I
  just realized that the following patch was not yet applied:
 
  https://mail.gna.org/public/xenomai-core/2011-11/msg9.html
 
  I think it will fix your problem.
 
  Sorry, it looks like I completely forgot this patch. Could you rebase it
  on the current contents of xenomai-2.6 so that I can merge it?
 
  Actually, the patches are merged in xenomai-2.6 repository. The problem
  we have is simply that xenomai 2.6.0 is too old.

 Argh, you are right. Sorry for the noise.

 Wolfgang.



 ___
 Xenomai-help mailing list
 Xenomai-help@gna.org
 https://mail.gna.org/listinfo/xenomai-help

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-05 Thread Wolfgang Grandegger
On 04/04/2012 11:18 AM, Minh GIANG wrote:
 hello,
 
 i did what you told me, i compiled the kernet with patch which you send me,
 and the result of dmesg
 
 [ 1636.156641] base=0x2f8 iir=0x1
 [ 1636.157672] base=0x2f8 iir=0x4
 [ 1636.157675] base=0x2f8 status=0x100
 [ 1636.157677] base=0x2f8 iir=0x1
 [ 1636.158713] base=0x2f8 iir=0x4
 [ 1636.158715] base=0x2f8 status=0x100
 [ 1636.158717] base=0x2f8 iir=0x1
 [ 1636.250404] base=0x3f8 iir=0x2
 [ 1636.250407] base=0x3f8 status=0x0
 [ 1636.250410] base=0x3f8 iir=0x1
 [ 1636.251425] base=0x2f8 iir=0x4
 [ 1636.251427] base=0x2f8 status=0x100
 [ 1636.251429] base=0x2f8 iir=0x1
 [ 1636.252016] base=0x2f8 iir=0x4
 [ 1636.252016] base=0x2f8 status=0x100
 [ 1636.252016] base=0x2f8 iir=0x1
 [ 1636.252016] base=0x2f8 iir=0x4
 [ 1636.252016] base=0x2f8 status=0x100
 [ 1636.252016] base=0x2f8 iir=0x1
 [ 1636.252016] base=0x2f8 iir=0x4
 [ 1636.252016] base=0x2f8 status=0x100
 [ 1636.252016] base=0x2f8 iir=0x1
 [ 1636.252016] base=0x2f8 iir=0x4
 [ 1636.252016] base=0x2f8 status=0x100
 [ 1636.252016] base=0x2f8 iir=0x1
 [ 1636.256619] base=0x2f8 iir=0x4
 [ 1636.256621] base=0x2f8 status=0x100
 [ 1636.256623] base=0x2f8 iir=0x1
 [ 1636.257665] base=0x2f8 iir=0x4
 [ 1636.257668] base=0x2f8 status=0x100
 [ 1636.257670] base=0x2f8 iir=0x1
 [ 1636.258693] base=0x2f8 iir=0x4
 [ 1636.258696] base=0x2f8 status=0x100
 [ 1636.258698] base=0x2f8 iir=0x1
 
 i wait your response

Looks pretty normal, at a first glance. Could you please send a longer
trace covering more than one cycle? I will then have a closer look after
eastern.

BTW: what Xenomai and Linux kernel version do you use?

Wolfgang.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-05 Thread Minh GIANG
hello,

my configuration :  linux 2.6.38, patch adeos 2.6.38 and xenomai 2.6
compiled with linux Debian 6.0(Squezze) architecture amd64-Athlon


in any case, i saw the list displays the same thing. Maybe im wrong in
display what you want to see?

[92367.750709] base=0x2f8 iir=0x4
[92367.750711] base=0x2f8 status=0x0
[92367.750713] base=0x2f8 iir=0x1
[92367.751748] base=0x2f8 iir=0x4
[92367.751750] base=0x2f8 status=0x0
[92367.751752] base=0x2f8 iir=0x1
[92367.752788] base=0x2f8 iir=0x4
[92367.752790] base=0x2f8 status=0x0
[92367.752792] base=0x2f8 iir=0x1
[92367.753825] base=0x2f8 iir=0x4
[92367.753827] base=0x2f8 status=0x0
[92367.753829] base=0x2f8 iir=0x1
[92367.754864] base=0x2f8 iir=0x4
[92367.754866] base=0x2f8 status=0x0
[92367.754868] base=0x2f8 iir=0x1
[92367.755929] base=0x2f8 iir=0x4
[92367.755931] base=0x2f8 status=0x0
[92367.755933] base=0x2f8 iir=0x1
[92367.847604] base=0x3f8 iir=0x2
[92367.847607] base=0x3f8 status=0x0
[92367.847609] base=0x3f8 iir=0x1
[92367.848632] base=0x2f8 iir=0x4
[92367.848634] base=0x2f8 status=0x0
[92367.848636] base=0x2f8 iir=0x1
[92367.849668] base=0x2f8 iir=0x4
[92367.849670] base=0x2f8 status=0x0
[92367.849672] base=0x2f8 iir=0x1
[92367.850707] base=0x2f8 iir=0x4
[92367.850709] base=0x2f8 status=0x0
[92367.850711] base=0x2f8 iir=0x1
[92367.851745] base=0x2f8 iir=0x4
[92367.851747] base=0x2f8 status=0x0
[92367.851749] base=0x2f8 iir=0x1
[92367.852785] base=0x2f8 iir=0x4
[92367.852787] base=0x2f8 status=0x0
[92367.852789] base=0x2f8 iir=0x1
[92367.853822] base=0x2f8 iir=0x4
[92367.853824] base=0x2f8 status=0x0
[92367.853826] base=0x2f8 iir=0x1
[92367.854861] base=0x2f8 iir=0x4
[92367.854863] base=0x2f8 status=0x0
[92367.854865] base=0x2f8 iir=0x1
[92367.855925] base=0x2f8 iir=0x4
[92367.855927] base=0x2f8 status=0x0
[92367.855929] base=0x2f8 iir=0x1
[92367.947624] base=0x3f8 iir=0x2
[92367.947628] base=0x3f8 status=0x0
[92367.947630] base=0x3f8 iir=0x1
[92367.948653] base=0x2f8 iir=0x4
[92367.948657] base=0x2f8 status=0x0
[92367.948659] base=0x2f8 iir=0x1
[92367.949691] base=0x2f8 iir=0x4
[92367.949694] base=0x2f8 status=0x0
[92367.949696] base=0x2f8 iir=0x1
[92367.950735] base=0x2f8 iir=0x4
[92367.950738] base=0x2f8 status=0x0
[92367.950740] base=0x2f8 iir=0x1
[92367.951764] base=0x2f8 iir=0x4
[92367.951766] base=0x2f8 status=0x0
[92367.951768] base=0x2f8 iir=0x1
[92367.952814] base=0x2f8 iir=0x4
[92367.952818] base=0x2f8 status=0x0
[92367.952821] base=0x2f8 iir=0x1
[92367.953843] base=0x2f8 iir=0x4
[92367.953846] base=0x2f8 status=0x0
[92367.953848] base=0x2f8 iir=0x1
[92367.954887] base=0x2f8 iir=0x4
[92367.954892] base=0x2f8 status=0x0
[92367.954894] base=0x2f8 iir=0x1
[92367.955958] base=0x2f8 iir=0x4
[92367.955962] base=0x2f8 status=0x0
[92367.955964] base=0x2f8 iir=0x1
[92368.047622] base=0x3f8 iir=0x2
[92368.047626] base=0x3f8 status=0x0
[92368.047628] base=0x3f8 iir=0x1
[92368.048656] base=0x2f8 iir=0x4
[92368.048659] base=0x2f8 status=0x0
[92368.048661] base=0x2f8 iir=0x1
[92368.049701] base=0x2f8 iir=0x4
[92368.049705] base=0x2f8 status=0x0
[92368.049707] base=0x2f8 iir=0x1
[92368.050737] base=0x2f8 iir=0x4
[92368.050741] base=0x2f8 status=0x0
[92368.050743] base=0x2f8 iir=0x1
[92368.051765] base=0x2f8 iir=0x4
[92368.051767] base=0x2f8 status=0x0
[92368.051769] base=0x2f8 iir=0x1
[92368.052807] base=0x2f8 iir=0x4
[92368.052810] base=0x2f8 status=0x0
[92368.052812] base=0x2f8 iir=0x1
[92368.053846] base=0x2f8 iir=0x4
[92368.053849] base=0x2f8 status=0x0
[92368.053851] base=0x2f8 iir=0x1
[92368.054888] base=0x2f8 iir=0x4
[92368.054891] base=0x2f8 status=0x0
[92368.054893] base=0x2f8 iir=0x1
[92368.055957] base=0x2f8 iir=0x4
[92368.055960] base=0x2f8 status=0x0
[92368.055962] base=0x2f8 iir=0x1
[92368.147615] base=0x3f8 iir=0x2
[92368.147619] base=0x3f8 status=0x0
[92368.147621] base=0x3f8 iir=0x1
[92368.148643] base=0x2f8 iir=0x4
[92368.148645] base=0x2f8 status=0x0
[92368.148647] base=0x2f8 iir=0x1
[92368.149681] base=0x2f8 iir=0x4
[92368.149683] base=0x2f8 status=0x0
[92368.149685] base=0x2f8 iir=0x1
[92368.150729] base=0x2f8 iir=0x4
[92368.150732] base=0x2f8 status=0x0
[92368.150734] base=0x2f8 iir=0x1
[92368.151763] base=0x2f8 iir=0x4
[92368.151766] base=0x2f8 status=0x0
[92368.151768] base=0x2f8 iir=0x1
[92368.152802] base=0x2f8 iir=0x4
[92368.152805] base=0x2f8 status=0x0
[92368.152807] base=0x2f8 iir=0x1
[92368.153843] base=0x2f8 iir=0x4
[92368.153847] base=0x2f8 status=0x0
[92368.153849] base=0x2f8 iir=0x1
[92368.154874] base=0x2f8 iir=0x4
[92368.154877] base=0x2f8 status=0x0
[92368.154879] base=0x2f8 iir=0x1
[92368.155946] base=0x2f8 iir=0x4
[92368.155948] base=0x2f8 status=0x0
[92368.155950] base=0x2f8 iir=0x1
[92368.247623] base=0x3f8 iir=0x2
[92368.247627] base=0x3f8 status=0x0
[92368.247629] base=0x3f8 iir=0x1
[92368.248652] base=0x2f8 iir=0x4
[92368.248654] base=0x2f8 status=0x0
[92368.248656] base=0x2f8 iir=0x1
[92368.249689] base=0x2f8 iir=0x4
[92368.249691] base=0x2f8 status=0x0
[92368.249693] base=0x2f8 iir=0x1
[92368.250727] base=0x2f8 

Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-04 Thread Minh GIANG
hello,

i did what you told me, i compiled the kernet with patch which you send me,
and the result of dmesg

[ 1636.156641] base=0x2f8 iir=0x1
[ 1636.157672] base=0x2f8 iir=0x4
[ 1636.157675] base=0x2f8 status=0x100
[ 1636.157677] base=0x2f8 iir=0x1
[ 1636.158713] base=0x2f8 iir=0x4
[ 1636.158715] base=0x2f8 status=0x100
[ 1636.158717] base=0x2f8 iir=0x1
[ 1636.250404] base=0x3f8 iir=0x2
[ 1636.250407] base=0x3f8 status=0x0
[ 1636.250410] base=0x3f8 iir=0x1
[ 1636.251425] base=0x2f8 iir=0x4
[ 1636.251427] base=0x2f8 status=0x100
[ 1636.251429] base=0x2f8 iir=0x1
[ 1636.252016] base=0x2f8 iir=0x4
[ 1636.252016] base=0x2f8 status=0x100
[ 1636.252016] base=0x2f8 iir=0x1
[ 1636.252016] base=0x2f8 iir=0x4
[ 1636.252016] base=0x2f8 status=0x100
[ 1636.252016] base=0x2f8 iir=0x1
[ 1636.252016] base=0x2f8 iir=0x4
[ 1636.252016] base=0x2f8 status=0x100
[ 1636.252016] base=0x2f8 iir=0x1
[ 1636.252016] base=0x2f8 iir=0x4
[ 1636.252016] base=0x2f8 status=0x100
[ 1636.252016] base=0x2f8 iir=0x1
[ 1636.256619] base=0x2f8 iir=0x4
[ 1636.256621] base=0x2f8 status=0x100
[ 1636.256623] base=0x2f8 iir=0x1
[ 1636.257665] base=0x2f8 iir=0x4
[ 1636.257668] base=0x2f8 status=0x100
[ 1636.257670] base=0x2f8 iir=0x1
[ 1636.258693] base=0x2f8 iir=0x4
[ 1636.258696] base=0x2f8 status=0x100
[ 1636.258698] base=0x2f8 iir=0x1

i wait your response

thanks,
___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-02 Thread Minh GIANG
hello,

i don't know how call the function rt_dev_ioctl() after the timeout
happened, this function is called in the begining of while loop
(cross-link program).
I get the value of struct  rtser_status,
line status = 96
modem status = 176
to be honest, i don't know why cross-line program works without the
function  rt_dev_ioctl() with  RTSER_RTIOC_WAIT_EVENT in  option.

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 |17113389816533987823 |154257183912191 | 8348398
  1 |17113389815533997483 |154258183885264 | 8331131
  2 |17113389814533998100 |154259183882033 | 8328517
  3 |17113389813534000420 |154260183884535 | 839
  4 |17113389812533998430 |154261183888665 | 8335479
..

i tried to send a character table, and it also worked.



On Fri, Mar 30, 2012 at 4:48 PM, Wolfgang Grandegger w...@grandegger.comwrote:

 On 03/30/2012 04:34 PM, Minh GIANG wrote:
  hi,
 
  with option RTSER_RTIOC_WAIT_EVENT in rt_dev_ioctl(), this function
 returns
  un number -110 (Connection timed out)
  with option RTSER_RTIOC_GET_STATUS in rt_dev_ioctl(), this function
 returns
  un number 0 (not message)

 You should call this function *after* the timeout happened. What does
 the struct rtser_status  contain? Especially the line_status is of
 interest.

 
  Anyway, currently it works without  rt_dev_ioctl(), i can see
 rt_dev_read()
  wait data event (with debug mode) while giving the period of write
  task,  for exemple  = two seconds.
 
  so can i remove the funtion rt_dev_ioctl?

 The rt_dev_ioctl should work. You can remove it, but the problem will
 remain. To debug the problem you could also add some printk's here:


 http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/drivers/serial/16550A.c#223

 Especially the value of iir might be interesting.

 Wolfgang.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-04-02 Thread Wolfgang Grandegger
On 04/02/2012 10:25 AM, Minh GIANG wrote:
 hello,
 
 i don't know how call the function rt_dev_ioctl() after the timeout
 happened, this function is called in the begining of while loop
 (cross-link program).
 I get the value of struct  rtser_status,
 line status = 96
 modem status = 176
 to be honest, i don't know why cross-line program works without the
 function  rt_dev_ioctl() with  RTSER_RTIOC_WAIT_EVENT in  option.
 
 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 |17113389816533987823 |154257183912191 | 8348398
   1 |17113389815533997483 |154258183885264 | 8331131
   2 |17113389814533998100 |154259183882033 | 8328517
   3 |17113389813534000420 |154260183884535 | 839
   4 |17113389812533998430 |154261183888665 | 8335479
 ..
 
 i tried to send a character table, and it also worked.

Hm, maybe you receive something, but the numbers are bogous. To
understand better what's going on, coud you please apply the attached
patch to your Xenomai tree, rebuild the kernel and send the dmesg output
while running cross-link.

BTW: what Xenomai version are you using?

Wolfgang.

 On Fri, Mar 30, 2012 at 4:48 PM, Wolfgang Grandegger 
 w...@grandegger.comwrote:
 
 On 03/30/2012 04:34 PM, Minh GIANG wrote:
 hi,

 with option RTSER_RTIOC_WAIT_EVENT in rt_dev_ioctl(), this function
 returns
 un number -110 (Connection timed out)
 with option RTSER_RTIOC_GET_STATUS in rt_dev_ioctl(), this function
 returns
 un number 0 (not message)

 You should call this function *after* the timeout happened. What does
 the struct rtser_status  contain? Especially the line_status is of
 interest.


 Anyway, currently it works without  rt_dev_ioctl(), i can see
 rt_dev_read()
 wait data event (with debug mode) while giving the period of write
 task,  for exemple  = two seconds.

 so can i remove the funtion rt_dev_ioctl?

 The rt_dev_ioctl should work. You can remove it, but the problem will
 remain. To debug the problem you could also add some printk's here:


 http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/drivers/serial/16550A.c#223

 Especially the value of iir might be interesting.

 Wolfgang.

 

diff --git a/ksrc/drivers/serial/16550A.c b/ksrc/drivers/serial/16550A.c
index 3672539..392c4f7 100644
--- a/ksrc/drivers/serial/16550A.c
+++ b/ksrc/drivers/serial/16550A.c
@@ -240,6 +240,7 @@ static int rt_16550_interrupt(rtdm_irq_t * irq_context)
 
 	while (1) {
 		iir = rt_16550_reg_in(mode, base, IIR)  IIR_MASK;
+		printk(base=%#lx iir=%#x\n, base, iir);
 		if (testbits(iir, IIR_PIRQ))
 			break;
 
@@ -258,6 +259,7 @@ static int rt_16550_interrupt(rtdm_irq_t * irq_context)
 events |= RTSER_EVENT_MODEMLO;
 		}
 
+		printk(base=%#lx status=%#x\n, base, ctx-status);
 		ret = RTDM_IRQ_HANDLED;
 	}
 
___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-03-30 Thread Wolfgang Grandegger
On 03/29/2012 05:26 PM, Minh GIANG wrote:
 i want to revive the topic over the problem RTSER_RTIOC_WAIT_EVENT
 while compiling cross-link.c program. I cann't resolve my problem
 after doing some solution given by the others
 
 Loading module:
 
 insmod ./xeno_16550A.ko io=0x3f8,0x2f8 irq=4,3 tx_fifo=10,20

Hm, is a FIFO size of 20 supported by the hardware? For a first try I
would drop tx_fifo=10,20 (using the default of 16 for both uarts).

 start_index=0 (i have two serial ports on my pc)
 
 running crosslink test:
 
 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   |
 ---
 read_task: error on RTSER_RTIOC_WAIT_EVENT, Connection timed out
 read_task: error on RTSER_RTIOC_WAIT_EVENT, Connection timed out
 
 ...
 
 
 
 running test:
 
 cat /proc/xenomai/irq
 
 IRQ CPU0
   3:1089 rtser1
   4:5155 rtser0

You get interrupts, at least, but not the same amount, strange. What
cross-link command options do you use?

Wolfgang.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-03-30 Thread Wolfgang Grandegger
On 03/30/2012 01:15 PM, Minh GIANG wrote:
 hello,
 
 after testing a lot of time, i have one port which doesn't work well in
 writing (material problem i think). Now it works in writing and reading
 with one condtion that i have to remove the function
 err=rt_dev_ioctl(...) because it returns error.

Hm, what does rt_dev_ioctl() return?

 could you tell me the interet of this function? i think that rt_dev_read is
 enough to read the message.

Well, the ioctl waits for certain events and informs the task when they
occur. cross_link.c actually waits for the RTSER_EVENT_RXPEND meaning
that RX data are available. So, the sub-sequent read will/must work. You
do not need to call that ioctl but the read directly. But I doubt that
the read return successfully.

Maybe the interrupt service routine does detect errors due to hardware
problems:

http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/drivers/serial/16550A.c#213

and that's why the interrupt counter increases.

You could check that by setting RTSER_EVENT_ERRPEND or reading the
status using the ioctl request RTSER_RTIOC_GET_STATUS.

Wolfgang.

 On Fri, Mar 30, 2012 at 10:45 AM, Minh GIANG giang.hm...@gmail.com wrote:
 
 hello,
 thanks for your response. i compile cross-link program in ECLIPSE C++ so
 my command in setting configuration is
 command :   g++
 All options:   -l/usr/xenomai/include -O3 -wall -c -fmessage-length=0

 i connected 2 serial port of my computer by one cable in order to make the
 test. The write task works well but the other task is blocked by 
 rt_dev_ioctl(...).as
 i already mentionned and when i removed rt_dev_ioctl, the rt_dev_read
 function return 0
 I did what you said, but it doesn't work yet

 On Fri, Mar 30, 2012 at 8:43 AM, Wolfgang Grandegger 
 w...@grandegger.comwrote:

 On 03/29/2012 05:26 PM, Minh GIANG wrote:
 i want to revive the topic over the problem RTSER_RTIOC_WAIT_EVENT
 while compiling cross-link.c program. I cann't resolve my problem
 after doing some solution given by the others

 Loading module:

 insmod ./xeno_16550A.ko io=0x3f8,0x2f8 irq=4,3 tx_fifo=10,20

 Hm, is a FIFO size of 20 supported by the hardware? For a first try I
 would drop tx_fifo=10,20 (using the default of 16 for both uarts).

 start_index=0 (i have two serial ports on my pc)

 running crosslink test:

 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   |
 ---
 read_task: error on RTSER_RTIOC_WAIT_EVENT, Connection timed out
 read_task: error on RTSER_RTIOC_WAIT_EVENT, Connection timed out

 ...



 running test:

 cat /proc/xenomai/irq

 IRQ CPU0
   3:1089 rtser1
   4:5155 rtser0

 You get interrupts, at least, but not the same amount, strange. What
 cross-link command options do you use?

 Wolfgang.



 


___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-03-30 Thread Minh GIANG
hi,

with option RTSER_RTIOC_WAIT_EVENT in rt_dev_ioctl(), this function returns
un number -110 (Connection timed out)
with option RTSER_RTIOC_GET_STATUS in rt_dev_ioctl(), this function returns
un number 0 (not message)

Anyway, currently it works without  rt_dev_ioctl(), i can see rt_dev_read()
wait data event (with debug mode) while giving the period of write
task,  for exemple  = two seconds.

so can i remove the funtion rt_dev_ioctl?


On Fri, Mar 30, 2012 at 3:31 PM, Wolfgang Grandegger w...@grandegger.comwrote:

 On 03/30/2012 01:15 PM, Minh GIANG wrote:
  hello,
 
  after testing a lot of time, i have one port which doesn't work well in
  writing (material problem i think). Now it works in writing and reading
  with one condtion that i have to remove the function
  err=rt_dev_ioctl(...) because it returns error.

 Hm, what does rt_dev_ioctl() return?

  could you tell me the interet of this function? i think that rt_dev_read
 is
  enough to read the message.

 Well, the ioctl waits for certain events and informs the task when they
 occur. cross_link.c actually waits for the RTSER_EVENT_RXPEND meaning
 that RX data are available. So, the sub-sequent read will/must work. You
 do not need to call that ioctl but the read directly. But I doubt that
 the read return successfully.

 Maybe the interrupt service routine does detect errors due to hardware
 problems:


 http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/drivers/serial/16550A.c#213

 and that's why the interrupt counter increases.

 You could check that by setting RTSER_EVENT_ERRPEND or reading the
 status using the ioctl request RTSER_RTIOC_GET_STATUS.

 Wolfgang.

  On Fri, Mar 30, 2012 at 10:45 AM, Minh GIANG giang.hm...@gmail.com
 wrote:
 
  hello,
  thanks for your response. i compile cross-link program in ECLIPSE C++ so
  my command in setting configuration is
  command :   g++
  All options:   -l/usr/xenomai/include -O3 -wall -c -fmessage-length=0
 
  i connected 2 serial port of my computer by one cable in order to make
 the
  test. The write task works well but the other task is blocked by
 rt_dev_ioctl(...).as
  i already mentionned and when i removed rt_dev_ioctl, the rt_dev_read
  function return 0
  I did what you said, but it doesn't work yet
 
  On Fri, Mar 30, 2012 at 8:43 AM, Wolfgang Grandegger w...@grandegger.com
 wrote:
 
  On 03/29/2012 05:26 PM, Minh GIANG wrote:
  i want to revive the topic over the problem RTSER_RTIOC_WAIT_EVENT
  while compiling cross-link.c program. I cann't resolve my problem
  after doing some solution given by the others
 
  Loading module:
 
  insmod ./xeno_16550A.ko io=0x3f8,0x2f8 irq=4,3 tx_fifo=10,20
 
  Hm, is a FIFO size of 20 supported by the hardware? For a first try I
  would drop tx_fifo=10,20 (using the default of 16 for both uarts).
 
  start_index=0 (i have two serial ports on my pc)
 
  running crosslink test:
 
  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   |
  ---
  read_task: error on RTSER_RTIOC_WAIT_EVENT, Connection timed out
  read_task: error on RTSER_RTIOC_WAIT_EVENT, Connection timed out
 
  ...
 
 
 
  running test:
 
  cat /proc/xenomai/irq
 
  IRQ CPU0
3:1089 rtser1
4:5155 rtser0
 
  You get interrupts, at least, but not the same amount, strange. What
  cross-link command options do you use?
 
  Wolfgang.
 
 
 
 


___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT

2012-03-30 Thread Wolfgang Grandegger
On 03/30/2012 04:34 PM, Minh GIANG wrote:
 hi,
 
 with option RTSER_RTIOC_WAIT_EVENT in rt_dev_ioctl(), this function returns
 un number -110 (Connection timed out)
 with option RTSER_RTIOC_GET_STATUS in rt_dev_ioctl(), this function returns
 un number 0 (not message)

You should call this function *after* the timeout happened. What does
the struct rtser_status  contain? Especially the line_status is of
interest.

 
 Anyway, currently it works without  rt_dev_ioctl(), i can see rt_dev_read()
 wait data event (with debug mode) while giving the period of write
 task,  for exemple  = two seconds.
 
 so can i remove the funtion rt_dev_ioctl?

The rt_dev_ioctl should work. You can remove it, but the problem will
remain. To debug the problem you could also add some printk's here:

http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/drivers/serial/16550A.c#223

Especially the value of iir might be interesting.

Wolfgang.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help