FreeRTOS building problem for Tricore Processor

Hi,

i’m new one for FreeRTOS , i refered FreeRTOS website , i got some information based on that i’m trying to work with infinion TriCore TC234 , I followed the demo code example of TC1782 which is given by free RTOS website,

I get the following error on HighTec IDE:

Error messages*********************************************

23:12:28 **** Clean-only build of configuration iROM for project project123 ****
“C:\HighTec\toolchains\tricore\v4.9.3.0-infineon-1.0\bin\make.exe” clean
rm -rf ./src/hello.o ./FreeRTOS/Source/portable/MemMang/heap_4.o ./FreeRTOS/Source/portable/GCC/TriCore_1782/port.o ./FreeRTOS/Source/portable/GCC/TriCore_1782/porttrap.o ./FreeRTOS/Source/croutine.o ./FreeRTOS/Source/event_groups.o ./FreeRTOS/Source/list.o ./FreeRTOS/Source/queue.o ./FreeRTOS/Source/stream_buffer.o ./FreeRTOS/Source/tasks.o ./FreeRTOS/Source/timers.o ./src/hello.d ./FreeRTOS/Source/portable/MemMang/heap_4.d ./FreeRTOS/Source/portable/GCC/TriCore_1782/port.d ./FreeRTOS/Source/portable/GCC/TriCore_1782/porttrap.d ./FreeRTOS/Source/croutine.d ./FreeRTOS/Source/event_groups.d ./FreeRTOS/Source/list.d ./FreeRTOS/Source/queue.d ./FreeRTOS/Source/stream_buffer.d ./FreeRTOS/Source/tasks.d ./FreeRTOS/Source/timers.d project123.elf
’ ’

23:14:15 Build Finished (took 1m:47s.399ms)

23:14:20 **** Incremental Build of configuration iROM for project project123 ****
“C:\HighTec\toolchains\tricore\v4.9.3.0-infineon-1.0\bin\make.exe” all
‘Building file: …/src/hello.c’
‘Invoking: TriCore C Compiler’
“C:\HighTec\toolchains\tricore\v4.9.3.0-infineon-1.0/bin/tricore-gcc” -c -I"…/h" -I"C:\Users\sumit.rauniyar\new_workspace\project123\inc" -I"C:\Users\sumit.rauniyar\new_workspace\project123\FreeRTOS\Source\include" -I"C:\Users\sumit.rauniyar\new_workspace\project123\FreeRTOS\Source\portable\GCC\TriCore_1782" -fno-common -Os -g3 -W -Wall -Wextra -Wdiv-by-zero -Warray-bounds -Wcast-align -Wignored-qualifiers -Wformat -Wformat-security -pipe -DTRIBOARD_TC23XA -fshort-double -mcpu=tc23xx -mversion-info -MMD -MP -MF"src/hello.d" -MT"src/hello.o" -o “src/hello.o” “…/src/hello.c”
‘Finished building: …/src/hello.c’
’ ’
‘Building file: …/FreeRTOS/Source/portable/MemMang/heap_2.c’
‘Invoking: TriCore C Compiler’
“C:\HighTec\toolchains\tricore\v4.9.3.0-infineon-1.0/bin/tricore-gcc” -c -I"…/h" -I"C:\Users\sumit.rauniyar\new_workspace\project123\inc" -I"C:\Users\sumit.rauniyar\new_workspace\project123\FreeRTOS\Source\include" -I"C:\Users\sumit.rauniyar\new_workspace\project123\FreeRTOS\Source\portable\GCC\TriCore_1782" -fno-common -Os -g3 -W -Wall -Wextra -Wdiv-by-zero -Warray-bounds -Wcast-align -Wignored-qualifiers -Wformat -Wformat-security -pipe -DTRIBOARD_TC23XA -fshort-double -mcpu=tc23xx -mversion-info -MMD -MP -MF"FreeRTOS/Source/portable/MemMang/heap_2.d" -MT"FreeRTOS/Source/portable/MemMang/heap_2.o" -o “FreeRTOS/Source/portable/MemMang/heap_2.o” “…/FreeRTOS/Source/portable/MemMang/heap_2.c”
…/FreeRTOS/Source/portable/MemMang/heap_2.c: In function ‘pvPortMalloc’:
…/FreeRTOS/Source/portable/MemMang/heap_2.c:146:17: error: stray ‘$’ in program
configASSERT( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) == 0 );
^
In file included from C:\Users\sumit.rauniyar\new_workspace\project123\FreeRTOS\Source\include/portable.h:51:0,
from C:\Users\sumit.rauniyar\new_workspace\project123\FreeRTOS\Source\include/FreeRTOS.h:63,
from …/FreeRTOS/Source/portable/MemMang/heap_2.c:43:
C:\Users\sumit.rauniyar\new_workspace\project123\FreeRTOS\Source\portable\GCC\TriCore_1782/portmacro.h:119:11: error: incompatible type for argument 1 of ‘_mtcr’
_mtcr( $ICR, ulICR ); /* Write back updated ICR. */
^
C:\Users\sumit.rauniyar\new_workspace\project123\inc/FreeRTOSConfig.h:105:48: note: in expansion of macro ‘portDISABLE_INTERRUPTS’
#define configASSERT( x ) if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); for( ;; ); }
^
…/FreeRTOS/Source/portable/MemMang/heap_2.c:146:17: note: in expansion of macro ‘configASSERT’
configASSERT( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) == 0 );
^
In file included from C:\Users\sumit.rauniyar\new_workspace\project123\FreeRTOS\Source\portable\GCC\TriCore_1782/portmacro.h:37:0,
from C:\Users\sumit.rauniyar\new_workspace\project123\FreeRTOS\Source\include/portable.h:51,
from C:\Users\sumit.rauniyar\new_workspace\project123\FreeRTOS\Source\include/FreeRTOS.h:63,
from …/FreeRTOS/Source/portable/MemMang/heap_2.c:43:
c:\hightec\toolchains\tricore\v4.9.3.0-infineon-1.0\tricore\include\machine\intrinsics.h:135:6: note: expected ‘unsigned int’ but argument is of type ‘ICR_t’
void _mtcr (const unsigned __regaddr, const unsigned __val)
^
make: *** [FreeRTOS/Source/portable/MemMang/heap_2.o] Error 1
FreeRTOS/Source/portable/MemMang/subdir.mk:18: recipe for target ‘FreeRTOS/Source/portable/MemMang/heap_2.o’ failed

23:17:44 Build Finished (took 3m:23s.931ms)

Error*******************************************************************

I guess the problem exist with this one:

_1782/portmacro.h:119:11: error: incompatible type for argument 1 of ‘_mtcr’
_mtcr( $ICR, ulICR ); /* Write back updated ICR. */ \

Could someone please help me into this.

Thanks in advance

This looks like a tool chain version issue as that demo was created some time ago. I suspect the way $ICR is specified has changed since. Can you find some examples of mtcr being used in the code that comes with the tools or in the compiler manual?

Anything useful in this thread? Problems with Building a Demo for TriCore

Hi unfortunately I could not found any examples of_mtcr being used by the tool . However in user guide I found some relevant topic whic is again not much in detail. I am uploading the screen shot for it. May be could you help me in looking into this because I am not able to figure out from here.

pic1

Next picture to above problem (relevant pic

)

Did you have a fix on this issue? I am facing the same problem but no response from anyone an couldn’t find this topic troubleshooting on google.

Reading through this thread again it seems the “$” symbol in this line is the problem. https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/portable/GCC/TriCore_1782/portmacro.h#L118

Also from the thread above I see the upper case compiler extensions (as per the line three lines above that just linked to) are macros, whereas the lower case compiler extensions (such as the line just linked to) are inline function. From the compiler output it looks like it is happy with the “$” in the macro but not the inline function. You could just try removing the $ from the _mtcr() call, but best thing to do is follow the examples provided in the compiler manual (an extract of which is in a post above) or source code that comes with the compiler.

Grateful if you can then report back with the solution so it can be upstreamed. Thanks.