Repository navigation
Implement STM32F7 SAI1/SAI2 ports with circular DMA - #4
Merged
Merged
Conversation
Acquire SAI clocks through published dmclk_port 1.2, configure STM32 SAI blocks in shared STM32 code, and recover a stalled synchronous stop with a controller reset. Add a direct board test and document the current polling and core-stub limits.
JohnAmadis
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
port.csupplies only SAI addresses, clock domains and DMA routes; the transfer engine is shared instm32_common.dmdma0.5. This branch encodes STM32 channel 0 as request8, which the existing STM32 port maps toCHSEL=0. dmdma PR #5 fixes the core to accept the canonical request0for peripheral transfers. Once that change is published, this driver can use0directly.dmheapping-pong buffers; DMA half/full callbacks move whole PCM frames through bounded TX/RX queues. Keepdmclk_port1.2 clock ownership and SAI status handling. Existing tests, Makefile and README badges are retained.Validation
dmsai,dmsai_port,dmsai_port_board_testand the existingtest_dmsaitarget for STM32F7.dmod-bootmaster firmware with local DMFs, deletingmodules.dmpand__modules_dmp.obefore repackaging. OpenOCD flashed and verified the image. After 30 seconds, UART responded.dmsai_port_board_testreportedPASS (0 failures)for SAI1 and SAI2, each at 48 kHz and 44.1 kHz. All four DMA streams advanced; a 300-frame write larger than the TX queue and an RX read completed; transfer errors remained zero. Repeated with locally built dmdma/dmdma_port 0.5.1 from the companion PR, also passing. Separately, a temporary local dmsai build using request0passed against the fixed dmdma core.Device layer
dmdevfsowns node mounting. The architecture-independentdmsaiDIF callbacks remain the interface stubs from the earlier PR; the direct SAI port is exercised by the board test. The board test temporarily routes SAI1 pins to AF6 and SAI2 pins to AF10, then restores them. It does not initialize the WM8994 codec or assess analog audio quality.