Portmacro.h errors

Hello! Our company bought the module with infrared camera. The MC is STM32H750IBK6. The demo project of this camera is generated for Keil (idk the exact version). When I try to compile it on my version with default compiler ver. 6, it gives portmacro.h errors such as:

../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F\portmacro.h(186): error: expected 'volatile', 'inline', 'goto', or '('
../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F\portmacro.h(208): error: unknown type name '__forceinline'
../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F\portmacro.h(165): note: expanded from macro 'portFORCE_INLINE'

Last two problems I’ve solved by

#include <stdint.h>
#define __forceinline __attribute__((always_inline))

If it’s not correct, I’ll be glad to hear how to do it right. And I still don’t know what to do with the first type of mistakes.
Oh, and I also got

../Middlewares/Third_Party/FreeRTOS/Source/include\FreeRTOS.h(71): error: 'reent.h' file not found

with armclang 6 you have to use the GCC port of freertos

portable/GCC/ARM_CM4F

Thanks for your answer! I’ve no GCC in portable/. Only RVDS and MemMang folders. Which compiler should I use then? I’ve fixed problem with reentrant.h and now the problems are:

Fatal error: L3900U: Unrecognized option '--vfemode=force'.
Warning: A1950W: The legacy armasm assembler is deprecated. Consider using the armclang integrated assembler instead.

Wrote it just in case it matters.
The problem is that project isn’t mine and I’ve never worked with freertos earlier

fixing anything in these files is the wrong approach. just don’t edit them.

somewhere in your Keil/Keil Packs/CubeMX folder you will find thirdparty Freertos libs. and there is a portable folder with the structure i mentioned “portable/GCC/ARM_CM4F”
you should have the files on your PC already you just need to find them :wink:

or you can go to

but you need to select the correct freertos version tag (according to the freertos version you are using)
and download them from there and add them to your project (but remove the old RVDS files from your project)

I still don’t get it why ST does not manage to include the correct files after all these years in their projects.

oh and btw:
for your controller i’m not sure if you need
portable/GCC/ARM_CM7
or
portable/GCC/ARM_CM4

maybe someone else can clarify

I’ve tried both, but still got errors. I guess the original project is old, so that there’s RVDS. If it’s possible, take a look on git at BorisDeLaMar/Chinese_developments (I’m new user and can’t attach links). I’ve uploaded all the project files there. Maybe I haven’t mentioned something important

You should be able to post link now. Please also link the project file in your repo that you are trying to build.

Thanks a lot! This is everything I have:

The project file is:
MDK-ARM/IR_MCU_SDK_DEMO_V1.3_basedon_2.0module_20201215.uvprojx
As I understood

Please apply the following patch - compilation_fixes.patch (2.0 MB)

I made the following changes -

  1. Update FreeRTOS-Kernel to the latest mainline. Please choose the correct FreeRTOS version as per your requirements.
  2. Update source file paths and include search paths accordingly.
  3. Update compiler to version 6 and assembler to armclang in project settings.
  4. Set configUSE_NEWLIB_REENTRANT to 0 in FreeRTOSConfig.h.
  5. Make a small change in cmsis_os.c to make it compatible with the latest FreeRTOS kernel.

Thanks.

1 Like

Thank you a lot!!! This is huge!