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: Bootup and Redboot


James Yates said:
> I am currently trying to get a custom board up and running with eCos and I am have hit a brick
> wall. It seems that as soon as the scheduler is started and interrupts are enabled, and the
> installed RTC causes and Interrupt, and exception is raised and the code dies. I believe the
> problem is with the Vector table/VSR table but can't figure out why.
>
> I assume that the each entry in the Vector table, the entry point for each available ISR, should
> point to the default VSR handler which then looks up to see if an interrupt has been attached to
> this and if so then call the relevant ISR.
> I am not running Redboot since I am required to use a custom bootloader. Am I right in saying that
> Redboot sets up the Vector table correctlt and so my bootloader should do the same. On startup,
> before the scheduler is started, I print out the vector table pointed to by the VBR.
> The first 32 entries correctly point at the default_exception_vsr but the entries for peripheral
> Interrupts don't seem to point to anything valid. So I initialise as part of the platform init
> these entries to point to the default VSR handler. Is this correct? I am really stuck and don't
> know where to go from here.  This is running on an SH2 platform.
>

The way most architectures work is that the hardware interrupt/exception
mechanism (pointed to by a VBR or other hardware) chooses which code to
execute when an exception or interrupt happens.  This code is referred to
as the "vector service routine" or VSR.  You'll need some standard VSR
handler - normally these are slightly different for exceptions and interrupts.
In the case of the interrupt VSR, that code needs to save the interrupt
context (state) in a way that the kernel can make use of it.  Then the
interrupt VSR needs to determine what the actual interrupt is.  Sometimes
this is implicit (i.e. there could be a separate VSR for each interrupt)
or it the interrupt may need to be determined explicitly, e.g. reading
an interrupt-pending register.  In any case, you need to distill the
interrupt condition down to the selector - a one of N choice which is
mapped by the HAL_INTERRUPT_xxx defines.  This selector is then used
to look up the "interrupt service routine" (ISR) from a table.  This
table should be filled with "default_ISR" so that you can always handle
an interrupt, even if the program has not registered an ISR.  The interrupt
VSR then calls the appropriate ISR, via that table lookup.

I suspect that you've left out some of this in your initialization.
True, RedBoot normally takes care of this, but it's not necessary at
all.  The eCos application can (and should!) handle this if there is
no known "ROM monitor" supporting it (CYGSEM_HAL_USE_ROM_MONITOR is
not set/defined).

Just OOI, why can't you use RedBoot?  What's special about the bootloader
you have to use?

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


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