libDaisy + DaisySP on PlatformIO

Hello everyone!

Tenkai from Zetaohm here. I am working on putting together an example project for DaisySP and libDaisy using PlatformIO. So far, I have forked both DaisySP and libDaisy and created library.json files for both which has enabled PlatformIO to properly compile at least libDaisy. I am able to compile, link and upload code successfully.

My problems begin when I try and get any of the sound generating examples to work. It appears that the DSP loops are stuck making a single tone, and it appears the same no matter which example I put in the main.cpp file. Not being super familiar with the code, I am not entirely sure how to begin troubleshooting it. I have a feeling it might have to do with the sram access, thats just a hunch.

Here is the code base I am working with:

If you clone it, make sure to do a git submodule init; git submodule update since I have two submodules for each of the forked library repos.

Any pointers would be much appreciated!

T

I have got DSP now working!

I renamed the repo, because I guess I diddn’t realize it needed the stm32cube framework instead of the CMSIS framework.

I also modified libDaisy and DaisySP to have library.json files that replace the makefiles, as well as removed the stm32 driver files from libDaisy since they interfered with compilation. But now that I am typing this, I realized that I could probably have just omitted those files from the library.json file. If this is submitted to platformio to be added to their library repo, that should probably be the way it is deployed to maintain a single code base.

Anywho, anybody who wishes to use platformio with the daisypod using stm32cube instead of Daisyduino can now do so!

11 Likes

Hi tenkai,
I am just starting with the Daisy platform, and was trying to get Platformio working with a Daisy Patch. I tried a bit to modify your repo, but I still can’t get past building a project. I’ve also never really used Platformio until now, so I was wondering if your repo is still up to date, and how hard you think it would be to modify it to work with Daisy Patch. Either way, I’m glad I found your repo!

hello! i’ve run into similar problems and it seems like the version of the STM32 framework that PlatformIO includes is too recent for libDaisy! i’ve managed to fix the problem by relinking both submodules and replacing the “Drivers” and “Middlewares” folders in packages/framework-stm32cubeh7 with the ones that are included in libDaisy.

i’ve forked tenkai’s template to reflect all these changes, and i also used the opportunity to fork both libDaisy and DaisySP up to date! GitHub - netherwaves/DaisySeed_Platformio_Example

hopefully this helps :0)

EDIT: i am pretty sure this would work for the Daisy Patch! you’d have to upload a consequent sketch to be sure of it, but i’ve had success with the code that is currently in src so i don’t think it should be a problem :wink:

Sorry for my lack of knowledge. When I use this template, and build, I get the error
“packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30:10: fatal error: stm32h7xx_hal_conf.h: No such file or directory”

This is both before and after modifying the framework.
Do you have any idea why this is happening?

hi! don’t worry, this is also something i’ve had to fight with for hours hehe

this error emerges because the configuration file for the STM32 chip isn’t located in the framework driver files; instead, it’s packaged directly in libDaisy (in src/sys/stm32h7xx_hal_conf.h). i’ve ensured that the PlatformIO include paths allowed this configuration file to be properly located and included on compilation, which the original repository already did; i just ported it to the most recent version of the library!

can you verify that you’ve properly initialized both submodules by running git submodule init and git submodule update --remote? my guess is that the file isn’t found because it doesn’t exist yet… this wasn’t entirely clear for me either while working on this so i’ll make sure to add a note in the README for future folks :0) and let me know!

I have been at it for a while now and I’m still getting the same errors. Maybe I’m not understanding correctly?

I opened a new PlatformIO termial and typed in the mentioned commands. It says DaisySP, libDaisy and stmlib checked out.

When trying to build, it says the exact same thing as in my last comment. Also daisysps.h and daisy_seed.h source files do not exist it says. I’m very new to this, so sorry if I am missing something obvious!

Edit: the libDaisy and DaisySP folders under lib are empty, also after initializing the submodules.

usually this is because PlatformIO hasn’t updated the VS Code includePaths properly as you downloaded the submodules! closing and reopening the VS Code window should do the trick
although now it seems like the submodules are not being fetched at all, which is weird… can you send me a copy of your terminal log when trying to compile?

this is what i have with all steps cleared:

