help with freertos Interrupt Handlers in IAR

nobody wrote on Monday, December 05, 2005:

im using IAR dev environment with the str711 controller and im fairly new to the freeRtos environment.  Im trying to port my application to be used with freeRtos.  Everything is compiling ok, but whats left to do is the interrupt handling. so far i have the uart handlers figured out (that was included with the demo) but more importantly im trying to get my USB along with a couple of timers working.  Anybody have any tips on how or what interrupt handling is required for the usb, or any pointers on how to write the handlers properly with the rtos ?  at the moment all the interrupt handlers except the uarts are handled by a DefaultISR which does nothing.

thanks for any help.

rtel wrote on Monday, December 05, 2005:

The peripheral details of the chip you are using are somewhat out of scope of this thread - but here are some general tips.

+ Make sure that you are using the startup and interrupt vectoring code supplied with the FreeRTOS ST ports.  This will ensure that the interrupts are entered correctly and that the required stacks are setup.  By default only the IRQ and Supervisor stacks are allocated any memory.  You can allocate some to others if required.

+ The USB handlers can follow the same model as per the UART.  The same rules apply, as detailed on the ST port documentation page.  You can take a look at the SAM7 sample USB drivers for guidance also.  Sample USB drivers for both HID and CDC classes are included in the download for the SAM7.

+ Remember that the sample drivers all use a queue mechanism to pass data out of the ISR.  When this is done it allows you to prioritise your ISR’s by waking a task within the ISR that executes immediately that the ISR completes.  However if you have no requirement to do this then a simple circular buffer may be more efficient.

+ Remember to keep the ISR very short - simply collect the data, then process the data within a task.

Regards.