PlatformIO Community

Is there a quick way to add a new board based on a fork of an existing platform?

hi

We’ve added a new ESP32-based board to arduino-esp32 by forking the repo and giving the URL of the fork to the Arduino IDE. A little tinkering with boards.txt and variants/my-board and away we go :slight_smile:

Is there a similar way to fork GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO and get working with PlatformIO? (Our board is similar to several other boards so for the Arduino IDE we just duplicated a definition and modified it a little.)

Thanks!
Hamish

If you just want to add a new board, then no, no need to fork the platform. You can create a boards/ folder in your project and put the board JSON definition there. This is documented.

See e.g. example in M5stack Paper help, helloworld does not execute, default platform.ini seems broken. I have a working guess - #7 by maxgerhardt

Thanks Max. How would I then add that board to the platform in such a way that others can use it?

If you chose to create the board in the platform context (boards/ folder in a e.g. GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO fork) instead of the project context (boards/ folder in a reference project), then users will have to use your forked platform to use the board, which is done through the platformio.ini.

; instead of platform = espressif32
; or platform = https://github.com/platformio/platform-espressif32.git
platform = <link to your fork here>

Ok, so to add a board to the platform the set of steps is:

Is that right?
Thanks for your help!

That’s exactly right.

An example of that is Update for DFRobot ESP32 boards by doskoi · Pull Request #829 · platformio/platform-espressif32 · GitHub.

1 Like