Problems loading in SRAM or QSPI

I’m trying to load a current project into SRAM or QSPI on my Patch, since it’s gotten too large for flash (thanks, fatfs). But I’m having some difficulties with it. Here’s what’s happened

  • A while ago, I tried loading another project, a drum kit, into SRAM/QSPI. When I ran “make program-boot” it would load, briefly go through the flashing-LED phase, and then load my project and run. I didn’t have to do anything to get it to load the app.
  • When I try the same on a current project, a synth, on a brand-new Daisy Patch, and “make program-boot” it gets stuck in the blinking-LED waiting-to-load app phase.
  • I try loading the drum kit into SRAM and, as before, it loads automatically when I use “make program-boot”
  • When I try it again with the synth, it loads the drum kit
  • If I load the synth into regular flash, it works fine. But when I try again with SRAM, I get the drum kit
  • Same with QSPI

I don’t see any errors when I “make program-boot” with the synth, but every time I end up getting the drum kit. I assume I am somehow failing to overwrite the drum kit app when I try to load the synth, but I don’t see how. Is there some action I need to do to clear out the SRAM or QSPI first? What is going on?

I don’t see any differences between the Makefiles of the two projects. Both are using “APP_TYPE=BOOT_QSPI” or BOOT_SRAM, and “OPT=-0s”

To be clear, now whenever I “make program-boot” with the synth project, I get the drum kit. It no longer waits with the flashing LED.

Well okay, I found the answer here. You have to first flash the bootloader, then load your bin using the bootloader. So the steps are something like this:

  1. Set APP_TYPE=BOOT_SRAM or APP_TYPE=BOOT_QSPI in the Makefile
  2. make clean; make
  3. make program-boot to flash the bootloader
  4. Press reset to start the bootloader, then during the startup period (LED will flash), press boot to load your new bin.
  5. make program-dfu to flash your new bin
  6. Patch will now restart and run your bin

The bootloader will seemingly sometimes restart into the bootload mode and sometimes run the bin, but pressing reset and then boot should work every time. You can also load your bin using the sd card (see the link).

There are a lot of forum posts and docs about the bootloader (including some reference links that no longer work), so it was hard to find definitive info. It’s surprising that no one from Electrosmith could answer my question, since it was working as expected and I was just missing a step that appears in their (hard to find) documentation. Hopefully the next time someone is confused, they will find this page, or someone from Electrosmith will remember how it works!