BOOT_SRAM and STLINK

I just received an STLINK to use with my prototype module, which has the Seed mounted on the back (or rather it will, once I have assembled it :slight_smile: ). I got the STLINK because the boot and reset buttons will not be readily accessible, so I need something to reflash the Seed without the need to press the buttons.

However, when attempting to flash my program, I get this error:

$ make program
../../libDaisy//core/Makefile:322: *** Cannot program via openocd with an app type of "BOOT_SRAM". Try program-dfu instead.  Stop.

Is there any way to get the STLINK programmer working with bootloader-based apps?

1 Like

As far as I know, I don’t think you can flash the bootloader with ST Link.

I tried doing that a while back on pd2dsy and learned that it wasn’t possible. I also have a project where the buttons aren’t accessible so I need make sure that the program is not too large.

Thanks, Takumi. I think it must be possible, perhaps using ST’s proprietary tools.

I have been able to partially read back the contents of the external flash using the open source st-link utilities, but I’m not yet able to write to the flash. I can also only read the first 128KB, probably there is some notion of “banks” baked into the tool.

If I can figure something out I will post it here.

[EDIT] Ah, I can read back the full QSPI flash (it would seem) by specifying the size of the flash:

$ ./st-flash --flash=256K read out.bin 0x90040000 204320
st-flash 1.7.0
2023-02-20T11:09:20 INFO usb.c: Unable to match requested speed 1800 kHz, using 1000 kHz
2023-02-20T11:09:20 INFO common.c: H74x/H75x: 128 KiB SRAM, 128 KiB flash in at least 128 KiB pages.
Forcing flash size: --flash=0x00040000
2023-02-20T11:09:20 INFO common.c: read from address 0x90040000 size 204320

But I’m still not sure how to write:

$ ./st-flash --reset write /c/development/electrosmith/DaisyExamples/projects/MyCoolProject/build/MyCoolProject.bin 0x90040000
st-flash 1.7.0
2023-02-20T11:12:13 INFO usb.c: Unable to match requested speed 1800 kHz, using 1000 kHz
2023-02-20T11:12:13 INFO common.c: H74x/H75x: 128 KiB SRAM, 128 KiB flash in at least 128 KiB pages.
Unknown memory region