This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Strange timer interrupt on i386


"Fabian Scheler" <Fabian.Scheler@gmx.de> writes:

> Hello,
> 
> I use an eCos-configuration that is very similar to the i386 VMware default
> template, some of the options are disabled (Realtimeclock (kernel),
> Exception Handling, Priority Ceiling, Timeslicing ... all of them belong to
> the eCos kernel) and I use ReeBoot (the RedBoot template for i386
> VMware) to load my application-binary to the
> target. The important thing is that there should be no need to program the
> timer used for the RealtimeClock (the one that is also used for timeslicing)
> within the eCos-configuration.
> 
> In cyg_user_start() I unmask the vector of the RTC (32), because I want to
> trigger an interrupt synchronously from my application later on. When the
> first thread is scheduled and the interrupts get enabled, an interrupt
> caused by the RTC arrives. This also happens when I don't attach any
> interrupt handlers to this vector, t.m. also when only the default isr
> is attached, but the RTC should not have been programmed before and thus
> cause no interrupt.
> When I program the RTC (single shot interrupt) again inside cyg_user_start
> no interrupt occurs at all, neither when scheduling the first thread nor
> when triggering the interrupt (t.m. programming the RTC again (single shot))
> inside the first thread.
> 
> Is it possible that RedBoot programmed the RTC? In hal_platform_init() the
> macro HAL_CLOCK_INITIALIZE() is used.  What does RedBoot need the RTC for?
> 
> Has anybody an idea? All hints are appreciated. Thanks in advance.


RedBoot will initialize the timer, since it needs to be able to keep
track of time for timeouts and delays. Normally eCos will reprogram
the timer and set up its own ISR when it starts. If you have disabled
that, then the initialization by RedBoot will cause an interrupt,
usually immediately interrupts are enabled during the first context
switch.

I cannot explain why you are not getting any interrupts when you
reprogram the timer yourself, except to observe that the PIT is a
rather nasty piece of hardware, and you may not have initialized it
properly.




-- 
Nick Garnett                                     eCos Kernel Architect
http://www.ecoscentric.com                The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]