From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <737283.11182.qm@domain.hid> References: Date: Tue, 7 Jun 2011 19:22:55 -0700 (PDT) From: sanjay anvekar MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-780321907-1307499775=:11182" Subject: [Xenomai-help] Xenomai-Driver Reply-To: sanjay anvekar List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "xenomai@xenomai.org" --0-780321907-1307499775=:11182 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0A=A0=A0=A0=A0 I am facing little problem with Xenomai tasks. Please he= lp me.=0AI am using Xenomai 2.5.6 patched to Kernel 2.6.37 on Intel Atom bo= ard with display and touch=0Ainterface. I have created an application which= uses various Linux Drivers such as=0ASerial Driver - Configured and used u= sing tty layer.=0ADisplay driver - Intel Frame buffer interface (mmap and i= octl).=0ASocket Programming and file system handling.=0AWhen I run this app= lication without having any Xenomai tasks then application works fine,=0Abu= t when I create different tasks then application does not work correctly. E= specially Serial=0Ainterface and display. Serial data seems to be loosing d= ata and display update is not happening instantly.=0AI am sure I am missing= something. Please help me to=0A resolve this issue.=0AI am using following= functions to create and maintain Xenomai tasks and tasks are successfully = created.=0A=A0=A0=A0=A0 =0A=A0=A0=A0=A0 mlockall(MCL_CURRENT | MCL_FUTURE);= =0A=A0=A0=A0=A0 rt_task_set_mode(0, T_WARNSW , NULL);=0A=A0=A0=A0=A0 rt_tas= k_create();=0A=A0=A0=A0=A0 rt_task_start()=0A=A0=A0=A0=A0 rt_task_yield() -= To allow execution of other tasks.=0A=0AThanks & Best Regards,=0ASanjay --0-780321907-1307499775=:11182 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
     I am facing little probl= em with Xenomai tasks. Please help me.
I am using Xe= nomai 2.5.6 patched to Kernel 2.6.37 on Intel Atom board with display and t= ouch
interface. I have created an application which uses various Linux D= rivers such as
Serial Driver - Configured and used using tty layer.
D= isplay driver - Intel Frame buffer interface (mmap and ioctl).
Socket Pr= ogramming and file system handling.
When I run this application without having any Xenomai tasks then application works fine,
but when I create= different tasks then application does not work correctly. Especially Seria= l
interface and display. Serial data seems to be loosing data and displ= ay update is not happening instantly.
I am sure I am missing something. = Please help me to=0A resolve this issue.
I am using following functions = to create and maintain Xenomai tasks and tasks are successfully created.
    
   &= nbsp; mlockall(MCL_CURRENT | MCL_FUTURE);
&nbs= p;    rt_task_set_mode(0, T_WARNSW , NULL);
=
     rt_task_create();
&nb= sp;    rt_task_start()
   &nb= sp; rt_task_yield() - To allow execution of other tasks.

Thanks & Best Regards,
Sanjay


=

--0-780321907-1307499775=:11182-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4DEF2D3D.9090409@domain.hid> Date: Wed, 08 Jun 2011 10:05:17 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <737283.11182.qm@domain.hid> In-Reply-To: <737283.11182.qm@domain.hid> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] Xenomai-Driver List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sanjay anvekar Cc: "xenomai@xenomai.org" On 06/08/2011 04:22 AM, sanjay anvekar wrote: > rt_task_yield() - To allow execution of other tasks. It is a bit hard to answer without seeing any code, but there is a simple remark we can make: rt_task_yield does not "allow execution of other tasks", rt_task_yield only allows execution of tasks with same priority as the current task. Your real-time tasks have to let Linux run from time to time if you want the serial port and graphic display to run correctly, and in order to do this they have to get suspended, rt_task_yield will definitely not do that. -- Gilles. From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <213583.55278.qm@domain.hid> References: <737283.11182.qm@domain.hid> <4DEF2D3D.9090409@domain.hid> Date: Tue, 21 Jun 2011 05:02:24 -0700 (PDT) From: sanjay anvekar MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-520288917-1308657744=:55278" Subject: Re: [Xenomai-help] Xenomai-Driver Reply-To: sanjay anvekar List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "xenomai@xenomai.org" --0-520288917-1308657744=:55278 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Gilles,=0A=A0=A0=A0=A0 Thanks for your reply. I am using 'rt_task_sleep(= 100us)' at the end of every task to let Linux task run.=0AWith this I am ab= le to run my application program , but I am not able to debug using 'GDB'. = Also is there any=0Abetter way to allow Linux task run instead of using 'rt= _task_sleep' ? My application has got 5 different task of =0A=0Aequal prior= ity and I want to run these in Round Robin fashion , I used 'rt_task_set_mo= de(0,XNRRB ,NULL)'=0Ato enable Round Robin scheduling mode, but task are no= t getting executed in Round Robin fashion. =0A=0AAm I missing something ? P= lease help me.=0A=0AThanks & Best Regards,=0ASanjay=0A=0A=0A=0A____________= ____________________=0AFrom: Gilles Chanteperdrix =0ATo: sanjay anvekar =0ACc: "xenomai-hel= p@domain.hid" =0ASent: Wednesday, 8 June 2011 1:35 PM=0A= Subject: Re: [Xenomai-help] Xenomai-Driver=0A=0AOn 06/08/2011 04:22 AM, san= jay anvekar wrote:=0A>=A0 =A0 =A0 rt_task_yield() - To allow=0A execution o= f other tasks.=0A=0AIt is a bit hard to answer without seeing any code, but= there is a=0Asimple remark we can make: rt_task_yield does not "allow exec= ution of=0Aother tasks", rt_task_yield only allows execution of tasks with = same=0Apriority as the current task. Your real-time tasks have to let Linux= run=0Afrom time to time if you want the serial port and graphic display to= run=0Acorrectly, and in order to do this they have to get suspended,=0Art_= task_yield will definitely not do that.=0A=0A-- =0A=A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 Gilles. --0-520288917-1308657744=:55278 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Gilles,
 = ;    Thanks for your reply. I am using 'rt_task_sleep( 100us)' at the end of every task to let Linux task run= .
