My intent is to use PlatformIO with the mainline Zephyr source trees. I am developing some system-level components for Zephyr, so this is an important feature. (I could not determine which was the best area of the forum for this topic)
I began to follow the advice from this first topic:
I implemented the updates to the platformio.ini project file, as described in the above link. It seems like all frameworks are detected during the build, but I get errors related to search paths.
warning: Ignoring missing SConscript '/[user-path]/.platformio/packages/framework-zephyr/scripts/platformio/platformio-build.py'
File "/[user-path]/.platformio/platforms/ststm32/builder/frameworks/zephyr.py", line 28, in <module>
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Building in release mode
src/main.c:1:10: fatal error: zephyr.h: No such file or directory
I’m using the VSCode IDE. It seems like there’s a header search path issue, although I’m not sure it’s with the IDE or the configuration. Looking for a solution. Thanks.
OK, the reason why it was missing the script dir is because I moved it instead of copying it from platformio to mainline zephyr (this was a mistake).
But the underlying problem here is that PlatformIO is still trying to build from the internal packages rather than the external packages. I need to build from the external packages that were re-specified in my platformio.ini file.
Since you’re specifying these 20 folders as them as platform_packages, they also need to be valid PlatformIO packages with a package.json inside them, describing the package and their version. I’m assuming since you’re linking to a cloned Zephyr repo that this file does not exist in any of the folders. Again you should use the previous PlatformIO package’s package.json as template for modification, e.g. for framework-zephyr
"description": "Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures",
(changed the version to reflect Zephyr 2.5.0 and the current datecode).
All other framework-zephyr-* packages can be seen at the bintray as linked above.
I’m also not sure if the platformio/ prefix is needed for any of the pacakges – you can play with that.
You should see that it picks up your custom pacakge version when the build output where all used packages are listed reflects your changed versions.
I had already copied the package.json files from the platformio distribution into the mainline distribution. Perhaps there is one missing; I will check again.
I added the nucleo-l010rb board and SoC into Zephyr myself. I have a project on Nucleo-l010rb that compiles and runs through normal Zephyr tools. The major reason I want to use the mainline zephyr source trees is because I am contributing board, SoCs, and other modules to the Zephyr project.
I want to have an IDE with Zephyr, so I am trying PlatformIO. The Zephyr-Eclipse plugin is OK but not great. I think PlatformIO on VSCode could be nicer.