263
Philips Semiconductors
Preliminary User Manual
LPC2119/2129/2292/2294
ARM-based Microcontroller
Handling exceptions
This section describes the importance of sharing exception handlers between RealMonitor and user application.
RealMonitor exception handling
To function properly, RealMonitor must be able to intercept certain interrupts and exceptions. Figure 53 illustrates how exceptions
can be claimed by RealMonitor itself, or shared between RealMonitor and application. If user application requires the exception
sharing, they must provide function (such as
app_IRQDispatch
()
). Depending on the nature of the exception, this handler can
either:
• pass control to the RealMonitor processing routine, such as rm_irqhandler2
()
• claim the exception for the application itself, such as
app_IRQHandler
()
.
In a simple case where an application has no exception handlers of its own, the application can install the RealMonitor low-level
exception handlers directly into the vector table of the processor. Although the irq handler must get the address of the Vectored
Interrupt Controller. The easiest way to do this is to write a branch instruction
(<
address
>
) into the vector table, where the target
of the branch is the start address of the relevant RealMonitor exception handler.
Figure 53: Exception Handlers
Reset
Undef
SWI
Prefetch Abort
Data Abort
Reserved
IRQ
FIQ
Real Monitor supplied exception vector handlers
Sharing irqs between RealMonitor and User IRQ handler
rm_irqhandler2()
app_irqDispatch
App_IRQHandler()
or
rm_undef_handler()
rm_prefetchabort_handler()
rm_dataabort_handler()
rm_irqhandler()