Quality RTOS & Embedded Software

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




Loading

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. */
AT91C_BASE_AIC->AIC_EOICR = 0;
}


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




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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

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

OpenRTOS and SafeRTOS