Skip to main content
ferro
Lead
January 30, 2024
Solved

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

  • January 30, 2024
  • 2 replies
  • 3130 views

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

 

This topic has been closed for replies.
Best answer by ferro

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

 

2 replies

Andrew Neil
Super User
January 30, 2024

@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 ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
ferro
ferroAuthor
Lead
January 30, 2024

> "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 ?

Andrew Neil
Super User
January 30, 2024

@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!

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
ferro
ferroAuthorBest answer
Lead
January 30, 2024

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