Skip to content

Commit f3c56c8

Browse files
yn386dpgeorge
authored andcommitted
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>
1 parent 168e2c8 commit f3c56c8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ports/stm32/irq.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ static inline void restore_irq_pri(uint32_t state) {
155155
// SDIO must be higher priority than DMA for SDIO DMA transfers to work.
156156
#define IRQ_PRI_SDIO NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 4, 0)
157157

158+
// SPI must be higher priority than DMA for SPI DMA transfers to work.
159+
#define IRQ_PRI_SPI NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 4, 0)
160+
158161
// DMA should be higher priority than USB, since USB Mass Storage calls
159162
// into the sdcard driver which waits for the DMA to complete.
160163
#define IRQ_PRI_DMA NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 5, 0)
@@ -172,8 +175,6 @@ static inline void restore_irq_pri(uint32_t state) {
172175

173176
#define IRQ_PRI_SUBGHZ_RADIO NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 8, 0)
174177

175-
#define IRQ_PRI_SPI NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 8, 0)
176-
177178
#define IRQ_PRI_HSEM NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 10, 0)
178179

179180
// Interrupt priority for non-special timers.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy