Hey man, thanks for the extensive explanation! I think I got i right:
I copied the board file I based my design on (nrf52_dk.json) into the “boards” folder of my PIO project. In it, I added a specific variant of the board, and specified “variants_dir” and as “variants” which is the folder I also created in the PIO project. In “variants” I created my custom board name folder and copied .cpp and .h files from the original variant. To wrap it up, the folder structure looks somewhat like this:
... boards - custom_board.json // here is the "variant" = "my_variant", and "variant_dir" = "variants" variants - my_variant - pins_arduino.h - variant.h - variant.cpp ...
If I may add, it is also necessary to include variants folder in the build process by adding
build_flags = -I variants/my_variant into the platformio.ini
So, the compilation itself runs just fine, everything seems to be compiled nicely, but the build process ends in error. For some reason linker script fails, and it doesn’t display any error. Any idea what might be behind that?