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




Loading

Compiler errors in the queue.c file

Posted by keith soldavin on March 21, 2011
I am attempting to compile FreeRTOS 6.1.1 with IAR ARM compiler version 6.05 but I keep running into an error with a specific compiler option. I want to compile the code with the "Multi-file Compilation" option enabled but I always get errors in the queue.c file. An example of the errors I get is "declaration of function "xQueueTakeMutexRecursive" is incompatible with a declaration in another translation". I get roughly 15 errors in this file. If I remove the compiler option the code compiles perfectly and runs fine. Does anyone have any idea why these errors are coming up and how to avoid them?

Thank you
Keith

RE: Compiler errors in the queue.c file

Posted by Richard on March 21, 2011
I have never tried using that compiler options, so the following is just a guess:

The (deliberate) data hiding in the FreeRTOS kernel means that something like an xQueueHandle is a pointer to a structure inside the queue.c source file, but a pointer to a void * in all other files. It sounds like the compiler cannot cope with that when that particular option is used.

Regards.

RE: Compiler errors in the queue.c file

Posted by Richard Damon on March 21, 2011
The problem is that the "Multi-file Compilation" option does not work with a mixed language project. The FreeRTOS kernel files must be compiled truly as C code, not C++ due to the way the data hiding is done (and a few other Cisms in the code, not surprising since it is C code).

You will either need to convert the code to be valid C++ code, which to start means changing the definition of handles from void * to being struct xxxx* (xxx depending on the given handle), which may kick up a few other errors, or you need to turn off the "Multi-file Compilation" option (this is what I did). You may also be able to change your project to compile FreeRTOS into a library module, and include that in your main project if you really need to use the Multi-file option.

RE: Compiler errors in the queue.c file

Posted by keith soldavin on March 21, 2011
Thank you for the input. The reason I wanted to try the multiple file option was to help the optimizer remove more unused code. I will try to compile the RTOS as a library without that option and then include it in my project.

Thanks
Keith


[ 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