PlatformIO looks like exactly what i’m looking for, but there are a couple of fundamental things that i don’t really understand…
I have generated a project for an ST development board, and opened an example project. It uses types, and calls functions that are in header files included… somewhere? I can get to the header file, but i have no idea what interfaces are available for use with this project. i am also struggling to understand how the call to a particular header file, is being found at all, as my main.cpp only includes a single header, which in turn doesn’t include any others…
Where can i find, what this board/chips supports in the way of libraries at my disposable for use? I’d like to view the headers that the vendor has provided for use with this board, but the project doesn’t appear to show them… or indeed what it’s using to build my project.
P.S.
I am used to having a ‘project’ and various configuration and build scripts accompanying a project. I have been searching through the documentation and i am really struggling to grasp the fundamental ideas of PlatformIO. Could somebody please explain how the normal ‘project configuration’ interfaces that come with ide’s and list of includes, makefile ect, all translate to the project that ProjectIO generates for a board?
If you want to understand the build process better you might want to execute pio settings set force_verbose Yes in the shell. That way the entire GCC/G++ build commands appear in which you will see all -I flags and where the include files come from.
In general it’s hard to answer the question without knowing what exact project / framework you use. But in general you have:
the files / headers from your framework, e.g. in .platformio\packages\framework-stm32cube
the files from your own src/ folder
the files from any library you included / got autoincluded via lib_deps statement in your platformio.ini (docs) or similiar. libraries can also come from your project’s lib/ folder
With PIO you are not supposed to write your own Makefiles etc. You just tell it what basic framework to use and what libraries you want to include, and it tries to build it automatically. If that fails in some rare cases, you have to manually adjust via adding some build_flags in your platformio.ini.
If you really need some complicated non-standard build steps you should look into python extra scripts (docs)
How do i get platformIO to generate a project for another ide - say visual studio or eclipse?
So a little more about my project. It’s an ST bard and there are options to build with mbed or stm32cube
What i don’t know is what is available to the project when it comes to includes if i am to create a project with those toolchains. So, if i’m not porting a project, and i get a development board and spin up a project based on one of the supported platforms, is there nothing telling me what has been included and how to interface with the features of the platform included in the project? Is this simply done by loading up an example project and randomly seeing if the includes you think it should have get resolved?
You should use PIO from the shell (docs). You can then execute pio init -b <some board> --ide=<some IDE> (docs) to generate a project with ide being from [atom|clion|codeblocks|eclipse|emacs|netbeans|qtcreator|sublimetext|vim|visualstudio|vscode].
For the last part of the question I’m still kind of lost on what you mean…
When you compile a project the LDF (library dependency finder) will display what libraries it has included (and also what framework you’re on). For example if I compile a project for a LoRaWAN node
All PIO does is have the framework files (for mbed / STM32Cube) ready for you to use. What files you can include is what you have to read from their respective manuals (e.g. mbed). Or do I not understand that question?
Yes that does help answer my question to an extent. I guess my misunderstanding comes from the difference between a project built for a proper IDE vs the project you get and are exposed to in Visual Studio Code. In Visual studio code, it shows no dependancies, no included files and doesn’t not make the user aware of the version of the platform on which the project is based. You may be able to find this out, but i guess i expected some form of readme with instructions on how to begin writing code for your new project. I think i will simply use platformIO, to create a project which i then import into a full IDE, instead of Visual Studio Code.
Thank You.