Trying to setup SKR-PRO 1.2, not getting my variants right?

Hello, I hope you’re doing well today.

I’m trying to setup a BIGTREE SKR-PRO 1.2 with arduino framework in vscode+platformio.
When I compile I get a lot of “fatal error: variant.h: No such file or directory

I know Marlin supports the board so I copied some of their config settings.
My project root has

/platformio/boards/BigTree_SKR_Pro.json (from marlin)
/platformio/variants/BIGTREE_SKR_PRO_1v1/(from marlin, many files including variant.h)

platformio.ini is

boards_dir = platformio/boards

framework = arduino
platform = ststm32
board = BigTree_SKR_Pro
build_unflags = -std=gnu11
lib_ignore =
build_flags =
upload_port = anything

I saw another forum post that mentioned a variants_dir but I can’t find it in the documentation.
How do I correctly tell platformio where the variants file is located?

Thank you and stay well!

Well the magic in Marlin is done with the Python extra script

You see that it dynamically copies the folder buildroot/share/PlatformIO/variants/<variant> to the Arduino STM32 core framework folder (C:\Users\<user>\.platformio\packages\framework-ststm32\variants on Windows).

But it can also be done more elegantly with, as you mentioned,

The request for proper documentation is already open. Until then, the information that adding

board_build.variants_dir = <path to new folder with variants>
board_build.variant = <selected variant>

is a valid build option of the Arduino STM32 core is enough. There’s also an example available.

So you should try adding

board_build.variants_dir = platformio/variants
board_build.variant = BIGTREE_SKR_PRO_1v1

to the platformio.ini and retry.

1 Like

Thanks for the great reply, that was a huge help! LED works, motors all work…

But one hiccup: I can’t seem to get HardwareTimer to attach.

HardwareTimer *MyTim;

void UpdateLED(HardwareTimer *htim) {

void setup() {
  MyTim = new HardwareTimer(TIM6);

void loop() {}

I don’t know if I’m using Maple or Core. I see ST STM32 — PlatformIO latest documentation mentions board_build.core… is this another undocumented feature? The header file mentions “Daniel Fekete” so it’s probably STM32Generic?

If anyone has a hint how to make the hardware timer work it would be the best!

Thank you,

Given that the board JSON definition says

It uses, not maple ( Otherwise the value of core would have been maple, as documented in your link above already.

One has to be careful with the versions here. If you look at the the wiki it will refer to the latest bleeding-edge version. The last PlatformIO update of the STM32Duino core contains 1.9.0, not the freshly (11 days) released 2.0.0 version.

Compared to the example code

You’re missing a call to setMode().

Otherwise, have you verified that it works in a normal-style blocking blinky before doing it with a timer?

You may also try different timers or different versions of the above referenced example (click on the upper left “1.2.0” version icon to see more versions / tags).

Yes! setMode() was the magic sauce. Thank you!

1 Like