All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Xenomai-Driver
@ 2011-06-08  2:22 sanjay anvekar
  2011-06-08  8:05 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: sanjay anvekar @ 2011-06-08  2:22 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

Hi,
     I am facing little problem with Xenomai tasks. Please help me.
I am using Xenomai 2.5.6 patched to Kernel 2.6.37 on Intel Atom board with display and touch
interface. I have created an application which uses various Linux Drivers such as
Serial Driver - Configured and used using tty layer.
Display driver - Intel Frame buffer interface (mmap and ioctl).
Socket Programming 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 Serial
interface and display. Serial data seems to be loosing data and display update is not happening instantly.
I am sure I am missing something. Please help me to
 resolve this issue.
I am using following functions to create and maintain Xenomai tasks and tasks are successfully created.
     
     mlockall(MCL_CURRENT | MCL_FUTURE);
     rt_task_set_mode(0, T_WARNSW , NULL);
     rt_task_create();
     rt_task_start()
     rt_task_yield() - To allow execution of other tasks.

Thanks & Best Regards,
Sanjay

[-- Attachment #2: Type: text/html, Size: 1980 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai-help] Xenomai-Driver
  2011-06-08  2:22 [Xenomai-help] Xenomai-Driver sanjay anvekar
@ 2011-06-08  8:05 ` Gilles Chanteperdrix
  2011-06-21 12:02   ` sanjay anvekar
  0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2011-06-08  8:05 UTC (permalink / raw)
  To: sanjay anvekar; +Cc: xenomai

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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai-help] Xenomai-Driver
  2011-06-08  8:05 ` Gilles Chanteperdrix
@ 2011-06-21 12:02   ` sanjay anvekar
  2011-06-21 20:54     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: sanjay anvekar @ 2011-06-21 12:02 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

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 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. 

Am I missing something ? Please help me.

Thanks & Best Regards,
Sanjay



________________________________
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.orgomai.org>
To: sanjay anvekar <sanjayanvekar@domain.hid>
Cc: "xenomai-help@domain.hid" <xenomai@xenomai.org>
Sent: Wednesday, 8 June 2011 1:35 PM
Subject: Re: [Xenomai-help] Xenomai-Driver

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.

[-- Attachment #2: Type: text/html, Size: 3052 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai-help] Xenomai-Driver
  2011-06-21 12:02   ` sanjay anvekar
@ 2011-06-21 20:54     ` Gilles Chanteperdrix
  2011-06-22  3:29       ` sanjay anvekar
  0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2011-06-21 20:54 UTC (permalink / raw)
  To: sanjay anvekar; +Cc: xenomai

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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai-help] Xenomai-Driver
  2011-06-21 20:54     ` Gilles Chanteperdrix
@ 2011-06-22  3:29       ` sanjay anvekar
  2011-06-22  7:02         ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: sanjay anvekar @ 2011-06-22  3:29 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 2107 bytes --]

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 

using rt_task_sleep and resume them in shadow task but some how it did not work .

'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




________________________________
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: sanjay anvekar <sanjayanvekar@domain.hid>
Cc: "xenomai@xenomai.org" <xenomai-help@domain.hid>
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 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.

[-- Attachment #2: Type: text/html, Size: 3485 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai-help] Xenomai-Driver
  2011-06-22  3:29       ` sanjay anvekar
@ 2011-06-22  7:02         ` Gilles Chanteperdrix
  0 siblings, 0 replies; 6+ messages in thread
From: Gilles Chanteperdrix @ 2011-06-22  7:02 UTC (permalink / raw)
  To: sanjay anvekar; +Cc: xenomai

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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-06-22  7:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-08  2:22 [Xenomai-help] Xenomai-Driver sanjay anvekar
2011-06-08  8:05 ` Gilles Chanteperdrix
2011-06-21 12:02   ` sanjay anvekar
2011-06-21 20:54     ` Gilles Chanteperdrix
2011-06-22  3:29       ` sanjay anvekar
2011-06-22  7:02         ` Gilles Chanteperdrix

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.