Need help building DaisyDuino 1.2 in PlatformIO

Hi Everyone,

I have been trying to update my project to DaisyDuino 1.2 and not been having any luck. Everything builds successfully and runs correctly with 1.1, but updating to the 1.2 library produces the error below.

Any suggestions or help would be greatly appreciated!!

ERROR:

Linking .pio\build\electrosmith_daisy\firmware.elf
c:/users/fahnfam/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: .pio\build\electrosmith_daisy\libad0\libDaisyDuino.a(dev_sdram.c.o): in function `dsy_sdram_init':
dev_sdram.c:(.text.dsy_sdram_init+0x62): undefined reference to `HAL_SDRAM_Init'
c:/users/fahnfam/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: dev_sdram.c:(.text.dsy_sdram_init+0x84): undefined reference to `HAL_SDRAM_SendCommand'
c:/users/fahnfam/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: dev_sdram.c:(.text.dsy_sdram_init+0xa0): undefined reference to `HAL_SDRAM_SendCommand'
c:/users/fahnfam/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: dev_sdram.c:(.text.dsy_sdram_init+0xb6): undefined reference to `HAL_SDRAM_SendCommand'
c:/users/fahnfam/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: dev_sdram.c:(.text.dsy_sdram_init+0xd4): undefined reference to `HAL_SDRAM_SendCommand'
c:/users/fahnfam/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: dev_sdram.c:(.text.dsy_sdram_init+0xe0): undefined reference to `HAL_SDRAM_ProgramRefreshRate'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\electrosmith_daisy\firmware.elf] Error 1

My PlatformIO ini:

[env:electrosmith_daisy]
platform = ststm32
board = electrosmith_daisy
framework = arduino
lib_deps = electro-smith/DaisyDuino@^1.2.0
upload_protocol = jlink
debug_tool = jlink
build_flags = 
	-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
	-D USBCON
	-D USBD_VID=0x0483
	-D USBD_PID=0x5740
	-D USB_MANUFACTURER="Unknown"
	-D USB_PRODUCT="\"ELECTROSMITH_DAISY CDC in FS Mode\""
	-D HAL_PCD_MODULE_ENABLED

I still haven’t had a chance to look into this issue, but it does seem unique to platform io

The weird thing is I saw this issue when I was working on adding the SDRAM support in v1.2, but I was able to fix it by adding the defines inside of the hal_conf_extra.h file in src/

It could be that this isn’t being processed when building with platform io.

you could try adding the following to your build_flags:

-DHAL_SDRAM_MODULE 
-DHAL_DMA_MODDULE_ENABLED 
-DHAL_MDMA_MODULE_ENABLED 
-DINSTRUCTION_CACHE_ENABLED 

That said, I’m still not very familiar with platform io so this would be dependent on its build configuration, and how its emulating the Arduino build process.

Thanks for looking at this! The build flags didn’t resolve the issue, unfortunately, but I will continue to investigate as I can, and I can continue to use v1.1.