# help with freertos Interrupt Handlers in  IAR

**URL:** <https://forums.freertos.org/t/help-with-freertos-interrupt-handlers-in-iar/3692>\
**Category:** Kernel\
**Created:** [December 5, 2005, 10:30am UTC](https://forums.freertos.org/t/help-with-freertos-interrupt-handlers-in-iar/3692 "2005-12-05T10:30:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 5, 2005, 10:30am UTC](https://forums.freertos.org/t/help-with-freertos-interrupt-handlers-in-iar/3692/1 "2005-12-05T10:30:55Z")

</div>

**nobody** wrote on [Monday, December 05, 2005](https://sourceforge.net/p/freertos/discussion/382005/thread/a5f61a59/#1ac7):

im using IAR dev environment with the str711 controller and im fairly new to the freeRtos environment.&nbsp; Im trying to port my application to be used with freeRtos.&nbsp; 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.&nbsp; 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 ?&nbsp; at the moment all the interrupt handlers except the uarts are handled by a DefaultISR which does nothing.

thanks for any help.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [December 5, 2005, 10:42am UTC](https://forums.freertos.org/t/help-with-freertos-interrupt-handlers-in-iar/3692/2 "2005-12-05T10:42:44Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, December 05, 2005](https://sourceforge.net/p/freertos/discussion/382005/thread/a5f61a59/#1ac7/62c7):

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.&nbsp; This will ensure that the interrupts are entered correctly and that the required stacks are setup.&nbsp; By default only the IRQ and Supervisor stacks are allocated any memory.&nbsp; You can allocate some to others if required.

+ The USB handlers can follow the same model as per the UART.&nbsp; The same rules apply, as detailed on the ST port documentation page.&nbsp; You can take a look at the SAM7 sample USB drivers for guidance also.&nbsp; 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.&nbsp; 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.&nbsp; 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.
