STM32 ring-buffer enhancement discussion
Author: elagilCreated Nov 28, 2024Updated Sep 28, 2026
This is a follow-up to the discussion in https://github.com/embassy-rs/embassy/pull/3336 by @liarokapisv
Feel free to add further people to the discussion.
Remaining issues/ideas with the current ring-buffer implementation include
fixed by https://github.com/embassy-rs/embassy/pull/5469clear()on overrun causes issues with higher-level drivers that handle data in groups of samples. For example, aSAIdriver may handle data in groups of two samples (left/right). The ring-buffer has no concept of grouping, so onclear()it will cause random read/write index offsets - in the case of theSAIexample, causing left/right switching.- Usefulness of
write_immediate()is not clear, should it be removed? - The ring buffer may pause automatically on overrun. The ring buffer shall then be explicitly restarted by a user when new data is available.
Source: embassy-rs/embassy