Error in creating timer

manish jain manish8886 at gmail.com
Sun Apr 7 22:42:08 UTC 2013


I just have one more questions regarding the timer which I am not able to
find in the document. Now, with your help I am able to create the timer,
and for setting that up, I am using  "rtems_timer_fire_after" directive.
The status code returned by this function doesn't show any error, but my
"callback function" is not getting called. After looking in the definition
of function "rtems_timer_fire_after", I found that timer internally uses
"watchdog" functionality. Does that mean watchdog device driver required
for timer? I am working on sparc simulator, and I think the sparc bsp does
not have watchdog driver because I got linker error after including the
"CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER ".

Thanks
Manish


On Sun, Apr 7, 2013 at 6:18 PM, Joel Sherrill <joel.sherrill at oarcorp.com>wrote:

>  On 04/07/2013 03:32 PM, manish jain wrote:
>
>  Thanks Joel..
>  It is working now but while I used clock driver with timer I didn't get
> any compiler error..
>
>   I am glad to know that worked.
>
> I have a patch in my tree so next time someone will get a compile error.
> You can only specify one of need clock, need timer, or do not need clock.
> There were checks for having 0 defined but not > 1.
>
> --joel
>
>  Manish
>
>
>  On Sun, Apr 7, 2013 at 4:18 PM, Joel Sherrill <joel.sherrill at oarcorp.com>wrote:
>
>>  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
>>
>>
>
>
> --
> Joel Sherrill, Ph.D.             Director of Research& Developmentjoel.sherrill at OARcorp.com        On-Line Applications Research
> Ask me about RTEMS: a free RTOS  Huntsville AL 35806
> Support Available               (256) 722-9985
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20130407/4b4f34d9/attachment.html>


More information about the users mailing list