With this I am able to run my application program = , but I am not able to debug using 'GDB'. Also is there any
better way to allow Linux task run instead of using 'rt_task_sleep'= ? My application has got 5 different task of
equal priority and I want to run these in Roun= d Robin fashion , I used 'rt_task_set_mode(0,XNRRB ,NULL)'
to enable Round Robin scheduling mode, but task are not getting exec= uted in Round Robin fashion.
Am I missing somet= hing ? Please help=0A me.

Thanks & Best Regards,
Sanjay
=


From: Gilles Chanteperd= rix <gilles.chanteperdrix@xenomai.org>
To: sanjay anvekar <sanjayanvekar@domain.hid>Cc: "xenomai@xenomai.org= " <xenomai@xenomai.org>
Sen= t: Wednesday, 8 June 2011 1:35 PM
Subject: Re: [Xenomai-help] Xenomai-Driver
=
On 06/08/2011 04:22 AM, sanjay anvekar wrote:
>    &nbs= p; rt_task_yield() - To allow=0A execution of other tasks.

It is a b= it hard to answer without seeing any code, but there is a
simple remark = we can make: rt_task_yield does not "allow execution of
other tasks", rt= _task_yield only allows execution of tasks with same
priority as the cur= rent task. Your real-time tasks have to let Linux run
from time to time = if you want the serial port and graphic display to run
correctly, and in= order to do this they have to get suspended,
rt_task_yield will definit= ely not do that.

--
            &n= bsp;                     =                      = ;         Gilles.



--0-520288917-1308657744=:55278-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4E01050D.8000800@domain.hid> Date: Tue, 21 Jun 2011 22:54:37 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <737283.11182.qm@domain.hid> <4DEF2D3D.9090409@domain.hid> <213583.55278.qm@domain.hid> In-Reply-To: <213583.55278.qm@domain.hid> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] Xenomai-Driver List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sanjay anvekar Cc: "xenomai@xenomai.org" On 06/21/2011 02:02 PM, sanjay anvekar wrote: > Hi Gilles, Thanks for your reply. I am using 'rt_task_sleep(100us)' > at the end of every task to let Linux task run. With this I am able > to run my application program , but I am not able to debug using > 'GDB'. What happens when you try and debug with gdb? > Also is there any better way to allow Linux task run instead > of using 'rt_task_sleep' ? My application has got 5 different task of First, the application should wait interrupts and react upon them, not do any polling, this should normally leave some time for Linux to run if the system is well dimensioned. > > > equal priority and I want to run these in Round Robin fashion , I > used 'rt_task_set_mode(0,XNRRB ,NULL)' to enable Round Robin > scheduling mode, but task are not getting executed in Round Robin > fashion. I do not think round-robin is what you want: it will not let linux run. rt_task_set_mode probably returns an error when you use XNRRB, because it does not expect this bit to be set. -- Gilles. From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <858255.34222.qm@domain.hid> References: <737283.11182.qm@domain.hid> <4DEF2D3D.9090409@domain.hid> <213583.55278.qm@domain.hid> <4E01050D.8000800@domain.hid> Date: Tue, 21 Jun 2011 20:29:04 -0700 (PDT) From: sanjay anvekar In-Reply-To: <4E01050D.8000800@domain.hid> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-661161965-1308713344=:34222" Subject: Re: [Xenomai-help] Xenomai-Driver Reply-To: sanjay anvekar List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: "xenomai@xenomai.org" --0-661161965-1308713344=:34222 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Gilles,=0A=A0=A0=A0=A0 Thanks for your reply. With GDB I am able to run = the application but it never hits configured breakpoints=0Aand it takes lit= tle longer time to start application. I tried changing priority of tasks, b= ut it didn't help.=0AIn my application program I have not configured any in= terrupts and completely dependent on Linux drivers.=0AIf I do not use rt_ta= sk_sleep() my program does not work correctly. I tried to suspend each task= instead of =0A=0Ausing rt_task_sleep and resume them in shadow task but so= me how it did not work .=0A=0A'rt_task_set_mode(0,XNRRB ,NULL)' didn't retu= rn any error , but when I tried with T_RRB parameter=0Ainstead of XNRRB it = failed.=0A=0ABest Regards,=0ASanjay=0A=0A=0A=0A=0A_________________________= _______=0AFrom: Gilles Chanteperdrix =0AT= o: sanjay anvekar =0ACc: "xenomai@xenomai.org" =0ASent: Wednesday, 22 June 2011 2:24 AM=0ASubject: Re:= [Xenomai-help] Xenomai-Driver=0A=0AOn 06/21/2011 02:02 PM, sanjay anvekar = wrote:=0A> Hi Gilles, Thanks for your reply. I am using 'rt_task_sleep(100u= s)'=0A> at the end of every task to let Linux task run. With this I am able= =0A> to run my application program , but I am not able to debug using=0A> '= GDB'.=0A=0AWhat happens when you try and debug with gdb?=0A=0A> Also is the= re any better way to allow Linux task run instead=0A> of using 'rt_task_sle= ep' ? My application has got 5 different task of=0A=0AFirst, the applicatio= n should wait interrupts and react upon them, not=0Ado any polling, this sh= ould normally leave some time for Linux to run if=0Athe system is well dime= nsioned.=0A=0A> =0A> =0A> equal priority and I want to run these in Round R= obin fashion , I=0A> used 'rt_task_set_mode(0,XNRRB ,NULL)' to enable Round= Robin=0A> scheduling mode, but task are not getting executed in Round Robi= n=0A> fashion.=0A=0AI do not think round-robin is what you want: it will no= t let linux run.=0Art_task_set_mode probably returns an error when you use = XNRRB, because=0Ait does not expect this bit to be set.=0A=0A-- =0A=A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Gilles. --0-661161965-1308713344=:34222 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Gilles,=
     Thanks for your reply. Wit= h GDB I am able to run the application but it never hits configured breakpo= ints
