I’m having issues setting up a project using Daisy Seed libraries, specifically libDaisy, on platformio.
I’m running PIO v3.1.1 on VSCode v1.78.2.23132 installed via snap v2.59.2 on Ubuntu 23.04.
My platformio.ini file is as follows:
[env:electrosmith_daisy_libs]
platform = ststm32
board = electrosmith_daisy
framework = arduino
lib_ldf_mode = deep+
lib_deps =
https://github.com/electro-smith/DaisySP.git
https://github.com/electro-smith/libDaisy.git
https://github.com/electro-smith/DaisyDuino.git
build_flags =
;-w ; optional - to suppress redundant definition warnings
-D HAL_SDRAM_MODULE_ENABLED ; required? build fails without this one
; These flags enable serial monitor over USB UART
-D USBD_USE_CDC ; Define USB Communications Device Class (for serial I/O)
-D USBCON ; Enable USB connection in Arduino (?)
; This is not documented on PlatformIO website but
; enables the DFU firmware upload (over USB)
upload_protocol = dfu
When I use PIOs list dependencies, I get:
Resolving electrosmith_daisy_libs dependencies...
Platform ststm32 @ 15.6.0 (required: ststm32)
├── framework-arduinoststm32 @ 4.20400.0 (required: platformio/framework-arduinoststm32 @ ~4.20400.0)
├── framework-cmsis @ 2.50700.210515 (required: platformio/framework-cmsis @ ~2.50700.0)
├── framework-stm32cubeh7 @ 1.9.0 (required: platformio/framework-stm32cubeh7 @ ~1.9.0)
├── tool-dfuutil @ 1.11.0 (required: platformio/tool-dfuutil @ ~1.11.0)
├── tool-ldscripts-ststm32 @ 0.2.0 (required: platformio/tool-ldscripts-ststm32 @ ~0.2.0)
└── toolchain-gccarmnoneeabi @ 1.90201.191206 (required: platformio/toolchain-gccarmnoneeabi @ ~1.90201.0)
Libraries
├── DaisyDuino @ 1.6.3+sha.0932d70 (required: git+https://github.com/electro-smith/DaisyDuino.git)
├── DaisySP @ 0.0.0+20230517121042.sha.ed11433 (required: git+https://github.com/electro-smith/DaisySP.git)
└── googletest @ 1.10.0+sha.b65a1ba (required: git+https://github.com/electro-smith/libDaisy.git)
Which means PIO is adding libDaisy as googletest for some reason…
While building, this is confirmed by this part of the output:
Scanning dependencies...
Dependency Graph
|-- DaisySP @ 0.0.0+20230517121042.sha.ed11433
|-- DaisyDuino @ 1.6.3+sha.0932d70
Building in release mode
libDaisy’s missing. When I look inside the libdeps folder:
Yup, it’s missing.
When I try to install the libDaisy manuall via pio cli:
pio pkg install --library "https://github.com/electro-smith/libDaisy.git#5.3.0"
This is the output I’m getting:
Resolving electrosmith_daisy_libs dependencies...
Library Manager: Installing git+https://github.com/electro-smith/libDaisy.git#v5.3.0
git version 2.39.2
Cloning into '/home/usr/.platformio/.cache/tmp/pkg-installing-c760dxgd'...
remote: Enumerating objects: 1049, done.
remote: Counting objects: 100% (1049/1049), done.
remote: Compressing objects: 100% (916/916), done.
remote: Total 1049 (delta 282), reused 330 (delta 119), pack-reused 0
Receiving objects: 100% (1049/1049), 8.07 MiB | 1.97 MiB/s, done.
Resolving deltas: 100% (282/282), done.
Note: switching to '07a813a09e8386b7dcb0b84bd867db0215f7c149'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
Submodule 'tests/googletest' (https://github.com/google/googletest.git) registered for path 'tests/googletest'
Cloning into '/home/usr/.platformio/.cache/tmp/pkg-installing-c760dxgd/tests/googletest'...
remote: Enumerating objects: 26287, done.
remote: Counting objects: 100% (262/262), done.
remote: Compressing objects: 100% (142/142), done.
remote: Total 26287 (delta 137), reused 189 (delta 108), pack-reused 26025
Receiving objects: 100% (26287/26287), 12.48 MiB | 2.15 MiB/s, done.
Resolving deltas: 100% (19409/19409), done.
Submodule path 'tests/googletest': checked out 'f5e592d8ee5ffb1d9af5be7f715ce3576b8bf9c4'
Library Manager: googletest@1.10.0+sha.07a813a has been installed!
So it seems that because libDaisy has a submodule named tests/googletest, libDaisy is being installed under that name and I guess that breaks the dependencies in PIO?
When trying to install from a folder (the one from DaisyExamples compiled right there with make) as defined in platformio.ini:
libDaisy=file:///home/usr/DaisyExamples/libDaisy/
The foldername is correct because I force it to be libDaisy, but the contents are those of tests/googletest YET AGAIN!!!
At this point I have no idea how to go about adding libDaisy in platformio. How can I do that correctly? Maybe I clone the librabry, remove the tests/googletest submodule and import it then? Would that work?
When we’re on that topic: why isn’t there an official instruction on how make Daisy work with PIO? Is PIO a platform the devs at ElectroSmith just don’t want to cooperate with?