> Executing task: platformio run <

Warning! Ignore unknown configuration option `upload_tool` in section [env:electrosmith_daisy]
Processing electrosmith_daisy (platform: ststm32; board: electrosmith_daisy; framework: stm32cube)
-------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/electrosmith_daisy.html
PLATFORM: ST STM32 (15.2.0) > Electrosmith Daisy
HARDWARE: STM32H750IBK6 400MHz, 128KB RAM, 512KB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES: 
 - framework-stm32cubeh7 1.9.0 
 - tool-dfuutil 1.9.211020 
 - tool-ldscripts-ststm32 0.2.0 
 - toolchain-gccarmnoneeabi 1.90301.200702 (9.3.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ deep, Compatibility ~ soft
running supplimental DaisySP compilation flag script
running supplimental libDaisy compilation flag script
Found 13 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <libdaisy> 0.0.1
|   |-- <STM32_USB_Device_Library-CDC>
|   |   |-- <STM32_USB_Device_Library-Core>
|   |-- <STM32_USB_Device_Library-Core>
|   |-- <STM32_USB_Host_Library-Core>
|   |-- <STM32_USB_Host_Library-MSC>
|   |   |-- <STM32_USB_Host_Library-Core>
|-- <daisysp> 0.0.1
Building in release mode
running supplimental linker script

I tried closing the window and also just fully rebooting. Still having the same issues. I tried fully deleting the project to start from scratch, but that did not seem to help either.

I very much appreciate the help btw!! This is my terminal log

Warning! Ignore unknown configuration option `upload_tool` in section [env:electrosmith_daisy]
Processing electrosmith_daisy (platform: ststm32; board: electrosmith_daisy; framework: stm32cube)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/electrosmith_daisy.html
PLATFORM: ST STM32 (15.2.0) > Electrosmith Daisy
HARDWARE: STM32H750IBK6 400MHz, 128KB RAM, 512KB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES:
 - framework-stm32cubeh7 1.9.0
 - tool-dfuutil 1.9.200310
 - tool-ldscripts-ststm32 0.2.0
 - toolchain-gccarmnoneeabi 1.90301.200702 (9.3.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ deep, Compatibility ~ soft
Found 57 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
running supplimental linker script
Compiling .pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal.o
Compiling .pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_adc.o
Compiling .pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_adc_ex.o
Compiling .pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_cec.o
Compiling .pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_comp.o
Compiling .pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_cordic.o
Compiling .pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_cortex.o
Compiling .pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_crc.o
In file included from packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal.c:36:
packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30:10: fatal error: stm32h7xx_hal_conf.h: No such file or directory

****************************************************************************
* Looking for stm32h7xx_hal_conf.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:stm32h7xx_hal_conf.h"
* Web  > https://registry.platformio.org/search?q=header:stm32h7xx_hal_conf.h
*
****************************************************************************

   30 | #include "stm32h7xx_hal_conf.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal_adc.c:305:
packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30:10: fatal error: stm32h7xx_hal_conf.h: No such file or directory

****************************************************************************
* Looking for stm32h7xx_hal_conf.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:stm32h7xx_hal_conf.h"
* Web  > https://registry.platformio.org/search?q=header:stm32h7xx_hal_conf.h
*
****************************************************************************

   30 | #include "stm32h7xx_hal_conf.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal_adc_ex.c:43:
packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30:10: fatal error: stm32h7xx_hal_conf.h: No such file or directory

****************************************************************************
* Looking for stm32h7xx_hal_conf.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:stm32h7xx_hal_conf.h"
* Web  > https://registry.platformio.org/search?q=header:stm32h7xx_hal_conf.h
*
****************************************************************************

   30 | #include "stm32h7xx_hal_conf.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal_cec.c:113:
packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30:10: fatal error: stm32h7xx_hal_conf.h: No such file or directory

****************************************************************************
* Looking for stm32h7xx_hal_conf.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:stm32h7xx_hal_conf.h"
* Web  > https://registry.platformio.org/search?q=header:stm32h7xx_hal_conf.h
*
****************************************************************************

   30 | #include "stm32h7xx_hal_conf.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_adc.o] Error 1
*** [.pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal.o] Error 1
*** [.pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_adc_ex.o] Error 1
*** [.pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_cec.o] Error 1
In file included from packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal_cortex.c:83:
packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30:10: fatal error: stm32h7xx_hal_conf.h: No such file or directory

****************************************************************************
* Looking for stm32h7xx_hal_conf.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:stm32h7xx_hal_conf.h"
* Web  > https://registry.platformio.org/search?q=header:stm32h7xx_hal_conf.h
*
****************************************************************************

   30 | #include "stm32h7xx_hal_conf.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal_cordic.c:140:
packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30:10: fatal error: stm32h7xx_hal_conf.h: No such file or directory

****************************************************************************
* Looking for stm32h7xx_hal_conf.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:stm32h7xx_hal_conf.h"
* Web  > https://registry.platformio.org/search?q=header:stm32h7xx_hal_conf.h
*
****************************************************************************

   30 | #include "stm32h7xx_hal_conf.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_cortex.o] Error 1
*** [.pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_cordic.o] Error 1
In file included from packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal_comp.c:197:
packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30:10: fatal error: stm32h7xx_hal_conf.h: No such file or directory

****************************************************************************
* Looking for stm32h7xx_hal_conf.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:stm32h7xx_hal_conf.h"
* Web  > https://registry.platformio.org/search?q=header:stm32h7xx_hal_conf.h
*
****************************************************************************

   30 | #include "stm32h7xx_hal_conf.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_comp.o] Error 1
In file included from packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal_crc.c:46:
packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30:10: fatal error: stm32h7xx_hal_conf.h: No such file or directory

****************************************************************************
* Looking for stm32h7xx_hal_conf.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:stm32h7xx_hal_conf.h"
* Web  > https://registry.platformio.org/search?q=header:stm32h7xx_hal_conf.h
*
****************************************************************************

   30 | #include "stm32h7xx_hal_conf.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\electrosmith_daisy\FrameworkHALDriver\Src\stm32h7xx_hal_crc.o] Error 1
============================================================================================= [FAILED] Took 1.32 seconds =============================================================================================
The terminal process "C:\Users\ExeTi\.platformio\penv\Scripts\platformio.exe 'run

It is worth noting; now when typing in the two commands, it gives nothing back. No error, no confirmation. Is it supposed to do that?

Thanks again, I am thoroughly confused at this point :sweat_smile:

this is what i have when running both git submodule commands subsequently:

netherwaves@netherwaves DaisySeed_Platformio_Example % git submodule init
Submodule 'lib/DaisySP' (git@github.com:netherwaves/DaisySP.git) registered for path 'lib/DaisySP'
Submodule 'lib/libDaisy' (git@github.com:netherwaves/libDaisy.git) registered for path 'lib/libDaisy'
netherwaves@netherwaves DaisySeed_Platformio_Example % git submodule update --remote
Cloning into '/Users/netherwaves/Documents/Repositories/DaisySeed_Platformio_Example/lib/DaisySP'...
Cloning into '/Users/netherwaves/Documents/Repositories/DaisySeed_Platformio_Example/lib/libDaisy'...
Submodule path 'lib/DaisySP': checked out '220622f362cfa2595c3580cf64b8cc9bc11aa903'
Submodule path 'lib/libDaisy': checked out 'a3ebe670718c79ced07595079075fc90f5f87ad8'
netherwaves@netherwaves DaisySeed_Platformio_Example %

and this is what my lib folder looks like afterwards (neither of them are empty)
Screen Shot 2022-03-24 at 5.19.02 PM

It is worth noting; now when typing in the two commands, it gives nothing back. No error, no confirmation. Is it supposed to do that?

that’s probably normal if you’ve only deleted the lib folder! the submodule system works a little weirdly in that we’re only keeping track of the commit at which we want to checkout, and not the folder itself … the details are still a little unclear to me but the above is what i received from deleting the entire repository, recloning it and re-running the two commands … maybe you’ll have better luck then!

After all of this it was a git problem. Sorry for the inconvenience!! Somehow github had lost my ssh key. After generating a new key and adding it to github again, everything seems to be working.

So to anyone with similar issues, check your ssh key!

1 Like