RTEMS - rtems_clock_get_uptime() fails during timer tick

Rolf Schroedter rolf.schroedter at dlr.de
Wed Mar 2 14:38:04 UTC 2011

I don't know about ERC32.
For LEON2 I'm quite sure that the counter behaves the same like for
LEON3, however I don't know whether the LEON2 TIMER has a
InterruptPending bit.
Additionally, as Daniel pointed out, there is a change in the LEON3

I'm in contact with him to find a good, and perhaps general solution for


Joel Sherrill wrote, On 02.03.2011 15:19:
> You did indeed understand my question. So the interrupt pending bit is the only way to know.
> Does the ERC32 reset or count through 0? 
> I am sensing that some more advice needs to be added to the manual for this.
> --joel
> Rolf Schroedter <rolf.schroedter at dlr.de> wrote:
>> Joel Sherrill wrote, On 02.03.2011 14:25:
>>> Is it possible to just check if the counter value is greater than what we programmed it with and treat that as a special case in the clock driver?
>>> --joel
>> If I understand your question correctly, then the answer is: No.
>> The LEON has a counter reload register (=999 for a 1 milliseconds tick).
>> The hardware timer counter runs down from 999 to 0. On overrun it
>> reloads =999 and generates the timer interrupt.
>> So the timer counter will never be outside the 999...0 range.
>> Rolf.
>>> Rolf Schroedter <rolf.schroedter at dlr.de> wrote:
>>>> Problem report submitted, id=1748:
>>>> https://www.rtems.org/bugzilla/show_bug.cgi?id=1748
>>>> Rolf.
>>>> On 25.02.2011 14:36, Joel Sherrill wrote:
>>>>> On 02/25/2011 07:05 AM, Rolf Schroedter wrote:
>>>>>> Hi Manual,
>>>>>> Thanks for pointing to this thread.
>>>>>> Your solution for the ERC/LEON2 is very similar to my patch for LEON3.
>>>>>> However I noticed that these patches are still not included in the
>>>>>> actual RTEMS sources that can be downloaded from Gaisler.com.
>>>>> I never look at their source.  What they do is their own
>>>>> issue.  I just want to make sure the official RTEMS source
>>>>> is OK.
>>>>> --joel
>>>>>> Rolf.
>>>>>> On 25.02.2011 10:39, Manuel Coutinho wrote:
>>>>>>> Hi all
>>>>>>> This problem has been already addressed on another thread:
>>>>>>> http://www.rtems.com/ml/rtems-users/2009/march/msg00204.html
>>>>>>> Just my 2 cents
>>>>>>> Manuel Coutinho
>>>>>> _______________________________________________
>>>>>> rtems-users mailing list
>>>>>> rtems-users at rtems.org
>>>>>> http://www.rtems.org/mailman/listinfo/rtems-users

More information about the users mailing list