Quality RTOS & Embedded Software

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


__inline, ARM7 and IAR compiler

Posted by mike on December 11, 2007
Hello All

I am using the IAR ewarm (4.42a) with freeRTOS 4.5.0 at present, and am looking into using some __inline functions.

I find that portmacro.h for the IAR compiler and at91sam7s includes #define inline in Compiler specifics, so that I still don't get inlining even with #define __inline inline added.

If I comment out the #define in portmacros.h the compiler objects to two basic functions:vTaskSwitchContext and vTaskIncrementSwitch, both apparently because they are declared as __inline in the header file, and defined in the source file the same way, which the IAR compiler doesn't seem able to cope with.

To keep rolling on I have commented out the __inline tags, but this doesn't seem the correct way forward.

Do these functions need to be __inline? Is inlining significant in gaining speed of operation?

Any thoughts welcomed

Mike Newsome

Hitek Power Ltd, England

RE: __inline, ARM7 and IAR compiler

Posted by Richard on December 11, 2007
The inline thing is a legacy from one of the first ports and is a PITA now. It should be removed.

The #define in portmacro.h is to prevent the problem you are finding when you comment it out. The order in which the include files are listed should be such that the #define does not effect other include files (it comes after), but will your own code. The library files provided by atmel make heavy use of inlines, but these should work correctly the way things are at the moment.


RE: __inline, ARM7 and IAR compiler

Posted by mike on December 11, 2007
Thanks, Richard

I wanted to make use if a bit of inlining for speed, and was starting to play around with it.

I have commented out the bits in question while I play, and will decide later!

While I understand the concept of in line code, it seems that IAR at least _may_ not inline it, and in this case would put a copy of the function in every module that calls it!

There is also a #pragma inline, but I feel the keyword is more useful - it can be #defined away!

Many thanks

Mike Newsome

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

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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner