Custom Variant for Custom board

Hello all,

i have already created a custom board definition for the arduinonrf5 framework.
For this board i’m need a changed variant. This is also already created and works if i copy them to the variants dir of the framework directory.

my qustion now is it possible to comple with vscode and platformio and load the variant from project scope. Like using the boards dir in the project directory. Or is ther another option to syncronize changes to that between multiple developers and computers ?

regards Enny


This is exactly what the mbed-custom-target example does, have tried that?

It seems that if you need to add your custom ‘variant’ then you can use build.variants_dir in your pio.ini. At least this is achievable with Arduino with STM32Core because there is a selection code in its build script.

Added 3 hours later: this is a little bit more complicated. In order to add your own variant to your Project space you need to do the following three things:

  1. Create your custom board manifest in /boards folder of your project.
  2. Set in the board manifest “variants_dir”: “variants” property that points to the variants folder at your project.
  3. Create variants folder and put there folder with name specified in “variant”: “xxxxx” property of your custom board manifest. Put into this folder all the board specific files.

After PIO can argues that it can’t find linker (LDscript) but it is not true, the script will be executed.


Do you have a link to your Github? I am just starting this process.

came here today to write the same question. Hopefully, you have solved it by now.

I managed to make custom board build work, but only if my “variant” resides in the core PIO frameworks “variants” directory. DId you manage to make it work from the project directory?

See Custom nRF52832 board pinout - #8 by maxgerhardt for your case.

1 Like