-
Notifications
You must be signed in to change notification settings - Fork 238
Description
My Daisy Patch project is about to exceed the 128KB capacity of the internal flash memory, so I will need to use the bootloader to continue development. Unfortunately, Daisy Patch projects do not work correctly with the bootloader. At the very least, the display does not work at all. It's hard to say what else may or may not be working without doing further testing.
I added APP_TYPE=BOOT_QSPI to my project's Makefile. After flashing the bootloader using make program-boot and then uploading my app using make program-dfu, the Patch appeared to be unresponsive. But after doing a little serial debugging, it does appear as though my app is being loaded and is running more or less correctly, as far as I can tell. The encoder works, I'm able to read data from the SD card into SDRAM, etc. But the display does not work.
I also tried APP_TYPE=BOOT_SRAM, but the Patch is completely unresponsive. I imagine it might need a custom linker script, like the bootloader version of the Nimbus app for the Daisy Field.
I crated a new project using helper.py and added some display calls. When running from the internal flash, the program works as expected -- the text BOOTLOADER appears on the OLED, and signals are passed through from the inputs to the outputs.
But when I set APP_TYPE=BOOT_QSPI or APP_TYPE=BOOT_SRAM, the audio callback seems to be working correctly, but the text does not appear on the OLED. So even in this very simple case, the Patch is only semi-functional.
#include "daisy_patch.h"
#include "daisysp.h"
using namespace daisy;
using namespace daisysp;
DaisyPatch hw;
void AudioCallback(AudioHandle::InputBuffer in,
AudioHandle::OutputBuffer out,
size_t size)
{
hw.seed.SetLed(true);
hw.ProcessAllControls();
for (size_t i = 0; i < size; i++)
{
out[0][i] = in[0][i];
out[1][i] = in[1][i];
out[2][i] = in[2][i];
out[3][i] = in[3][i];
}
hw.seed.SetLed(false);
}
int main(void)
{
hw.Init();
hw.display.WriteString("BOOTLOADER", Font_7x10, true);
hw.display.Update();
hw.SetAudioBlockSize(4);
hw.SetAudioSampleRate(SaiHandle::Config::SampleRate::SAI_48KHZ);
hw.StartAdc();
hw.StartAudio(AudioCallback);
while(1) {}
}