hello everyone! i’ve been hard at work trying to get the STM32Cube framework to compile in PlatformIO with libDaisy and DaisySP, which has been requiring me to rewrite the Makefiles into PIO config files, and i’ve run into a little hurdle.
recently i’ve successfully uploaded a working 1kHz sine tone program to the internal flash memory (yay!) after a lot of trouble trying to figure out how to use the libDaisy HAL drivers instead of those PIO installs for you (since they aren’t the same, and compiling with the latter will run you into weird errors), and decided to add some more functionalities in order to be able to upload to the SRAM or QSPI memory through the bootloader. to do so, i’ve written a little Python script that sets the linker script and adds the -DBOOT_APP flag according to a custom option set in the main .ini file. however, i’m noticing that, first of all, the program size seems to be considerably heavier than when using the usual Makefile process (110kb through PIO, 70kb through Makefile); weirdly enough, this isn’t the case when uploading to flash. also, the program doesn’t run, as the bootloader sends an SOS signal to the onboard LED.
would anyone be able to take a look at my code and see where i’m going wrong? i feel like something’s missing in my build chain, but at this point i’m not really sure what that could be and some help would be appreciated.
here’s the repository i’m working from: GitHub - netherwaves/daisyseed_template
it adds libDaisy and DaisySP as submodules; i’ve linked both to forks where i was able to add JSON files for proper compilation in PlatformIO.
here is the Python code where i decide which linker script to use:
BOOT_TYPE = env.GetProjectOption("boot_type") LD_PATH = os.path.join(env.get('PROJECT_DIR'), 'lib/libDaisy/core/STM32H750IB_%s.lds' % BOOT_TYPE) board_config.update("build.ldscript", LD_PATH) if BOOT_TYPE == 'flash': board_config.update("upload.offset_address", '0x08000000') elif BOOT_TYPE == 'sram': board_config.update("upload.offset_address", '0x90040000') env.Append(CFLAGS=['-DBOOT_APP']) elif BOOT_TYPE == 'qspi': board_config.update("upload.offset_address", '0x90040000') env.Append(CFLAGS=['-DBOOT_APP'])