I am running the timer class example on real hardware (Sparc/Leon2) with
printing on console.
Timer1 and 2 service routines are each set with a 2 seconds interval,
but I noticed that
after 2 fireouts, time between 2 LED_ON (or LED OFF) prints becomes 4
seconds.
To illustrate this, I put a rtems_time_of_day global variable named
"now" in the source code to use it to print time.
Here is the corresponding output :
*** LED BLINKER -- timer ***
LED ON 00:00:00
01/01/2009
LED OFF 00:00:01
01/01/2009
LED ON 00:00:02
01/01/2009
LED OFF 00:00:03
01/01/2009
LED ON 00:00:05
01/01/2009
LED OFF 00:00:07
01/01/2009
LED ON 00:00:09
01/01/2009
LED OFF 00:00:11
01/01/2009
LED ON 00:00:13
01/01/2009
LED OFF 00:00:15
01/01/2009
LED ON 00:00:17 01/01/2009
I also noticed that if I comment the line calling Timer2 service routine
Timer_Routine(Timer2, NULL);
in the Init task, then Timer1 is called twice and then it stops, no
print anymore.
*** LED BLINKER -- timer ***
LED ON 00:00:00
01/01/2009
LED ON 00:00:02
01/01/2009
Can someone help me and give some explanation of what seems strange to me ?
Thank you in advance.
Pierre Kestener.
_______________________________________________
rtems-users mailing list
rtems...@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-users
I have tried different couples RTEMS toochain / RTEMS src :
- 4.9.0 from rtems.org
- RCC 1.1.1 from Gaisler (RTEMS scr 4.8)
- RCC 1.1.99.1 from Gaisler (downloaded in Feb 2009)
- RCC 1.1.99.3 from Gaisler (downloaded today)
the problem described below only appears with the latest Gaisler
toolchain/src 1.1.99.x
everything is fine when using the release toolchain/src 4.9.0 (from
rtems.org) or with the older Gaisler toolchain/src couple.
I haven't tried a more recent toolchain/src neither the CVS sources.
Pierre.
pierre kestener a écrit :
The problem can be reproduced using the Sparc/SIS simulator target
with the latest CVS sources and the 4.10 toolchain. However the problem
disappears
when falling back to RTEMS version 4.9.
Can someone confirm he has the same wrong output as me for this test
using the SIS target ?
Wrong output of timer class example (withthe only modification to have a
print_time following each LED print) :
*** LED BLINKER -- timer ***
LED OFF 00:00:01
LED ON 00:00:02
LED OFF 00:00:03
LED ON 00:00:05
LED OFF 00:00:07
LED ON 00:00:09
LED OFF 00:00:11
LED ON 00:00:13
LED OFF 00:00:15
LED ON 00:00:17
The first LED_ON is missing.
Moreover it looks like after a while, the 2 timers are "sequentialized"
instead of interleaved.
Pierre Kestener.
pierre kestener a écrit :
That would indicate an issue with the task timer server code
that is likely version independent.
Please confirm this setting for your "works" and "broken" cases.
FWIW you can also do this to get the time stamp:
{ struct timespec uptime;
rtems_clock_get_uptime( &uptime );
fprintf( stderr, " %d:%d\n", uptime.tv_sec, uptime.tv_nsec );
}
rtems_clock_get_uptime() is fairly new but handy. :)
--joel
The problem certainly is with the timer server code. I'll try to have a
look there.
Pierre.
Joel Sherrill a écrit :
--
+--------------------------------------------------------+
Pierre KESTENER
CEA Saclay -- DSM/IRFU/SEDI/TRAPS
91191 Gif-sur-Yvette - FRANCE
tel : +33 (0)1 69 08 57 09
fax : +33 (0)1 69 08 31 47
http://pierre.kestener.org/
+--------------------------------------------------------+
The issue is that the timers were rescheduling themselves
when they fire and the insertions for the timer server are
processed ONLY at specific times in the server.
It would help to have a small test to add to the suite that
checks this behavior works and stays working. If you could
write that, I would personally be very grateful. Just follow
the style of the sptests. More tests is a good thing. :)
Thanks.
--joel
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.s...@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
Would you mind filing a PR on this so you get notifications?
--joel
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.s...@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985