and it takes little longer time to start applic= ation. I tried changing priority of tasks, but it didn't help.
=
In my application program I have not configured any interrupts a= nd completely dependent on Linux drivers.
If I do no= t use rt_task_sleep() my program does not work correctly. I tried to suspen= d each task instead of
using rt_task_sleep and = resume them in shadow task but some how it did not work .
<= div>'rt_task_set_mode(0,XNRRB ,NULL)' didn't return any error = , but when I tried with T_RRB parameter
instead of XNRRB it failed.

Best Regards,
Sanjay
<= pre style=3D"margin-left: 24pt;">
<= br>

= From: Gilles Chanteperdrix &l= t;gilles.chanteperdrix@xenomai.org>
To: sanjay anvekar <sanjayanvekar@domain.hid>
Cc: "xenomai@xenomai.org" <= xenomai@xenomai.org>
Sent: Wednesday, 22 June 2011 2:24 AM
Subject:= Re: [Xenomai-help] Xenomai-Driver

On 06/21/2011 02:02 PM= , sanjay anvekar wrote:
> Hi Gilles, Thanks for your reply. I am usin= g 'rt_task_sleep(100us)'
> at the end of every task to let Linux task= run. With this I am able
> to run my application program , but I am = not able to debug using
> 'GDB'.

What happens when you try and= debug with gdb?

> Also is there any better way to allow Linux ta= sk run instead
> of using 'rt_task_sleep' ? My application has got 5 = different task of

First, the application should wait interrupts and = react upon them, not
do any polling, this should normally leave some tim= e for Linux to run if
the system is well dimensioned.

>
&g= t;
> equal priority and I want to run these in Round Robin fashion ,= I
> used 'rt_task_set_mode(0,XNRRB ,NULL)' to enable Round Robin
> scheduling mode, but task are not getting executed in Round = Robin
> fashion.

I do not think round-robin is what you want: = it will not let linux run.
rt_task_set_mode probably returns an error wh= en you use XNRRB, because
it does not expect this bit to be set.

= --
                   = ;                     &nb= sp;                     &= nbsp; Gilles.


--0-661161965-1308713344=:34222-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4E019368.9020800@domain.hid> Date: Wed, 22 Jun 2011 09:02:00 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <737283.11182.qm@domain.hid> <4DEF2D3D.9090409@domain.hid> <213583.55278.qm@domain.hid> <4E01050D.8000800@domain.hid> <858255.34222.qm@domain.hid> In-Reply-To: <858255.34222.qm@domain.hid> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] Xenomai-Driver List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sanjay anvekar Cc: "xenomai@xenomai.org" On 06/22/2011 05:29 AM, sanjay anvekar wrote: > Hi Gilles, Thanks for your reply. With GDB I am able to run the > application but it never hits configured breakpoints and it takes > little longer time to start application. I tried changing priority of > tasks, but it didn't help. In my application program I have not > configured any interrupts and completely dependent on Linux drivers. > If I do not use rt_task_sleep() my program does not work correctly. I > tried to suspend each task instead of Without seeing any code it is hard to give any definite answer, but from the way you describe it, you do not need Xenomai: as soon as a real-time thread uses a Linux driver, it is no longer deterministic. A typical real-time application waits for an external event, be it a timer event or a real-time driver, and so suspend naturally to let Linux run. -- Gilles.