Hi!,
I’m trying to get started with the RAK11310 LoRa module. My first attempts with Arduino IDE have been working fine.
Now I’m setting up my PlatformIO based development environment, but can’t get compilation to work. I’ve taken all the steps at https://learn.rakwireless.com/hc/en-us/articles/26687276346775-How-To-Perform-Installation-of-Board-Support-Package-in-PlatformIO
- Set up Visual Studio Code
- Set up Platformio extension
- Added the “Raspberry Pi 2040” platform
- Created new project, so the platform files are downloaded
- Added the RAK_PATCH.zip, extracted it to ~/.platformio/RAK_PATCH and can the Python script (succeeded - no error messages):
[thomas@thomas-nb]~/.platformio/RAK_PATCH% python rak_patch.py
Patching RAK4631
Could not find ../platforms/nordicnrf52/boards
Patching RAK11200
Could not find ../platforms/espressif32/boards
Patching RAK11310
Patched RAK11310
Patch done, check output if successful
After that I tried to compile the new (almost empty) project again, which only includes this example source file:
#include <Arduino.h>
// put function declarations here:
int myFunction(int, int);
void setup() {
// put your setup code here, to run once:
int result = myFunction(2, 3);
}
void loop() {
// put your main code here, to run repeatedly:
}
// put function definitions here:
int myFunction(int x, int y) {
return x + y;
}
but compilation fails:
Processing rak11300 (platform: raspberrypi; board: rak11300; framework: arduino)
---------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/raspberrypi/rak11300.html
PLATFORM: Raspberry Pi RP2040 (1.14.0) > WisBlock RAK11300
HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, jlink, raspberrypi-swd)
PACKAGES:
- framework-arduino-mbed @ 4.1.5
- tool-rp2040tools @ 1.0.2
- toolchain-gccarmnoneeabi @ 1.90201.191206 (9.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 42 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/rak11300/src/main.cpp.o
Compiling .pio/build/rak11300/FrameworkArduinoVariant/double_tap_usb_boot.cpp.o
Compiling .pio/build/rak11300/FrameworkArduinoVariant/variant.cpp.o
Compiling .pio/build/rak11300/FrameworkArduino/Interrupts.cpp.o
In file included from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/device.h:35,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/platform.h:28,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/FileHandle.h:25,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/macros.h:41,
from /home/thomas/.platformio/packages/framework-arduino-mbed/variants/WisBlock_RAK11300_Board/pins_arduino.h:2,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/Arduino.h:76,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/Interrupts.cpp:19:
/home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/objects.h:36:10: fatal error: pico/rand.h: No such file or directory
36 | #include "pico/rand.h"
| ^~~~~~~~~~~~~
compilation terminated.
*** [.pio/build/rak11300/FrameworkArduino/Interrupts.cpp.o] Error 1
In file included from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/device.h:35,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/platform.h:28,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/FileHandle.h:25,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/macros.h:41,
from /home/thomas/.platformio/packages/framework-arduino-mbed/variants/WisBlock_RAK11300_Board/pins_arduino.h:2,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/Arduino.h:76,
from /home/thomas/.platformio/packages/framework-arduino-mbed/variants/WisBlock_RAK11300_Board/variant.cpp:1:
/home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/objects.h:36:10: fatal error: pico/rand.h: No such file or directory
36 | #include "pico/rand.h"
| ^~~~~~~~~~~~~
compilation terminated.
*** [.pio/build/rak11300/FrameworkArduinoVariant/variant.cpp.o] Error 1
In file included from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/device.h:35,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/platform.h:28,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/FileHandle.h:25,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/Serial.h:27,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/Arduino.h:104,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/macros.h:26,
from /home/thomas/.platformio/packages/framework-arduino-mbed/variants/WisBlock_RAK11300_Board/double_tap_usb_boot.cpp:6:
/home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/objects.h:36:10: fatal error: pico/rand.h: No such file or directory
36 | #include "pico/rand.h"
| ^~~~~~~~~~~~~
compilation terminated.
*** [.pio/build/rak11300/FrameworkArduinoVariant/double_tap_usb_boot.cpp.o] Error 1
In file included from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/device.h:35,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/platform.h:28,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/FileHandle.h:25,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/macros.h:41,
from /home/thomas/.platformio/packages/framework-arduino-mbed/variants/WisBlock_RAK11300_Board/pins_arduino.h:2,
from /home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/Arduino.h:76,
from src/main.cpp:1:
/home/thomas/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/objects.h:36:10: fatal error: pico/rand.h: No such file or directory
36 | #include "pico/rand.h"
| ^~~~~~~~~~~~~
compilation terminated.
*** [.pio/build/rak11300/src/main.cpp.o] Error 1
================================ [FAILED] Took 3.81 seconds ================================
* The terminal process "platformio 'run'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
It looks like some files from the Pico SDK cannot be found. I’m quite new to Platform.io and the whole evosystem, so I’m grateful for some guidance and tips how to fix it.
Update: Compilation works fine when setting
board = pico
in platformio.ini, but that of course does not match the RAK11300 board. Still it shows that the problem is probably specific to the RAK11300 files / patches.