Skip to contentSkip to conversation

Xenomai-Driver

Xenomai-help sanjay anvekar 2 participants 6 messages Jun 8, 2011 – Jun 22, 2011

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 1 line · sanjay anvekar

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.

Signature · 1 line
                                                                Gilles.
#2 lore raw

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 <[email protected]>
To: sanjay anvekar <[email protected]>
Cc: "[email protected]" <[email protected]>
Sent: Wednesday, 8 June 2011 1:35 PM
Subject: Re: [Xenomai-help] Xenomai-Driver

Quoted 1 line · sanjay anvekar

      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.

Signature · 1 line
                                                                Gilles.
#3 lore raw
Quoted 4 lines · sanjay anvekar

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?

Quoted 2 lines

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.

Quoted 6 lines

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.

Signature · 1 line
                                                                Gilles.
#4 lore raw

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 <[email protected]>
To: sanjay anvekar <[email protected]>
Cc: "[email protected]" <[email protected]>
Sent: Wednesday, 22 June 2011 2:24 AM
Subject: Re: [Xenomai-help] Xenomai-Driver

Quoted 4 lines · sanjay anvekar

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?

Quoted 2 lines

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.

Quoted 6 lines

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.

Signature · 1 line
                                                                Gilles.
#5 lore raw
Quoted 7 lines · sanjay anvekar

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.

Signature · 1 line
                                                                Gilles.