stm32/dac: Fix DAC write for MCUs that have D-Cache.
To prevent wrong DAC output, clean D-cache before starting DMA. For more details, please refer to the following document: https://www.st.com/resource/en/application_note/DM00272913.pdf Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
This commit is contained in:
parent
152a0782e6
commit
365329cd54
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue