summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/stm32/dac.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ports/stm32/dac.c b/ports/stm32/dac.c
index 040892553..8022fd274 100644
--- a/ports/stm32/dac.c
+++ b/ports/stm32/dac.c
@@ -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;