Custom Variant for Custom board

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.

3 Likes