Hi all,
like several people on this list, we are working with a number of custom boards (STM F3 variants), so we have forked and extended the mbed repo with the board definitions we need.
Each time platformio updates silently, our additions are shredded and we have to move stuff over to the framework-mbed subdirs again. Is there a way to define a custom github repo instead of the mainline?
Platformio works nice otherwise, but this is really costing us devel time.
adding custom platforms looks easy (took me 1 minute to add our boards), but how could I add a custom framework (a forked mbed)? Simply using a git link in the framework= line does not do the trick.
Meanwhile, Iâll try the custom_script approach (thanks @krishna_chaitanya!) - linking to the .git followed by a âgit checkout â . && cd platformio/ && LC_ALL=C toxâ should more or less do it
Simon
Ok, I have a working setup now with my own âvoxel-mbedâ framework defined; I had to add it in the compatibility list of the external libraries that I link my project against of course.
One odd thing though: I have a set of project-specific code in the lib/xxx/ directories which did not link any more, the builder complained about incompatible platform versions. I added a dummy library.json declaring compatible frameworks to make it compile again:
âframeworksâ: [âmbedâ, âvoxel-mbedâ ],
@ivankravets@svogl - This discussion helped me solve the problem of getting Arduino to compile for nucleo_f103rb under PlatformIO (Iâll create a pull request soon), so thanks for the tips.
The documentation for creating a custom platform is fairly comprehensive. But it is not so obvious that when you want a custom version of a framework, you should go about this by creating a custom platform. Is this documented anywhere?
One other problem I found, when cloning and renaming the ststm32 platform, was that I needed to edit platform.py and change the class name to match the name field of my custom platform.json file. Once I identified the problem this was a simple fix.
@ivankravets, Is there an easy way to work with a development version of a platform? I have forked the stm32 platform in github, and cloned it to my local folder. Then I use the form platform=file://path/to/my_stm32_platform to refer to my local modified copy. I have not changed the platform name as I want to submit this as a pull request. The first time I do pio run it copies my folder into .platformio/platforms/ststm32-plus-random-characters and I can see my project using the modified platform. However, whenever I update my platform, this is not detected, and I need to manually delete this copied folder in order to update my changes.
What is the workflow that you use for developing and debugging platforms?
I use symlink on macOS. You can clone repo directly to ~/.platformio/platforms folder.
It depends on dev/platform. The only a few dev/platforms have platform.py file which configures âmanifestâ on-the-fly depending on a build environment.
Hi @isaev-ni! PlatformIO build scripts for mbed are not part of the official repository. But you can do so in your fork, just create a submodule for PlatformIO build script from based on repository