PlatformIO has pre-built settings for the most popular embedded boards. This list is available:
Embedded Boards Explorer (Web)
platformio boards (CLI command)
Nevertheless, PlatformIO allows one to create own board or override existing board’s settings. All data is declared using JSON-style via associative array (name/value pairs).
The key fields:
build
data will be used by Development Platforms and Frameworks builders
frameworks
is the list with supported Frameworks
platform
name of Development Platforms
upload
upload settings which depend on the platform
{
"build": {
"extra_flags": "-DHELLO_PLATFORMIO",
"f_cpu": "16000000L",
"hwids": [
[
"0x1234",
"0x0013"
],
[
"0x4567",
"0x0013"
]
],
"mcu": "%MCU_TYPE_HERE%"
},
"frameworks": ["%LIST_WITH_SUPPORTED_FRAMEWORKS%"],
"name": "My Test Board",
"upload": {
"maximum_ram_size": 2048,
"maximum_size": 32256
},
"url": "http://example.com",
"vendor": "MyCompany"
}
Create boards
directory in home_dir if it
doesn’t exist.
Create myboard.json
file in this boards
directory.
Search available boards via platformio boards command. You should see
myboard
board.
Now, you can use myboard
for the board option in
“platformio.ini” (Project Configuration File).
Note
You can have custom boards per project. In this case, please put your board’s JSON files to boards_dir.
Please take a look at the source code of
PlatformIO Development Platforms
and navigate to boards
folder of the repository.