Skip to content

SD card boot loop / load crash fix: increase watchdog and SD init timeout #397

@Akku-21

Description

@Akku-21

Problem

When using certain SD cards (tested with Samsung 16GB HC Class 10), the Performer either:

  1. Boot loops — the progress bar fills and the board resets repeatedly
  2. Crashes when loading a project — works fine without SD card, but crashes when trying to load a saved project

Root Cause

Two timeouts are too short for high-capacity SD cards that take longer to initialize in SPI compatibility mode:

  1. Watchdog timeout in src/apps/sequencer/Sequencer.cpp is set to 1000ms, which is too short for the SD card init sequence on some cards
  2. ACMD41 timeout in src/platform/stm32/drivers/SdCard.cpp is set to 2000ms, which is insufficient for some SDHC cards

Related issue: #368 describes the same CMD8/ACMD41 timeout problem.

Fix

src/apps/sequencer/Sequencer.cpp line 153:

// Before
System::startWatchdog(1000);

// After
System::startWatchdog(5000);

src/platform/stm32/drivers/SdCard.cpp line 225:

// Before
uint32_t timeout = os::ticks() + os::time::ms(2000);

// After
uint32_t timeout = os::ticks() + os::time::ms(4000);

Result

After applying both changes, the following SD cards work correctly:

  • ✅ Samsung 16GB HC Class 10 (previously failing)
  • ✅ SanDisk 8GB (was already working)

Tested on a DIY build with firmware v0.1.42.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions