Whats allowed in the Init() task
Matthew J Fletcher
amimjf at gmail.com
Fri Mar 1 17:39:30 UTC 2013
Hi,
Sorry all, i was placing breakpoints inside rtems which i have built with
-Os, so i got the wrong idea. Checking the return code from
rtems_clock_set() shows it works with the ticker example time setup.
I think my issue is that as soon as the 10ms ISR calls rtems_clock_tick()
no tasks get scheduled, not the idle routine, not even the Init() task.
When i halt execution in the debugger i only ever see the callstack from of
the ISR calling rtems_clock_tick();
I have a 20Mhz ARM7TDMI board so a 10ms call to rtems_clock_tick should
just take a few microseconds.
I use,.
#define CONFIGURE_MICROSECONDS_PER_TICK 10000
#define CONFIGURE_TICKS_PER_TIMESLICE 50
I guess there is some pre-requisite i need to setup before i call
rtems_clock_tick() the first time. I guessed it was having the clock set as
various bits of code check _TOD_Is_set but i call rtems_set_clock() before
i enable the tick ISR.
On 1 March 2013 17:10, Joel Sherrill <joel.sherrill at oarcorp.com> wrote:
> On 3/1/2013 10:56 AM, Matthew J Fletcher wrote:
>
> Gedare,
>
> Yes the "hello" example works fine. I just tried the "ticker" example, but
> rtems_clock_set() returns RTEMS_INVALID_CLOCK. Odd, maybe the samples dont
> get tested very often.
>
> They get run all the time. I am heading off for the weekend but will try
> to
> run it on something I have a simulator for.
>
> It _TOD_Validate() is rejecting the time set in the example, and i am
> literally using the code from the example. Its returning false at the first
> 'if' test, the big one checking against the constants.
>
> Is the test for 'the_tod->year < TOD_BASE_YEAR' correct given then are
> equal at 1988 ?
>
> Yes.
>
>
> On 1 March 2013 15:40, Gedare Bloom <gedare at rtems.org> wrote:
>
>> On Fri, Mar 1, 2013 at 9:07 AM, Matthew J Fletcher <amimjf at gmail.com>
>> wrote:
>> > Hi,
>> >
>> > Do rtems applications normally create a new task straight away in
>> Init() ? i
>> > ask because i seem to get stuck with no threads being scheduled after
>> the
>> > first Clock_isr.
>> >
>> By the time Init gets executed the entire application stack should be
>> set up and multithreading/interrupts should work fine. Init can either
>> create new tasks, or execute the workload directly.
>>
>> > So after boot_card() completes rtems context switches into Init(),
>> there i
>> > setup my 10ms tick ISR which calls rtems_clock_tick(). But the original
>> > thread Init() never gets scheduled again after the first call to
>> > rtems_clock_tick(). I've used JTAG to place breakpoints and i can see
>> the
>> > code in Init() is not being run.
>> >
>> I don't understand what you mean about Init setting up the clock tick.
>> The ISR for clock handling should be installed during rtems
>> initialization when the clock driver is installed. Have you
>> successfully executed the "hello" sample on your board? If so the next
>> one to test is ticker, which should give you an idea of whether the
>> clock tick + context switch is working.
>>
>> -Gedare
>>
>> > I can see the ISR is being called and the interrupt acknowledged due to
>> > breakpoints there.
>> >
>> > Interestingly although i am using the arm-rtemseabi4.11-gdb 'info
>> threads'
>> > only shows the current context of the ISR not the Init() thread, that
>> might
>> > be a different issue though.
>> >
>> >
>> > regards
>> > ---
>> > Matthew J Fletcher
>> >
>> >
>> > _______________________________________________
>> > rtems-users mailing list
>> > rtems-users at rtems.org
>> > http://www.rtems.org/mailman/listinfo/rtems-users
>> >
>>
>
>
>
> --
>
> regards
> ---
> Matthew J Fletcher
>
>
>
> --
> 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 35805
> Support Available (256) 722-9985
>
>
--
regards
---
Matthew J Fletcher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20130301/9cdc39ae/attachment-0001.html>
More information about the users
mailing list