Hi,
Can someone help me with my xenomai problem?
I've patched correctly xenomai 2.6.3 on a vanilla kernel 3.8.13 on a
Pentium M 740 (1.73 GHz) 1 Gb RAM with last Xubuntu OS.
I've used an rt_task_set_periodic() timer to create a loop in which every 2
ms my thread does something. It works well but i ve some problem with RTIME
stamp.
Following an example found in the xenomai help forum i've tried a simple
program to print every second with rt_printf using rt_timer_read():
--------------------------------------------------------------------------------------------------------------------------------------------
#include <signal.h>
#include <sys/mman.h>
#include <native/task.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
#include <unistd.h>
#include <rtdk.h>
RT_TASK demo_task;
int count = 0;
RTIME k_time;
void demo(void *arg)
{
rt_task_set_periodic(NULL, TM_NOW, 1000000000);
while (count<10) {
rt_printf("%llu\n", k_time);
rt_task_wait_period(NULL);
k_time = rt_timer_read();
count++;
}
}
void catch_signal(int sig) {
rt_task_delete(&demo_task);
printf("In ::catch_signal(), sig == %d\n",sig);
}
int main(int argc, char* argv[])
{
signal(SIGINT, catch_signal);
rt_print_auto_init(1);
mlockall(MCL_CURRENT | MCL_FUTURE);
rt_task_create(&demo_task, "mydemo", 0, 99, 0);
rt_task_start(&demo_task, &demo, NULL);
pause();
rt_task_delete(&demo_task);
return 0;
}
------------------------------------------------------------------------------------------------------------------------------------------------
My results are very strange so i suppose that something in my TSC is not so
good.
Results:
-----------------------------------------------------------
0
18446744073446329852
736770608
1736771638
18446744072151357874
18446744073151357892
441806040
1441805091
18446744071856389894
18446744072856387160
-------------------------------------------------------------
How is it possible? Can someone help me to fix it?
Thank you,
Simone
ps: I attach my config file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config-3.8.13
Type: application/octet-stream
Size: 149238 bytes
Desc: not available
URL:
<http://www.xenomai.org/pipermail/xenomai/attachments/20140117/99288f92/attachment.obj>
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai