Skip to content

stm32: Fix DAC issue for MCUs those have D-Cache. #17770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ports/stm32/dac.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ mp_obj_t pyb_dac_write_timed(size_t n_args, const mp_obj_t *pos_args, mp_map_t *
#endif
}

// To prevent invalid dac output, clean D-cache before starting dma.
MP_HAL_CLEAN_DCACHE(bufinfo.buf, bufinfo.len);

uint32_t align;
if (self->bits == 8) {
align = DAC_ALIGN_8B_R;
Expand Down
Loading