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


errors while compiling freertos with iar compiler

Posted by chris-itk on October 7, 2014

Hi everybody, I get a compiler error when I use the --mfc compiler flag (multi-file compilation) of the IAR compiler. Without this flag, compiling every single c-file for itself, my project builds without any error.

I would be very glad if you could tell me what the problem is.

Regards Chris

Here's the message: iccrl78.exe ./usersrc/FreeRTOS/croutine.c ./usersrc/FreeRTOS/eventgroups.c ./applilet3src/FreeRTOSHooks.c ./usersrc/FreeRTOS/portable/MemMang/heap1.c ./usersrc/FreeRTOS/list.c ./usersrc/FreeRTOS/portable/IAR/RL78/port.c ./usersrc/FreeRTOS/queue.c ./applilet3src/rcgcgc.c ./applilet3src/rcgcgcuser.c ./applilet3src/rcgport.c ./applilet3src/rcgportuser.c ./applilet3src/rcgtimer.c ./applilet3src/rcgwdt.c ./applilet3src/rcgwdtuser.c ./applilet3src/rmain.c ./applilet3src/rsysteminit.c ./usersrc/FreeRTOS/timers.c ./usersrc/Tasks/UserTasks.c ./usersrc/FreeRTOS/tasks.c --core rl782 --codemodel near --datamodel near --nearconstlocation rom0 -e -Ol --nocse --nounroll --noinline --nocodemotion --notbaa --nocrosscall --noscheduling --noclustering --debug --mfc --nosysteminclude -o ./Debug/Obj/ --dlibconfig dlrl78nn2n.h -I ./usersrc/FreeRTOS/ -I ./usersrc/FreeRTOS/portable/IAR/RL78/ -I ./usersrc/FreeRTOS/include/ -I ./applilet3src/ -I ./usersrc/Tasks/ -I ./usersrc/includes/

IAR C/C++ Compiler V1.40.3.898 for RL78 Copyright 2011-2014 IAR Systems AB. Evaluation license - IAR Embedded Workbench for Renesas RL78, Evaluation version 1.40

extern volatile TCBt * volatile pxCurrentTCB; ^ "C:Usersckurz.ITKDesktopRL78DemoRL78DemousersrcFreeRTOSportableIARRL78port.c",90 Error[Pe1061]: declaration of variable "pxCurrentTCB" is incompatible with a declaration in another translation unit "void volatile *volatile _near pxCurrentTCB" (declared at line 90 of "./usersrc/FreeRTOS/portable/IAR/RL78/port.c") (from translation unit "./usersrc/FreeRTOS/portable/IAR/RL78/port.c") "struct tskTaskControlBlock *volatile __near pxCurrentTCB" (declared at line 188 of "./usersrc/FreeRTOS/tasks.c") (from translation unit "./user_src/FreeRTOS/tasks.c")

Errors: 1 Warnings: none makefile:60: recipe for target 'Debug/Obj/croutine.r87' failed mingw32-make: *** [Debug/Obj/croutine.r87] Error 2

errors while compiling freertos with iar compiler

Posted by davedoors on October 8, 2014

I just tried this in my ARM project and didnt get an issue. It must be specific to the RL78 port file. Did you try changing the extern declaration

extern volatile TCB_t * volatile pxCurrentTCB;

to match the declaration in the other file? You cant use structtskTaskControlBlock, but maybe

extern TCB_t *volatile near pxCurrentTCB;

would work.

errors while compiling freertos with iar compiler

Posted by chris-itk on October 9, 2014

Hi Dave, thx for your answer. Yes I tried this out, but it didn't work. I also tried to put the whole deklaration of structtskTaskControlBlock and pxCurrentTCB into the task.h file, to be able to use it in port.c. This works fine for this error, but a lot of other errors came up.

Here's just one of them (there are a lot more): "C:Usersckurz.ITKDesktopRL78DemoRL78DemousersrclibsFreeRTOSincludeportable.h",363 Error[Pe1066]: declaration of function "pxPortInitialiseStack" had a different meaning during compilation of "./usersrc/Application/Tasks/TestTask.c" "nearfunc unsigned short *pxPortInitialiseStack(unsigned short *, TaskFunctiont, void *)" (declared at line 363 of "C:Usersckurz.ITKDesktopRL78DemoRL78Demousersrc libsFreeRTOSincludeportable.h") (from translation unit "./applilet3src/r_main.c") "nearfunc unsigned int *pxPortInitialiseStack(unsigned int *, TaskFunctiont, void *)" (declared at line 363 of "C:Usersckurz.ITKDesktopRL78DemoRL78Demousersrc libsFreeRTOSincludeportable.h") (from translation unit "./usersrc/Application/Tasks/TestTask.c")

I think I will stop trying to use the --mfc flag. It seems to be a lot of work to get this run correctly. I'm just using a loop in the makefile instead, and compiling every single file for itselfe.

[ 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