FreeRTOS Support Archive

The FreeRTOS support forum can be used for active support both from Amazon Web Services
and the community. In return for using our software for
free, we request you play fair and do your bit to help others! Sign up
to receive notifications of new support topics then help where you can.

This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.

Interrupt vectors - Porting to STR75x/Rowley

I'm working on porting FreeRTOS over to an existing STR75x based hardware platform and I'm using the Rowley Crossworks tools.

I've got the basics converted over from the STR75x RIDE/GCC port but I'm not sure what the best way to get the interrupt vectoring working is. I've used the Rowley/SAM7 FreeRTOS port on another project and after reviewing it, it appears that the vectoring functions are included in the Atmel supplied libraries.

The work I've done in the past with Rowley and the STR75x used no RTOS and in that case, I used the Rowley ctl library functions for configuring vectors. The STR75x RIDE demo used a startup file from ST with modifications from Raisonance and FreeRTOS and I'm not sure what the beset way to proceed is.

RE: Interrupt vectors - Porting to STR75x/Rowley

The important thing with FreeRTOS is that there are no instructions prior to portSAVE_CONTEXT being called. At least if there are instructions then all registers are put back to their interrupted state before portSAVE_CONTEXT is called.

There are two methods of doing this on the LPC2000 and SAM7 and I guess the same is true for STR75x.

The first method is to vector directly to the interrupt handler, and have the handler save and restore the context. This is the sort of thing described on the following page http://www.freertos.org/portlpc2106.html. Scroll down to the section headed "Interrupt service routines". When this technique is used the IRQ vector must go directly to the handler. So the IRQ vector loads the handler address directly from the interrupt controller. So using the LPC2000 as an example, the vector table looks like this:

with the line ldr pc, [pc,#-0xFF0] being the IRQ vector loading the program counter with the address provided by the interrupt controller.

The second technique is to have a single IRQ handler entry point that calls portSAVE_CONTEXT first, then looks at the interrupt controller to find the address of the application handler, jumps to the handler, then returns to the single entry point to restore the context of the new task. This is also demonstrated in the FreeRTOS download. Look at the crt0_STR75x_FreeRTOS.s file in the Demo\ARM7_STR75x_GCC\SystemFiles directory and you will see how this is done. In this file the vector table looks like this