Adding new Arduino-based boards

How do you add boards that are available for Arduino IDE but not available yet in PlatformIO?

1 Like

What is a name of the board? Take a look at Custom Embedded Boards — PlatformIO latest documentation

Oh cool, I guess you’ve updated the documentation since I last looked. I’d like to use PlatformIO for the Udoo Neo.

We had it in documentation but this info about custom board and platform was located in Docs > Instruments > Platforms & Boards > Custom Board & Platform.

How do you program this board with Arduino IDE?

They have an Arduino board package available: https://github.com/UDOOboard/arduino-board-package

We an issue for that Support UDOO boards · Issue #439 · platformio/platformio-core · GitHub.

Looks like this board uses the same M4 chip that is used in Arduino Due. Please take a look at PlatformIO 3.0 atmelsam development platform

i have the same noob Q

i use this link to add a custom board to arduino ide, but i want to use platform.io as i use it for a re-arm
https://raw.githubusercontent.com/ThamesValleyReprapUserGroup/Beta-TVRRUG-Mendel90/master/Added-Documents/OMC/package_omc_index.json

how would i add that as an PR ?
its a 644p based board

by looking at the boards.txt from the zip in the json link i just posted i came up wiht this json

i simply took the sanguino_atmega644.json file and edited it with what i think is correct

{
“build”: {
“core”: “arduino”,
“extra_flags”: “-DARDUINO_AVR_SANGUINO”,
“f_cpu”: “20000000L”,
“mcu”: “atmega644”,
“variant”: “sanguino”
},
“frameworks”: [
“arduino”
],
“name”: “OMC with Atmega644 at 20Mhz”,
“upload”: {
“maximum_ram_size”: 4096,
“maximum_size”: 63488,
“protocol”: “stk500v2”,
“require_upload_port”: true,
“speed”: 115200
},
“url”: “”,
“vendor”: “”
}

does it look somewhat correct? and what about pin connections?

The board .json looks ok… and I’d also add the URL and vendor info… and then do a PR to GitHub - platformio/platform-atmelavr: Atmel AVR: development platform for PlatformIO as it should be able to go in the boards folder there. :wink:

The pin connections should be fine, unless they’ve changed them from the sanguino pins_arduino.h layout. At a quick glance they havn’t, but the variants file included with PlatformIO is an older version of Sanguino/pins_arduino.h at master · Lauszus/Sanguino · GitHub, so that needs updating anyway…

btw, IIRC, you can create a boards subfolder in your .platformio home directory, and put the json file there… like this… Custom Embedded Boards — PlatformIO latest documentation

There is none hence i left it out, its a board made by a group that used to gather people and then do group builds back in 2013 and a few years after and before, until china started to flood the market with cheap 3d printers

i will try and put the json file in a subfolder first and test it out

but how do i update the pins_arduino.h and test that locally ?

Fair enough. For the URL, you could probably use the github repo : GitHub - ThamesValleyReprapUserGroup/Beta-TVRRUG-Mendel90: TVRRUG Version of Mendel90

For the pins_arduino.h, you’d want to update your $HOME/.platformio/packages/framework-arduinoavr/variants/sanguino/pins_arduino.h file… replacing $HOME with %USERPROFILE% if you’re on Windows.

I would like to add the board Seeed Studio XIAO nRF52480 (sense). Could you provide a json file that I can use to create my_board?

That is already covered in https://github.com/platformio/platform-nordicnrf52/pull/151 and needed abit more than just a board defnition: New framework forks, build script adaptions, et cetera.

Thank you for your answer.

I have followed the different steps and got the blink program on the xiaoblesense board compiled. I get a few warnings.

On the wiki page Getting Started | Seeed Studio Wiki there are references to two libraries and it is suggested to use the first one when not using the sensors :
“It is recommanded to use the Seeed nRF52 Boards library if you want to apply Bluetooth function and “Low Energy Cost Function”.”

As far as I understood, the solutiong given is for the other one?

What should I change to install this library?

The Adafruit core supports the Bluefruit library and thus BLE on the Xiao BLE Sense. I explicitly test that this compiles through the CI and the example

The ArduinoCore-mbed does not seem to have BLE support for that board.

I have tried this and got the following error when compiling a simple program:

In file included from /home/alfons/.platformio/packages/framework-arduinoadafruitnrf52/cores/nRF5/Arduino.h:41:0,
from /home/alfons/.platformio/packages/framework-arduinoadafruitnrf52/cores/nRF5/IPAddress.cpp:20:
/home/alfons/.platformio/packages/framework-arduinoadafruitnrf52/cores/nRF5/WVariant.h:24:10: fatal error: nrf_soc.h: No such file or directory

A similar message at other places.

I could also not find nrf_soc.h and install it from platformio.org

Please post the exact project files you’re having problems with to Github or google drive. (platformio.ini + source code etc)

Thank you for your reply. I hope this is ok:
https://drive.google.com/drive/folders/1eJP88S2LaoyhJgpclGQ34RItx13KPwrb?usp=sharing

o_O? Completely wrong usage. You added your own board definition, but that misses all platform modifications that this board actually needs (using a special core etc. and all these changes). You were supposed to use the forked platform like in the PR description

[env]
platform = https://github.com/maxgerhardt/platform-nordicnrf52
framework = arduino
monitor_speed = 115200

[env:xiaoblesense_adafruit_nrf52]
board = xiaoblesense_adafruit
  1. Delete xiaoblesense_adafruit.json from your project
  2. use the platformio.ini content as exactly provided above

Thank your for your reply.
I have done this and now the program compiles and I can upload it.

But this words differently from what I am used to. After uploading the port /dev/ttyACM0 is no longer available and hence, I can not use the monitor.

Further, to open this port again, I have to double click (or something like that) the tiny reset button on the board.

I noticed that during the process, the following library is installed:
lib_deps = adafruit/Adafruit TinyUSB Library@^2.4.1
Do I have to use this to get the monitor via de usb connection working? And if so, how?
Thank you again for your help.