Skip to content

Integration Challenges with LittleFS on STM32H5 QSPI External Flash #1149

@Vaishak-hoomanely

Description

@Vaishak-hoomanely

Hi LittleFS community,
We're integrating LittleFS into our STM32H5-based system using the QSPI (OctoSPI) peripheral to manage an external Winbond W25Q256JW flash chip.
Setup Summary:

  • STM32H5 MCU with external 256Mbit Winbond W25Q256JW flash via Quad SPI in half/OctoSPI mode
  • PSRAM used as intermediate buffer for thermal and camera data, offloaded to flash via LittleFS
  • LittleFS version [specify if known]; customized with platform-specific flash drivers
  • FreeRTOS-based firmware with full internal SRAM allocation for task stacks and mutexes (to avoid deadlocks)

Observed Symptoms:

  • Large file writes (~300-500KB) succeed initially but sometimes cause assertion failures during file truncation
  • Occasional hangs or timeouts when performing batch writes or recovery operations in LittleFS
  • Data corruption suspected during truncation or after cache flush operations
  • Watchdog suppressions during offload tasks lead to hard faults under mutex contention
  • Challenges with mutex timeout hierarchy causing priority inversion and deadlocks during flash access

Request for Guidance:

  1. Are there known best practices or configuration recommendations specific to STM32 or Winbond W25Q256JW flash to avoid truncation assertion failures?
  2. What are typical LittleFS configuration parameters (block size, cache size, lookahead size, block cycles) that work well with similar external flash setups?
  3. Any advice on mutex management or offload scheduling to prevent priority inversion deadlocks under concurrent flash use?
  4. Recommendations for robust power-loss recovery strategies integrated with LittleFS on external flash?
  5. We welcome any insights, example configurations, or patches to improve stability and performance in this environment.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions