Include freertos/FreeRTOSConfig.h : No such file or directory


I have a project, which depends a library (nxp), which depends on freertos.

I want to define the FreeRTOSConfig in my project (preferably), or in my nxp library. I do not want to put the FreeRTOSConfig in my freertos library (obviously).

Whatever I try, I keep ending up with a compilation error:

Compiling .pio\build\mimxrt1020_evk\libaa8\nxp\board\board.o
Compiling .pio\build\mimxrt1020_evk\libaa8\nxp\component\serial_manager\fsl_component_serial_manager.o
Compiling .pio\build\mimxrt1020_evk\libaa8\nxp\component\serial_manager\fsl_component_serial_port_uart.o
In file included from D:\dev\bp\iobox\shared\FreeRTOS\Source\croutine.c:27:
D:\dev\bp\iobox\shared\FreeRTOS\Source\include/FreeRTOS.h:57:10: fatal error: freertos/FreeRTOSConfig.h: No such file or directory

The only way I can solve this is by added the “freertos/FreeRTOSConfig.h” in my freertos library (which is the wrong place of course).

Desired folder / project structure:
nxpport (my project)

  • depends on FreeRTOS, and on nxp
  • include/freertos/FreeRTOSConfig.h


  • no deps

nxp (library)

  • depends on FreeRTOS

my platformio:

platform = nxpimxrt
platform_packages = 
board = mimxrt1020_evk
debug_build_flags = -O2 -g -ggdb
build_flags = 
    -I /freertos
lib_extra_dirs =
lib_deps = 
board_build.ldscript = MIMXRT1021.ld

My nxp llibrary.json

"name": "nxp",
"version": "2.9.1",
"keywords": "NXP SDK",
"description": "Xpresso SDK for RT1020",
		"FreeRTOS": "^10.2.1"
    "libArchive": false,
		"flags": [
			"-I board",
			"-I CMSIS",
        "-I device",
        "-I drivers",
        "-I xip",
        "-I utilities",
        "-I component/lists",
        "-I component/serial_manager",
        "-I component/uart"

So, the file in question, is available to the compiler in /include/freertos/FreeRTOSConfig.h.

What do I need to do extra to let the compiler find this include when it is compiling my npx library (which depends on freertos)?

Solved this by explicitly telling the library finder to also include my project includes in platformio:

build_flags =
-I include
-I include/lwip