Repository navigation
Renode models for SAI audio through the WM8994 - #122
Merged
Merged
Conversation
Adds a DMA2 model with circular mode and half-transfer interrupts (Renode's STM32DMA has neither), an STM32F7 SAI that paces frames from the RCC kernel clock and serializes them bit by bit with their FS level, and a WM8994 on I2C3 that decodes that stream per AIF1_CONTROL1 and writes what DAC1 receives to a file. Used to reproduce crackling playback on STM32F746G-DISCO: the codec was left in right-justified mode (dmwm8994) and the SAI writer starved its queue on a 10 ms tick (dmsai). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nr1HhezRY951yBxxTm1b65
This was referenced Oct 11, 2026
Merged
Merged
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
Adds
configs/renode/STM32F7_Audio.cswith three Renode models. They let audio playback on STM32F746G-DISCO run and be inspected in emulation.STM32F7_AudioDMA: a replacement for DMA2 with circular mode and half-transfer interrupts. Renode'sSTM32DMAcopies memory-to-peripheral data in one go and has neither CIRC nor HTIF, both of which dmsai depends on. Peripheral-to-memory requests behave as in Renode's model, so the SD host keeps working.STM32F7_SAI: paces frames from the RCC kernel clock (PLLSAI/PLLI2S, MCKDIV). It serializes each frame bit by bit, using FRCR/SLOTR/CR1 for the FS level, data size and slots, and requests DMA to keep its FIFO fed. A synchronous RX block B is also modeled.WM8994: an I2C register file on I2C3 at 0x1A. It decodes the bit stream according to AIF1_CONTROL1 (format, word length, LRCLK inversion) and writes what DAC1 receives to a raw stereo s16le file.The file header describes how to load the models. They are not wired into
renode.rescyet: the board'sflash.dmdloads the FT5336 touch config, which owns I2C3 just like dmwm8994'scodec.ini.Why
These models reproduced crackling playback and found two causes:
0/-32768.With both fixes, the captured output matches the played melody note for note.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Nr1HhezRY951yBxxTm1b65
Generated by Claude Code