Tips for Adding an Arduino-Compatible Board to PlatformIO

Hello everyone and thanks for stopping by.

So, I have a Telit EVK – Charlie board. It’s an ATSAMD21G18A-based board. Since this MCU is already supported by PIO, I naively thought that flashing this board using PIO would be as simple as:

platform = atmelsam
board = samd21g18a

Unfortunately, even after tweaking the upload_protocol, I can’t successfully flash the board…

Given the fact that this board is already supported by the Arduino IDE, is there a little guide to help me make this board PIO compatible?

The Arduino IDE is really painful to use; I really enjoy using PIO.

Thanks for considering helping me.

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

Amazing sir!

I can confirm the board is flashing nicely and goes blinky!

Thank you for your time!
Is there any PR needed to hopefully get this board natively supported by the atmelsam platform?

I’ve filed a pull request here to request inclusion into mainline

1 Like