Skip to content

Conversation

@wdx04
Copy link

@wdx04 wdx04 commented Apr 27, 2025

Summary of changes

Added STM32H7 MDMA support to stm32_dma_utils.
Faster QSPI read/write speed using DMA.
The acceleration ratio is between 5x and 10x, depending on the microcontroller chip.
No modification is needed on user code.
This is suitable for filesystem access on QSPI Flash chips, or for driving some LCDs with QSPI interface.
Tested on at least one board of the following STM32 Families: F4, F7, L4, L4+, L5, G4, WB, U5, H7 with QSPI, H7 with OSPI.

Impact of changes

No.

Migration actions required

No.

Documentation

The QSPI Flash uses one DMA channel on the microcontroller.
There's no confict with existing SPI DMA links.

Some sequential read performance data:
(NUCLEO boards are tested with an external W25Q128FV module)

Board Flash Chip QSPI Frequency Read Speed
DISCO-F746NG N25Q128A 108MHz 29.09MB/s
DISCO-F469NI N25Q128A 90MHz 24.32MB/s
DISCO-L476VG N25Q128A 40MHz 9.43MB/s
Custom H723ZG W25Q64JV 91.6MHz 42.78MB/s
Custom U575RI W25Q64JV 80MHz 37.74MB/s
NUCLEO-G474RE W25Q128FV 85MHz 13.72MB/s
WB5MMG-DK S25FL128 32MHz 3.78MB/s
L4S5I-IOT01A MX25R64 60MHz 12.03MB/s
NUCLEO-L552ZE W25Q128FV 55MHz 11.13MB/s
NUCLEO-H432ZI2 W25Q128FV 120MHz 43.72MB/s
NUCLEO-F413ZH W25Q128FV 100MHz 13.51MB/s

Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

All boards are tested by filling the flash with "55 AA" pattern and then read out.
Discovery boards and custom boards are additionally tested by creating a FAT filesystem on the QSPI Flash and writing a 3.1MB binary file, then read it out and check the CRC.


Copy link
Collaborator

@multiplemonomials multiplemonomials left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this! Really appreciate this getting added! Just a few comments here and there.

Copy link
Collaborator

@multiplemonomials multiplemonomials left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few last things

wdx04 added 2 commits May 23, 2025 14:59
… FATFileSystem

added a split_buffer_by_cacheline function to split a buffer into cache-aligned parts and cache-unaligned parts
added a QSPI_DMA_THRESHOLD_BYTES macro to define the minimum number of bytes to be transferred using DMA
Copy link
Collaborator

@multiplemonomials multiplemonomials left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this!

@multiplemonomials multiplemonomials merged commit 371f11a into mbed-ce:master May 23, 2025
52 checks passed
@wdx04 wdx04 deleted the stm32-qspi-dma branch July 12, 2025 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants