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)
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?
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.
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!
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).