Problem compiling on Platform IO

I am trying to build a new development environment an a new laptop using WIndows.

I followed the instructions

I am testing with a null project with just the basic main.cpp.
I am getting an error for missing SPI.h

#include <SPI.h>
compilation terminated.
*** [.pio\build\wiscore_rak4631\libf68\SX126x-Arduino\boards\mcu\nrf52832\spi_board.cpp.o] Error 1
In file included from .pio\libdeps\wiscore_rak4631\SX126x-Arduino\src/boards/mcu/spi_board.h:6:0,
from .pio\libdeps\wiscore_rak4631\SX126x-Arduino\src\boards\sx126x\sx126x-board.cpp:40:
.pio\libdeps\wiscore_rak4631\SX126x-Arduino\src/boards/mcu/nrf52832/spi_board.h:3:10: fatal error: SPI.h: No such file or directory


Hi Allan,

what happens when you change the board in platformio.ini to adafruit_feather_nrf52840

like this:

platform = nordicnrf52
board = adafruit_feather_nrf52840
framework = arduino

Does it compile?

There is now an easier way to patch the PlatformIO package and platform folders: RAK-PATCH

I have run this as instructed but it generates no output and the problem still exists

Probably because I don’t have python installed! Surprised Windows didn’t complain.

Python is installed and the patch claims to have worked, but I still have the same problem

Did you try this? What is the output?
I don’t think your problems are related to the RAK4631 patch. Something went wrong with your PlatformIO installation. Please change your platformio.ini to the above and test if a “default” board can compile.

I did try that and it didn’t work. I did reply but it got bounced as it was too short. Hope this one makes it


If an Adafruit default board is not compiling then something went wrong with your Adafruit nRF52 platform installation.

Has nothing to do with our patch.

I suggest to uninstall the Adafruit platform and try to install fresh. Try first to compile an Adafruit board. If that works, apply the patch.

I had only just changed the board name.
I now just also removed the lib_deps line and it compiled OK
If I replace it - including the GNSS library2.0.15 and your sx126x-Arduino 2.0.6, it fails


PlatformIO problem.

Keep the lib_deps
Add the includes for LoRa and GNSS into your empty code

#include <Arduino.h>
#include <LoRaWAN-Arduino.h>
#include <Sparkfun_u-blox_GNSS_Arduino_Library.h>

void setup() {
  // put your setup code here, to run once:

void loop() {
  // put your main code here, to run repeatedly:

And it compiles.

Great, Thanks.

That worked fine. Just need to experiment to find out why I had a problem with my code in the first place.