diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index e255d192237..038089f9b00 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improve error detection in the I2C driver (#1847) - Fix I2S async-tx (#1833) - Fix PARL_IO async-rx (#1851) +- SPI: Clear DMA interrupts before (not after) DMA starts (#1859) ### Removed diff --git a/esp-hal/src/otg_fs.rs b/esp-hal/src/otg_fs.rs index 63c8c673de2..75c4c0c0b23 100644 --- a/esp-hal/src/otg_fs.rs +++ b/esp-hal/src/otg_fs.rs @@ -176,6 +176,7 @@ pub mod asynch { /// /// * `ep_out_buffer` - An internal buffer used to temporarily store /// received packets. + /// /// Must be large enough to fit all OUT endpoint max packet sizes. /// Endpoint allocation will fail if it is too small. pub fn new(_peri: Usb<'d>, ep_out_buffer: &'d mut [u8], config: Config) -> Self { diff --git a/esp-hal/src/soc/esp32/gpio.rs b/esp-hal/src/soc/esp32/gpio.rs index f602286646f..cf7b971b5b8 100644 --- a/esp-hal/src/soc/esp32/gpio.rs +++ b/esp-hal/src/soc/esp32/gpio.rs @@ -41,6 +41,7 @@ //! two different banks: //! * `InterruptStatusRegisterAccessBank0` //! * `InterruptStatusRegisterAccessBank1`. +//! //! This trait provides functions to read the interrupt status and NMI status //! registers for both the `PRO CPU` and `APP CPU`. The implementation uses the //! `gpio` peripheral to access the appropriate registers. diff --git a/esp-hal/src/soc/esp32s2/gpio.rs b/esp-hal/src/soc/esp32s2/gpio.rs index 776fb51a715..78cd541c23e 100644 --- a/esp-hal/src/soc/esp32s2/gpio.rs +++ b/esp-hal/src/soc/esp32s2/gpio.rs @@ -48,6 +48,7 @@ //! two different banks: //! * `InterruptStatusRegisterAccessBank0` //! * `InterruptStatusRegisterAccessBank1`. +//! //! This trait provides functions to read the interrupt status and NMI status //! registers for both the `PRO CPU` and `APP CPU`. The implementation uses the //! `gpio` peripheral to access the appropriate registers. diff --git a/esp-hal/src/soc/esp32s3/gpio.rs b/esp-hal/src/soc/esp32s3/gpio.rs index b61b95a226b..96f0c6a3658 100644 --- a/esp-hal/src/soc/esp32s3/gpio.rs +++ b/esp-hal/src/soc/esp32s3/gpio.rs @@ -36,6 +36,7 @@ //! two different banks: //! * `InterruptStatusRegisterAccessBank0` //! * `InterruptStatusRegisterAccessBank1`. +//! //! This trait provides functions to read the interrupt status and NMI status //! registers for both the `PRO CPU` and `APP CPU`. The implementation uses the //! `gpio` peripheral to access the appropriate registers. diff --git a/esp-hal/src/spi/master.rs b/esp-hal/src/spi/master.rs index 3b83851d77e..e6f407a6458 100644 --- a/esp-hal/src/spi/master.rs +++ b/esp-hal/src/spi/master.rs @@ -2036,6 +2036,7 @@ where self.update(); reset_dma_before_load_dma_dscr(reg_block); + self.clear_dma_interrupts(); tx_chain.fill_for_tx(false, write_buffer_ptr, write_buffer_len)?; tx.prepare_transfer_without_start(self.dma_peripheral(), tx_chain) .and_then(|_| tx.start_transfer())?; @@ -2043,7 +2044,6 @@ where rx.prepare_transfer_without_start(self.dma_peripheral(), rx_chain) .and_then(|_| rx.start_transfer())?; - self.clear_dma_interrupts(); reset_dma_before_usr_cmd(reg_block); reg_block.cmd().modify(|_, w| w.usr().set_bit()); @@ -2086,13 +2086,13 @@ where self.update(); reset_dma_before_load_dma_dscr(reg_block); + self.clear_dma_interrupts(); chain.fill_for_tx(false, ptr, len)?; unsafe { tx.prepare_transfer_without_start(self.dma_peripheral(), chain) .and_then(|_| tx.start_transfer())?; } - self.clear_dma_interrupts(); reset_dma_before_usr_cmd(reg_block); reg_block.cmd().modify(|_, w| w.usr().set_bit()); @@ -2117,11 +2117,11 @@ where self.update(); reset_dma_before_load_dma_dscr(reg_block); + self.clear_dma_interrupts(); chain.fill_for_rx(false, ptr, len)?; rx.prepare_transfer_without_start(self.dma_peripheral(), chain) .and_then(|_| rx.start_transfer())?; - self.clear_dma_interrupts(); reset_dma_before_usr_cmd(reg_block); reg_block.cmd().modify(|_, w| w.usr().set_bit());