LPC236X nested interrupts

franco69 wrote on Monday, March 28, 2011:

Hello All

Can anyone give me some simple snipets code with FreeRtos and a couple of nested interrupts on LPC236x and IAR EWB?

I’m not sure if FreeRTOS supposrts nested interrupt for LPC2000 devices.


davedoors wrote on Monday, March 28, 2011:

Nesting interrupts on ARM7 is horrendous. NXP have an application note telling you how to do it, but if you can, write your interrupts to be very quick by deferring the real interrupt processing to a high priority task.

franco69 wrote on Monday, March 28, 2011:

Thank’s for your reply DaveDoors!
well my problem is that I have an interrupt timer @1ms always on, seems that the uart interrupt is delaying the timer interrupt. My idea was to nest the uart interrupt. I’m trying to not wrap the uart interrupt  as freertos says and declare the function with the keywords of IAR as:  __irq __nested.
In this way seems to me that the timer interrupt should be able to nest the uart isr.

I’ll try tommorrow at work and se if it work. If you wish some feedback on it. Just tell.


franco69 wrote on Monday, March 28, 2011:

this is from freertos website:

Interrupt service routines
An interrupt service routine that does not cause a context switch has no special requirements and can be written as per the normal IAR syntax. For example:

    static __arm __irq void vAnISR( void )
        /* ISR C code goes here. */

        /* End the interrupt in the VIC. */
        VICVectAddr = 0;

Often you will require an interrupt service routine to cause a context switch. For example a serial port character being received may wake a high priority task that was blocked waiting for the character. If the ISR interrupted a lower priority task then it should return immediately to the woken task. Limitations in the IAR inline assembler necessitate such interrupt service routines include an assembly file wrapper.

at this point i can declare the uartisr as
static __arm __irq __nested  void uartISR( void )

and this should enable the nesting of the uart isr.
Of course in uart ISR no RTOS calling.
Is there something wrong?