Problems with Building a Demo for TriCore

Following the Tricore guide, http://www.freertos.org/FreeRTOS-for-Infineon-TriCore-TC1782-using-HighTec-GCC.html I get the following error on HighTec IDE: ~~~ ../RTOSDemo/FreeRTOSSource/portable/GCC/TriCore1782/port.c: In function ‘pxPortInitialiseStack’: ../RTOSDemo/FreeRTOSSource/portable/GCC/TriCore1782/port.c:141:4: error: stray ‘$’ in program _mtcr( $FCX, pulUpperCSA[ 0 ] ); ^ ~~~ This error appears on every instance of ‘$’ in the code. Any ideas on how to fix the issue?

Problems with Building a Demo for TriCore

I suspect this will be due to a change in the tools since the example was created. Can you reference any assembly code that comes with the tools, or the assembler’s manual, to see what the new syntax is? Also, is this just when the mtcr macro is used? If so, maybe the semantics of the macro changed?

Problems with Building a Demo for TriCore

I believe that not the macro itself is the problem, but the use of $ in regaddr. The macro is: ~~~ static inline attribute((always_inline)) void _mtcr (const unsigned regaddr, const unsigned __val) { __asm volatile (“mtcr LO:%0, %1” :: “i” (regaddr), “d” (val) : “memory”); } ~~~ and the problematic call for example is: _mtcr( $PSW, ulMFCR ); It seems that $PSW is not recognizable..

Problems with Building a Demo for TriCore

What does the assembly manual say about this? It looks like PSW is also a macro (guessing as it is capitalised) so perhaps that has changed. You can also check the assembly code that comes with the compiler and the assembly code generated by the compiler to see how it accesses these registers. Please report back your findings for others with the same issue.

Problems with Building a Demo for TriCore

I was trying to find the definition of the $ (like $PSW) symbols, but couldn’t find anything in the compiler code. I have a feeling that it something that used to be when the example was written, but currently doesn’t exist.