Error when I use FreeRTOS LTS with IAR EWARM 7.50

I tryed to use the latest version of FreeRTOS LTS in IAR EWARM 7.50 (with Cortex-M7 core) and the compilatio process failed. There is an error in sources\portable\IAR\ARM_CM7\portmacro.h file - my IAR can’t recognize macro “portFORCE_INLINE inline attribute(( always_inline))”. I changed it to just “portFORCE_INLINE inline” and everything is correct. So it seems there is a bug in sources of FreeRTOS.

I just tried this with V8.42.1 of IAR’s tools and V10.3.1 of FreeRTOS by making a call to xPortIsInsideInterrupt(), which is declared as

portFORCE_INLINE static BaseType_t xPortIsInsideInterrupt( void )

and didn’t get any compiler warning.

portFORCE_INLINE is implemented as:

#ifndef portFORCE_INLINE
	#define portFORCE_INLINE inline __attribute__(( always_inline))
#endif

so I think there are two choices for you:

  1. Update your compiler version, it is very old, or
  2. Provide your own implementation of portFORCE_INLINE in FreeRTOSConfig.h. That will mean the preprocessor will see your implementation and so not use the one in portmacro.h.

I can’t change my compiler you should understand. I fixed it by using redefinition of portFORCE_INLINE in FreeRTOSConfig.h. It helps but it still looks like a bug - you’d better indicate which version of FreeRTOS is compatible to which compiler or you should support all versions.

Sorry, but it is simply not practical to support all versions. In the case of IAR that would require a different project file for every version, multiple versions of the linker script, and multiple versions of assembly files per target. We do however keep every version of FreeRTOS available, so you can go back to try and find one that matches your compiler version.