cancel
Showing results for 
Search instead for 
Did you mean: 

GFX 4.23.1; Keil MDK 5.36: error: #5: cannot open source input file "portmacro.h"

ferro
Senior II

Hello,

GFX 4.23.1 comes with this example project

en.X-CUBE-TOUCHGFX.4.23.1\Projects\STM32F746G-DISCO

 

I use Keil MDK 5.36. During compilation I get this error:

 

 

compiling SoftwareMJPEGDecoder.cpp...
../Middlewares/Third_Party/FreeRTOS/Source/include/portable.h(52): error:  #5: cannot open source input file "portmacro.h": No such file or directory
  	#include "portmacro.h"
../TouchGFX/target/generated/SoftwareMJPEGDecoder.cpp: 0 warnings, 1 error
compiling TouchGFXGeneratedHAL.cpp...
../middlewares/st/touchgfx/framework/include/touchgfx/widgets/graph/GraphLabels.hpp(354): warning:  #1300-D: drawIndexRange inherits implicit virtual
      void drawIndexRange(const Rect& invalidatedArea, const Font* fontToDraw, const AbstractDataGraph* graph, const int rangeMin, const int rangeMax, const int minorInterval, const int majorInterval, const uint8_t a) const;
../touchgfx/gui/include/gui/main_screen/MainView.hpp(17): warning:  #1300-D: handleTickEvent inherits implicit virtual
      void handleTickEvent();
../Middlewares/Third_Party/FreeRTOS/Source/include/portable.h(52): error:  #5: cannot open source input file "portmacro.h": No such file or directory
  	#include "portmacro.h"
../TouchGFX/target/generated/TouchGFXGeneratedHAL.cpp: 2 warnings, 1 error
compiling main.c...
../Middlewares/Third_Party/FreeRTOS/Source/include/portable.h(52): error:  #5: cannot open source input file "portmacro.h": No such file or directory
  	#include "portmacro.h"
../Core/Src/main.c: 0 warnings, 1 error
compiling TouchGFXHAL.cpp...
../TouchGFX/target/TouchGFXHAL.hpp(54): warning:  #1300-D: initialize inherits implicit virtual
      void initialize();
../Middlewares/Third_Party/FreeRTOS/Source/include/portable.h(52): error:  #5: cannot open source input file "portmacro.h": No such file or directory
  	#include "portmacro.h"
../TouchGFX/target/TouchGFXHAL.cpp: 1 warning, 1 error

 

 

 

Any idea how to fix missing portmacro.h error please ?

 

Thank you

Ferro

 

1 ACCEPTED SOLUTION

Accepted Solutions
ferro
Senior II

Thank you @Andrew Neil 

 

1. Install FreeRTOS package from Keil Package installer

ferro_0-1706626203067.png

2. copy files port.c and portmacro.h from

c:\Users\<user>\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.5.1\Source\portable\RVDS\ARM_CM7\r0p1\

into

STM32F746G-DISCO\Applications\DynamicGraph\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM7\r0p1\

 

Files available here as well:

https://github.com/ARM-software/CMSIS-FreeRTOS/tree/main/Source/portable/RVDS/ARM_CM7/r0p1

 

View solution in original post

6 REPLIES 6
Andrew Neil
Evangelist III

@ferro wrote:

Any idea how to fix missing portmacro.h error please ?


Is it actually missing, or is the compiler just not finding it?

The latter would indicate a problem with your Include Paths ...

> "Is it actually missing, or is the compiler just not finding it?"

I am not sure. This is what portable.h says on line 52:

ferro_0-1706619183366.png

There are 2 portmacros.h in the project:

DynamicGraph\Middlewares\Third_Party\FreeRTOS\Source\portable\IAR\ARM_CM7\r0p1\portmacro.h
DynamicGraph\gcc\Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM7\r0p1\portmacro.h

 

Should there be a portmacro.h for Keil toolchain perhaps ?


@ferro wrote:

> "Is it actually missing, or is the compiler just not finding it?"

I am not sure. 


Well that's the first thing to check!

As I said, there are 2 but probably not ported to Keil ? That's for GFX Team to answer i suppose.

Your earlier post suggests it's a FreeRTOS thing? So not specific to GFX?

FreeRTOS is very widely used, so shouldn't be hard to find a suitable Keil version?

ferro
Senior II

Thank you @Andrew Neil 

 

1. Install FreeRTOS package from Keil Package installer

ferro_0-1706626203067.png

2. copy files port.c and portmacro.h from

c:\Users\<user>\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.5.1\Source\portable\RVDS\ARM_CM7\r0p1\

into

STM32F746G-DISCO\Applications\DynamicGraph\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM7\r0p1\

 

Files available here as well:

https://github.com/ARM-software/CMSIS-FreeRTOS/tree/main/Source/portable/RVDS/ARM_CM7/r0p1