diff options
author | Yuuki NAGAO <wf.yn386@gmail.com> | 2025-06-29 13:34:09 +0900 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-07-08 13:52:22 +1000 |
commit | f3c56c81eaeb197e7765514b8e3c3aed731f8c5f (patch) | |
tree | 6c3927973d4a9ed10eead4e26cc0aacb655d5bc8 | |
parent | 168e2c8f66d9cfb8c5212fc236aa645ad8275876 (diff) |
stm32/irq: Change SPI IRQ priority to be higher than DMA IRQ.
On STM32H5/STM32H7, SPI flash cannot use as storage device with DMA. SPI
interruption may not be genearated even if DMA transfer has been done.
This is due to lower priority of SPI interruption than DMA.
This commit changes SPI interrupt priority more higher than DMA's priority.
Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
-rw-r--r-- | ports/stm32/irq.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ports/stm32/irq.h b/ports/stm32/irq.h index 58e6d0a80..dfe901ff7 100644 --- a/ports/stm32/irq.h +++ b/ports/stm32/irq.h @@ -155,6 +155,9 @@ static inline void restore_irq_pri(uint32_t state) { // SDIO must be higher priority than DMA for SDIO DMA transfers to work. #define IRQ_PRI_SDIO NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 4, 0) +// SPI must be higher priority than DMA for SPI DMA transfers to work. +#define IRQ_PRI_SPI NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 4, 0) + // DMA should be higher priority than USB, since USB Mass Storage calls // into the sdcard driver which waits for the DMA to complete. #define IRQ_PRI_DMA NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 5, 0) @@ -172,8 +175,6 @@ static inline void restore_irq_pri(uint32_t state) { #define IRQ_PRI_SUBGHZ_RADIO NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 8, 0) -#define IRQ_PRI_SPI NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 8, 0) - #define IRQ_PRI_HSEM NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 10, 0) // Interrupt priority for non-special timers. |