Error in creating timer
Joel Sherrill
joel.sherrill at OARcorp.com
Sun Apr 7 20:18:15 UTC 2013
On 04/07/2013 03:05 PM, manish jain wrote:
> Hi,
> I am just running a small Init task in which I am creating a "timer".
> But the status returned by the "rtems_timer_create" function is
> "RTEMS_TOO_MANY ". I think, this status is referring to a maximum
> numbers of objects already allocated. But in my task I am just
> creating one timer. Do I need to preconfigure before using the timer?
> For now I am using following macros:
>
> #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
> #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
> #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
>
> Can someone tell me what I might be missing? I am currently running my
> task on sparc sis simulator.
>
You can't configure the timer and clock driver at the same time.
This should have resulted in a compile time error. On most BSPs,
these use the same hardware so it is considered a general error.
Besides, the timer driver is for a "benchmark timer" used by
the RTEMS Timing Test Suites -- and they assume no clock tick.
I don't know why your initialization task needs floating point but
that is your application's requirement.
If you are creating a Classic API timer via the rtems_timer_create()
method, then you need to configure the system to account for
how many instances of Classic API Timers you need. Something
like this:
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
#define CONFIGURE_MAXIMUM_TIMERS 1
If you need more than one timer, then up that number.
If you want standard in, out and error to work (e.g. printf()), then
you should also have:
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
I just posted a re-write of the Configuring a System chapter in the
Users Guide. Everything you should need to know is in it and
hopefully better presented than the current version.
http://www.rtems.org/ftp/pub/rtems/people/joel/config-v1.pdf.bz2
The current version is terse where the new version includes
more information in a more structured fashion. :)
> Manish
>
--
Joel Sherrill, Ph.D. Director of Research& Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35806
Support Available (256) 722-9985
More information about the users
mailing list