PlatformIO utilities and info

Today I spent quite a bit of time learning more about PlatformIO,
and I’ve developed some PlatformIO extra scripts for Pokitto that other people might find useful, so I’ve published them here:

I’ve got a script that updates the .ld file, much like the one hosted on the PokittoIO repo, but with some extra features:

  • It won’t prevent your code from compiling if your internet goes down
  • The updating can be optionally disabled by specifying an additional property in platformio.ini

Also, there’s a script that copies the .bin file from /.pioenvs/pokitto to the root of the project, so it’s easier to find.

At some point I hope to find a way to make it so that PlatformIO produces a <project name>.bin instead of a firmware.bin.

I also hope to eventually find a way to write a post script that can upload to Pokitto.
It’s not something I personally need, but I think it would possibly help some other users.

While I was at it, I investigated all the env variables,
and I’ve documented all the variables that I’ve been able to discover the purpose of.

I’ve also uploaded that to a separate repo in case anyone finds it useful:

If anyone using a non-Windows OS would like to report some of the values they get for these variables that are notably different (e.g. HOST_OS and SHELL will probably be drastically different) then I’d be interested in knowing what those are.


This is so amazing! Thank you for taking the time to do this :smiley: I’ve been using platformIO and eclipse and this will be a super helpful reference. I especially appreciate the copying of the bin to the root because that’s always been a point of confusion for me.


If even one person finds it useful then the work has been worthwhile.

In which case I’m glad I published the script.
I had a feeling I wasn’t the only person who had issues with that.

The best bit is that the script can be reconfigured to copy the .bin elsewhere (e.g. an ‘output’ file, or possibly even to the Pokitto itself) if someone doesn’t want it in the project root.

I’m convinced that PlatformIO has the capacity to be a really easy to use solution for Pokitto.
The biggest obstacle is simply understanding how it all works.

If you don’t mind, would you be able to report some of the environment values for Linux (and/or variations thereupon)?

(I suspect you’ll be able to figure out how to write a script to do so, but if you can’t just ask and I’ll write one.)

Most of the code is pretty platform independent so I don’t think it’ll be needed, but there might come a point where it is needed.
(E.g. I’d like to be able to eventually hookup an upload script.)

PlatformIO has been the quickest and most “gradle like” build process so I’m most comfortable with that. Plus the library manager has been incredibly helpful for adding in 3rd party libs :slight_smile:

I absolutely appreciate this!

I’ll try and get those environment variables when I’m home and have some time. I’ve been losing a lot of spare time due to a new job :o…

1 Like

Just fixed a bug in the copy script.

I forgot that env['BUILD_DIR'] is ‘unevaluated’.
Until I have figures out how to ‘evaluate’ the ‘unevaluated’ ($) variables,
I’m using a specific workaround.

(One idea I’ve had is to search for $, trim it off and then feed the result to env,
but that seems like a bit of a kludge, so I’m hoping there’s an evaluate(var) function.)

1 Like