[ECOS] Creating Interrupt Routines

Bart Veer bartv@ecoscentric.com
Mon Nov 1 23:08:00 GMT 2004

>>>>> "Steve" == Steve Knowlton <sknowlton@custom-mfg-eng.com> writes:

    Steve> I am writing an serial driver application that uses it's
    Steve> own interrupt routine. I am trying to steal the vector away
    Steve> from Redboot so that I can install my own.

    Steve> When I use the HAL_INTERRUPT_IN_USE function, it returns a
    Steve> state of 1 which means that the interrupt vector for the
    Steve> serial port is in use, I am assuming by Redboot.

    Steve> How do you reassign the vector to a different ISR, DSR that
    Steve> you wrote yourself? I saw functions for get_vsr, set_vsr,
    Steve> detach, etc. I am not sure how to go about doing this? If
    Steve> anyone has some experience with this, it would sure make my
    Steve> life easier.

First, you almost certainly don't want to use VSRs. Those are intended
to let you bypass the eCos interrupt handling completely, for
situations where you need maximum performance.

The exact details of interrupt handling and HAL_INTERRUPT_IN_USE() are
at best architecture-specific, sometimes variant-specific or
processor-specific. However typically RedBoot will not have installed
an ISR for the serial port. Instead it works through hal_default_isr()
in the common HAL.

Instead I suspect that your configuration already includes a serial
driver, and support for the serial port of interest has been enabled.
Hence the eCos serial driver will claim the interrupt vector, and it
is no longer available to your application.

If that is not the case you'll need to look at how
HAL_INTERRUPT_IN_USE() is implemented for your platform, then use gdb
to see what is actually happening.


Bart Veer                       eCos Configuration 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

More information about the Ecos-discuss mailing list