micro_ros_arduino RP2040 Connect build trouble SPI.h not found?
Hello All, as much as I hate to admit I'm officially stuck. Thanks for any help you can offer.
I have been trying to get micro_ros_arduino to build as per the docs located here: https://github.com/micro-ROS/micro_ro...
However I still cannot build anything. Does this rely on any libraries installed with the Arduino IDE?
My testing main.cpp is just a blink sketch that works fine otherwise with PIO. It has no other code.
My platoformio.ini is setup per the docs but I get build errors that claims it cannot find SPI.h (see below)
What I have tried.
Adding SPI manually in a few different ways.
putting arduino-libraries/SPI as a lib_dep simply reported that the library was built in and not needed.
Adding SPI as a lib_dep
lib_ignore SPI
Results: Build got past SPI not found error but build then spits out some initial warnings regarding WIFi (captured below) then about 500+ more lines of warnings from libmicroros and then fails with collect2: error: ld returned 1 exit status
Arduino RP2040 Connect Ubuntu20.04 VSCode, Foxy VsCode Version: 1.65.2 Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Linux x64 5.13.0-35-generic
SPI.h Error
Processing nanorp2040connect (platform: raspberrypi; board: nanorp2040connect; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/raspberrypi/nanorp2040connect.html
PLATFORM: Raspberry Pi RP2040 (1.5.0) > Arduino Nano RP2040 Connect
HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, jlink, raspberrypi-swd)
PACKAGES:
- framework-arduino-mbed 2.4.1
- tool-rp2040tools 1.0.2
- toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain+, Compatibility ~ soft
Found 32 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <micro_ros_arduino> 2.0.3-galactic+sha.8b64548
| |-- <WiFiNINA> 1.8.13
|-- <WiFiNINA> 1.8.13
Building in release mode
Compiling .pio/build/nanorp2040connect/src/main.cpp.o
Compiling .pio/build/nanorp2040connect/libb5c/WiFiNINA/utility/spi_drv.cpp.o
Compiling .pio/build/nanorp2040connect/libb70/micro_ros_arduino/native_ethernet_transport.cpp.o
Compiling .pio/build/nanorp2040connect/libb70/micro_ros_arduino/wifi_transport.cpp.o
.pio/libdeps/nanorp2040connect/WiFiNINA/src/utility/spi_drv.cpp:22:10: fatal error: SPI.h: No such file or directory
*************************************************************
* Looking for SPI.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:SPI.h"
* Web > https://registry.platformio.org/search?q=header:SPI.h
*
*************************************************************
#include <SPI.h>
^~~~~~~
compilation terminated.
*** [.pio/build/nanorp2040connect/libb5c/WiFiNINA/utility/spi_drv.cpp.o] Error 1
.pio/libdeps/nanorp2040connect/micro_ros_arduino/src/wifi_transport.cpp:10:10: fatal error: SPI.h: No such file or directory
Warnings
Indexing .pio/build/nanorp2040connect/libb5c/libWiFiNINA.a
Compiling .pio/build/nanorp2040connect/FrameworkArduinoVariant/nina_pins.cpp.o
Compiling .pio/build/nanorp2040connect/FrameworkArduinoVariant/variant.cpp.o
.pio/libdeps/nanorp2040connect/micro_ros_arduino/src/wifi_transport.cpp: In function 'size_t arduino_wifi_transport_read(uxrCustomTransport*, uint8_t*, size_t, int, uint8_t*)':
.pio/libdeps/nanorp2040connect/micro_ros_arduino/src/wifi_transport.cpp:53:33: warning: comparison between signed and unsigned integer expressions ...
Above was a known issue however the fix did not work 100%
see https://github.com/micro-ROS/micro_ro...
Adding a kind of answer to my own question...
It compiles now... but I have a warning.
I still had to manually include lib_dep = SPI and I got a few warnings that mean nothing to me I hope it's not a problem.