Open LeStarch opened 4 months ago
Did you run:
arduino-cli lib install Time
Instructions are here:
Required Dependencies:
arduino-cli lib install Time
If you will be using the TcpClient
component, install:
arduino-cli lib install WiFi
I did. It works with building the deployment. Just not the raw project.
It might be that some of the hooks for libraries etc are done on deployments and not on the full project build.
Right. I see what's going on. Yes you are correct. When running fprime-util build
when no deployment is present (i.e. if you want to build for the Led component itself), the arduino-cli wrapper doesn't seem to be importing all the arduino libraries correctly which result in dependency errors.
In the tutorial, I ended up putting the Add Arduino Deployment
step near the beginning before running fprime-util build
.
Edit: Seems that building the LED component with no deployment works now, but raw project does not work still.
FYI, this is not a TimeLib issue. I remember getting a similar error with the SPI and Wire.h libraries, they are also not linked properly when no component/deployment is present in the project. See below:
In file included from /home/ethan/work/fprime-projects/fprime-community/fprime-tutorial-arduino-blinker/fprime-arduino/Arduino/Drv/SpiDriver/SpiDriver.cpp:8:
/home/ethan/work/fprime-projects/fprime-community/fprime-tutorial-arduino-blinker/fprime-arduino/Arduino/Drv/SpiDriver/SpiDriver.hpp:11:10: fatal error: SPI.h: No such file or directory
11 | #include <SPI.h>
| ^~~~~~~
compilation terminated.
gmake[2]: *** [Arduino/Drv/SpiDriver/CMakeFiles/Arduino_Drv_SpiDriver.dir/build.make:91: Arduino/Drv/SpiDriver/CMakeFiles/Arduino_Drv_SpiDriver.dir/SpiDriver.cpp.obj] Error 1
[ 75%] Linking CXX static library ../../../lib/rpipicow/libDrv_BlockDriver.a
[ 75%] Built target Drv_BlockDriver
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/ethan/work/fprime-projects/fprime-community/fprime-tutorial-arduino-blinker/fprime-arduino/Arduino/Drv/SpiDriver/SpiDriverArduino.cpp:8:
/home/ethan/work/fprime-projects/fprime-community/fprime-tutorial-arduino-blinker/fprime-arduino/Arduino/Drv/SpiDriver/SpiDriver.hpp:11:10: fatal error: SPI.h: No such file or directory
11 | #include <SPI.h>
| ^~~~~~~
compilation terminated.
gmake[2]: *** [Arduino/Drv/SpiDriver/CMakeFiles/Arduino_Drv_SpiDriver.dir/build.make:105: Arduino/Drv/SpiDriver/CMakeFiles/Arduino_Drv_SpiDriver.dir/SpiDriverArduino.cpp.obj] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:4926: Arduino/Drv/SpiDriver/CMakeFiles/Arduino_Drv_SpiDriver.dir/all] Error 2
Yes, this call comes from the line: finalize_arduino_executable("${FPRIME_CURRENT_MODULE}")
in the deployment CMake. This line fixes library usages...but isn't done at the project level.
For now, I am just tracking the issue.
Following the steps, but building after "new project" and before "new deployment" causes a crash with "cannot find #include"