Rak4631 not compiling

Hello! I hope everyone is doing well.
Could you help me with a problem, please?
I’m trying to compile a project using platformio and the rak4631 board. However, when I try to build the project, I get this message:

" from C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\libraries\Adafruit_TinyUSB_Arduino\src\arduino\Adafruit_USBD_CDC.cpp:29:
C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\cores\nRF5/Uart.h:27:10: fatal error: variant.h: No such file or directory


  • Looking for variant.h dependency? Check our library registry!
  • CLI > platformio lib search “header:variant.h”
  • Web > PlatformIO Registry

#include “variant.h”
^~~~~~~~~~~
compilation terminated.
*** [.pio\build\wiscore_rak4631\libf02\Adafruit_TinyUSB_Arduino\arduino\Adafruit_USBD_CDC.cpp.o] Error 1
In file included from C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\cores\nRF5/Arduino.h:60:0,
from C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\libraries\Adafruit_TinyUSB_Arduino\src\arduino\Adafruit_USBD_Device.cpp:35:
C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\cores\nRF5/Uart.h:27:10: fatal error: variant.h: No such file or directory


  • Looking for variant.h dependency? Check our library registry!
  • CLI > platformio lib search “header:variant.h”
  • Web > PlatformIO Registry

#include “variant.h”
^~~~~~~~~~~
compilation terminated.
*** [.pio\build\wiscore_rak4631\libf02\Adafruit_TinyUSB_Arduino\arduino\Adafruit_USBD_Device.cpp.o] Error 1
In file included from C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\cores\nRF5/Arduino.h:60:0,
from C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\libraries\Adafruit_TinyUSB_Arduino\src\arduino\ports\nrf\Adafruit_TinyUSB_nrf.cpp:32:
C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\cores\nRF5/Uart.h:27:10: fatal error: variant.h: No such file or directory


  • Looking for variant.h dependency? Check our library registry!
  • CLI > platformio lib search “header:variant.h”
  • Web > PlatformIO Registry

#include “variant.h”
^~~~~~~~~~~
compilation terminated.
*** [.pio\build\wiscore_rak4631\libf02\Adafruit_TinyUSB_Arduino\arduino\ports\nrf\Adafruit_TinyUSB_nrf.cpp.o] Error 1
In file included from C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\cores\nRF5/Arduino.h:60:0,
from C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\libraries\Adafruit_TinyUSB_Arduino\src\arduino\webusb\Adafruit_USBD_WebUSB.cpp:30:
C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\cores\nRF5/Uart.h:27:10: fatal error: variant.h: No such file or directory


  • Looking for variant.h dependency? Check our library registry!
  • CLI > platformio lib search “header:variant.h”
  • Web > PlatformIO Registry

#include “variant.h”
^~~~~~~~~~~
compilation terminated.
*** [.pio\build\wiscore_rak4631\libf02\Adafruit_TinyUSB_Arduino\arduino\webusb\Adafruit_USBD_WebUSB.cpp.o] Error 1"

Could you help me solve this problem, please?
Thank you very much in advance!
Edit: I found this on github.

Are this the files that are missing?
If so, where should I add them?
Thank you very much again.

1 Like

Looks like it cannot find the variant.h file.
What did you do to incorporate Wisblock into PlatformIO, it’s not totally automatic ( or was not last I ran it).

Did you run something like this??

Should have a WisCore sub dir in the framework install directory.
On Linux it would be:
~/.platformio/packages/framework-arduinoadafruitnrf52/variants/WisCore_RAK4631_Board/

On Windows looks like: C:\Users\user.platformio\packages\framework-arduinoadafruitnrf52\variants

It’s helpful in a case like this to also post the content of your project’s platformio.ini, could be something amiss there.

Try to use

#include <Arduino.h>
#include <Adafruit_TinyUSB.h>

Looks like the compiler cannot find the USB library.

Have just been playing with PlatformIO and am getting the same error above when trying to compile. Where do I insert these dependancies?

At the beginning of your sketch

haha I was using yours…lol

I wanted to give this a go as I have never tried it, but when I do try and compile from platformIO i get similar errors.

I have installed the RAK_PATCH.zip and it looked to have downloaded the libraries.

Try to clean the build and then compile again.
image

I am seeing similar error (not finding include files) since the last update of PIO. Cleaning the project usually helps.

no change, all the errors seem to be related to TinyUSB. I’ll keep trying ti investigate.

Hello guys

here is how I fixed my build.

  1. open VSC
  2. remove the Nordic nRF52 platform
  3. closed VSC
  4. reopend VSC (the Nordic nRF52 platform was downloaded automatically again complaining about Unknown board ID ‘wiscore_rak4631’
  5. closed VSC
  6. run RAK_PATCH
  7. open VSC (again installs some stuff automatically)
  8. compile example (fails with variant.h not found issue)
  9. close VSC
  10. run RAK_PATCH a second time
  11. open VSC
  12. compile example work now

Thanks
Felix

1 Like