framework-stm32cube has a config file for its library which can pull external dependency. Problem is, that the dependency is not resolved by PIO LDF so it fails to build.
In details
- In
framework-stm32cubef4
there is librarySTM32_USB_Host_Library
. - This library depends on
usbh_config.h
which I can be provided in the include folder which works - I can enable OS support by
USBH_USE_OS
in this file and I must provide also#include <cmsis_os.h>
. - I can provide RTOS support by
PlatformIO-FreeRTOS
aslib_deps
- I can provide
lib/cmsis_os
with FreeRTOS<–>CMSIS_OS wrapper files
All lib_deps
and local libraries are correctly scanned so they can use cmsis_os and freertos
|-- <LwOW> 3.0.2
| |-- <cmsis_os>
| | |-- <PlatformIO-FreeRTOS> 2.1.3
But dependencies of libraries provided by the framework are not resolved.
|-- <STM32_USB_Host_Library-MSC>
| |-- <STM32_USB_Host_Library-Core>
Should continue with
| | |-- <cmsis_os>
| | | |-- <PlatformIO-FreeRTOS> 2.1.3
but it does not. So the STM32_USB_Host_Library
compiles with an error fatal error: cmsis_os.h: No such file or directory
What is the correct way to solve this dependency?
-
framework-stm32cubef4
already has its own FreeRTOS and cmsis_os inMiddlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/
but they are not available (visible) from PlatformIO. - I can add
build_flags = -I lib/cmsis_os
so thecmsis_os.h
is satisfied but it immediately failed onFreeRTOS.h
. This file is provided bylib_deps = PlatformIO-FreeRTOS
which I don’t know how to correctly force to include. But in general, this is also a bad solution. - I can stop using the framework and all the lib_deps and copy everything locally but this is not preferred way.
- The best option would be to persuade LDF to search framework dependencies also in regular libraries