There is some interaction between the OLED display driver and the USB logger on the Patch Submodule that prevents logging when the OLED display is running and visa versa. I have been debugging this for a while on a larger application but have distilled it down to a simple app. If StartLog() is commented out the display works as expected, the display initialization is commented out the logger works as expected. There is also a time element involved because sometimes the display loop will execute several times before failing, other times it fails immediately.
#include "dev/oled_ssd130x.h"
#include "daisy_patch_sm.h"
using namespace daisy;
using namespace patch_sm;
DaisyPatchSM hw;
OledDisplay<SSD130x4WireSpi128x64Driver> display;
int main(void)
{
hw.Init();
hw.StartLog(true);
OledDisplay<SSD130x4WireSpi128x64Driver>::Config cfg;
cfg.driver_config.transport_config.spi_config.periph = SpiHandle::Config::Peripheral::SPI_2;
cfg.driver_config.transport_config.spi_config.pin_config.nss = hw.GetPin(DaisyPatchSM::PinBank::D, 1);
cfg.driver_config.transport_config.spi_config.pin_config.miso = Pin();
cfg.driver_config.transport_config.spi_config.pin_config.mosi = hw.GetPin(DaisyPatchSM::PinBank::D, 9);
cfg.driver_config.transport_config.spi_config.pin_config.sclk = hw.GetPin(DaisyPatchSM::PinBank::D, 10);
cfg.driver_config.transport_config.pin_config.dc = hw.GetPin(DaisyPatchSM::PinBank::D, 8);
cfg.driver_config.transport_config.pin_config.reset = hw.GetPin(DaisyPatchSM::PinBank::D, 6);
display.Init(cfg);
for (int i = 0; i < 10000; ++i) {
System::Delay(100);
hw.PrintLine("Hello world");
display.Fill(false);
display.SetCursor(0, i % 46);
display.WriteString("Hello world", Font_11x18, true);
display.Update();
}
}