errors while compiling freertos with iar compiler

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 “./user_src/FreeRTOS/portable/IAR/RL78/port.c”) (from translation unit “./user_src/FreeRTOS/portable/IAR/RL78/port.c”) “struct tskTaskControlBlock *volatile __near pxCurrentTCB” (declared at line 188 of “./user_src/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

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

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.ITKDesktopRL78_DemoRL78_Demouser_src libsFreeRTOSincludeportable.h”) (from translation unit “./applilet3_src/r_main.c”) “nearfunc unsigned int *pxPortInitialiseStack(unsigned int *, TaskFunctiont, void *)” (declared at line 363 of “C:Usersckurz.ITKDesktopRL78_DemoRL78_Demouser_src libsFreeRTOSincludeportable.h”) (from translation unit “./user_src/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.