Tips for Adding an Arduino-Compatible Board to PlatformIO

Adding support for a new Arduino core is showcased in a few PRs of the e.g. atmelsam platform (example 1, example 2). But without a good knowledge of PlatformIO instrinsics like package management, the platform script, the builder script, board definitions etc., it’s not exactly easy for newcomers to add support.

I’ve forked platform-atmelsam with added Telit Charlie support and created an example project: You would just need to clone it and open it in VSCode, no modifications needed.

It works by creating a new board definition, forking the Arduino core with the needed package.json here and adapting the builder script to use the same package versions as the Arduino core’s package_Telit-board_index.json dictates, as well as adapted build paths (e.g., cores/def). You can inspect the diff here

Let me know if it works and is uploadable to real hardware. Then, libraries like https://github.com/telit/arduino-me310-library should work out of the box, too.

1 Like