Skip to content

Commit

Permalink
Add delay between starting DMA TX and SPI driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Fischer committed Aug 2, 2024
1 parent 69f8efd commit 35da5cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions esp-hal/src/spi/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,13 @@ pub trait InstanceDma: Instance {
tx.start_transfer()?;
reset_dma_before_usr_cmd(reg_block);

// Wait for at least one clock cycle for the DMA to fill the SPI async FIFO, before
// starting the SPI
#[cfg(riscv)]
riscv::asm::delay(1);
#[cfg(xtensa)]
xtensa_lx::timer::delay(1);

reg_block.cmd().modify(|_, w| w.usr().set_bit());

Ok(())
Expand Down

0 comments on commit 35da5cc

Please sign in to comment.