Error:
In file included from FreeRTOS/Source/include/portable.h:53:0,
from FreeRTOS/Source/include/FreeRTOS.h:65,
from trilobozoa.c:3:
FreeRTOS/Source/include/portmacro.h:170:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static portFORCE_INLINE void vPortSetBASEPRI( uint32_t ulBASEPRI )
^~~~
FreeRTOS/Source/include/portmacro.h:183:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static portFORCE_INLINE void vPortRaiseBASEPRI( void )
^~~~
FreeRTOS/Source/include/portmacro.h:200:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static portFORCE_INLINE void vPortClearBASEPRIFromISR( void )
^~~~
FreeRTOS/Source/include/portmacro.h:208:26: error: stray ‘#’ in program
msr basepri, # 0
^
FreeRTOS/Source/include/portmacro.h:165:37: error: unknown type name ‘__forceinline’ #define portFORCE_INLINE __forceinline
^
FreeRTOS/Source/include/portmacro.h:214:12: note: in expansion of macro ‘portFORCE_INLINE’
static portFORCE_INLINE uint32_t ulPortRaiseBASEPRI( void )
^~~~~~~~~~~~~~~~
FreeRTOS/Source/include/portmacro.h:214:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘ulPortRaiseBASEPRI’
static portFORCE_INLINE uint32_t ulPortRaiseBASEPRI( void )
^~~~~~~~~~~~~~~~~~
FreeRTOS/Source/include/portmacro.h:165:37: error: unknown type name ‘__forceinline’ #define portFORCE_INLINE __forceinline
^
FreeRTOS/Source/include/portmacro.h:234:12: note: in expansion of macro ‘portFORCE_INLINE’
static portFORCE_INLINE BaseType_t xPortIsInsideInterrupt( void )
^~~~~~~~~~~~~~~~
FreeRTOS/Source/include/portmacro.h:234:40: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘xPortIsInsideInterrupt’
static portFORCE_INLINE BaseType_t xPortIsInsideInterrupt( void )
I don’t know how fix it problem.
I am not able to use IDE and use GCC + makefile. I try use differents makefile’s but all the time i got this problem. I took the portmacro.h and port.c from Source/portable/GCC/ARM_CM3. I use and try compile code for STM32 “Blue Pill”.
Do you have the definition of portFORCE_INLINE? My guess is it’s something like __attribute__((always_inline)) or even inline __attribute((always_inline)), or should be. It’s possible that the -std=gnu99 may cause the particular inline keyword used in the macro to not be recognized, so it’s treating that as an identifier, in which case it could be a dialect issue. Try changing the dialect to-std=gnu11 and see if it changes the behavior of the compiler.
From the version of portmacro.h I found in an old project (circa 2017 using the version of FreeRTOS provided in the STM32 Cube firmware library for the STM32F7 family):
It could be that you need to be using __inline instead of just inline in there, in which case you ought to define portFORCE_INLINE correctly before the header where portmacro.h is included is included.
I hope this helps you find your compilation problem.
It is old version, that i found in the Internet. URL: https
://programmersought.com/article/ 37191392504/
My experience is not enough for solve this problem. I try use differents makefile. If you have makefile for {stm32f103c8t6 + gcc + SPL}, please, share it.
You should not need to change FreeRTOS source files. Where did you get the MakeFile from? Did you generate it using CubeMX or are you trying to write it yourself?
I take ALL makefile’s from the internet for FreeRTOS on stm32f103, but just this makefile brought me the closest to a ready-made solution)
If you have FreeRTOS in full complectation on stm32f103c8t6, please, send me. I don’t understand Demo/CORTEX_STM32F103* - in all this demos not there is no makefile! How people it compile?)
I’m afraid that without more information, I’m probably not going to be much help. The error message you reported in your original post is caused by the compiler thinking that the expansion of the macro portFORCE_INLINE contains an identifier of some sort.
I note that you’ve got #define portFORCE_INLINE __inline attribute((always_inline)). This should be written #define portFORCE_INLINE __inline __attribute__(( always_inline )). I don’t know for sure that the whitespace between parenthesis and the always_inline is significant, but it seems to be the common practice to surround the contents of an __attribute__(( )) qualifier with whitespace.
I am currently not working on any projects that use FreeRTOS or the STM32, so I cannot pull up the current FreeRTOS sources or any of the STM Cube firmware libraries and examples. You will find that it is sometimes hard to make an example work under the CubeMX IDE if for no other reason than that they don’t provide a CubeMX generated IO configuration file (.ioc) and you mostly have to work the IO configuration out for yourself; sometimes the documentation with the sample says what key peripheral settings are, but you must create your own .ioc file to create a usable CubeMX IDE project.
I just compile your project and it works! I am happy that the problem has been solved.
THANK YOU VERY MUCH!
I ask you to explain to me about the composition of the project. Do I understand correctly that the project that the user is writing should be in the directory?
This is the project as generated by the CubeMX. I think you forgot to mention which directory you are talking about but you can create a new directory parallel to Core and Drivers to keep your code.