Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


CDC demo for IAR?

Posted by Nobody/Anonymous on September 1, 2005
Thanks very much for releasing the new version. I see the new USB CDC files.

Do you have them integrated into the AT91sam7S65 IAR environment?

My first attempts to compile them get tangled up with portENTER_SWITCHING_ISR() not being defined for IAR. Also the AT91F_AIC_ConfigureIt() arguments in USB-CDC.c don't compile when dropped into the IAR demo.

RE: CDC demo for IAR?

Posted by Richard on September 1, 2005
Interrupt service routines require different syntax between GCC and IAR.

GCC has a very powerful inline assembler, meaning the entire ISR can be written in C by simply calling the save and restore context macros.

IAR on the other hand does not have the same inline assembler capabilities, and therefore requires an ASM wrapper for the ISRs.

Also the macro used to cause a context switch at the end of the ISR is different.

See the “Interrupt service routines” section of the page http://www.freertos.org/portsam7xlwIP.html for an explanation of the required GCC syntax, and the “Interrupt service routines” section of http://www.freertos.org/portsam7iar.html for an explanation of the required IAR syntax. It is a small task to convert the provided GCC function to the IAR syntax. You can also copy the syntax from the existing USB hid demo in the files FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/USB/USBSample.c and FreeRTOS/Demo/ARM7_AT91SAM7S64_IAR/USB/USB_ISR.s79.

Basically in IAR you want to use:

__arm void vUSB_ISR( void )
// Paste the code from the GCC CDC file here, all the
// code between but not including the ENTER and EXIT
// switching ISR macros.

/* We may want to switch to the USB task, if this message has made
it the highest priority task that is ready to execute. */
portEND_SWITCHING_ISR( xTaskWokenByPost );

/* Clear the AIC ready for the next interrupt. */

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists