Note: To view the registers, please refer to the "ARM Cortex-M4 Authoritative Guide". Since I use library development, I will not delve into the registers. The summary information comes from Atom's "STM32F4 Library Development Guide", which is summarized here for easy search.
STM32F4 interrupt grouping: STM32F4 divides interrupts into 5 groups, group 0 to 4. The grouping is defined by bits 10 to 8 of the SCB->AIRCR register. See the figure below:
Through this table, we can clearly see the configuration relationship corresponding to groups 0~4. For example, if the group is set to 3, then for all 82 interrupts, the highest 3 bits of the upper 4 bits of the interrupt priority register of each interrupt are the preemption priority, and the lower 1 bit is the response priority. For each interrupt, you can set the preemption priority to 0~7 and the response priority to 1 or 0.
The preemption priority is higher than the response priority, and the smaller the value, the higher the priority.
A high preemptive priority can interrupt a low preemptive priority, hence the name preemption; when the preemptive priorities are the same, the higher the response priority, the higher the response priority will be if it occurs at the same time, but it cannot interrupt the low response priority. The response expresses the response speed.
Let me explain two points here: first, if the preemption priority and response priority of two interrupts are the same, the interrupt that occurs first will be executed first; second, the preemption priority with a higher priority can interrupt the ongoing interrupt with a lower preemption priority. For interrupts with the same preemption priority, the response priority with a higher priority cannot interrupt the interrupt with a lower response priority.
Let's explain with an example: Assume that the interrupt priority group is set to 2, and then set the preemption priority of interrupt 3 (RTC_WKUP interrupt) to 2 and the response priority to 1. The preemption priority of interrupt 6 (external interrupt 0) is 3 and the response priority is 0. The preemption priority of interrupt 7 (external interrupt 1) is 2 and the response priority is 0. Then the priority order of these three interrupts is: interrupt 7>interrupt 3>interrupt 6.
Previous article:STM32 NVIC Simplified Understanding
Next article:stm32 debugging, enter HardFault_Handler
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- ADI chips have increased by NNN times?
- How to improve the anti-interference ability of wireless modules
- [Zero-knowledge ESP8266 tutorial] WIFI TCP protocol communication TCP server example
- What is RFID technology?
- RISCV DMIPS0.8, 80Mhz soft core open source CPU implementation in FPGA
- [Synopsys IP Resources] 97% of tested applications have security vulnerabilities. Is your software secure?
- Face recognition model building process
- Let’s talk about the advantages of GaN in the RF field
- Can you guys help me analyze this ultrasonic receiving circuit? Is the op amp a bandpass filter? How do I calculate the center frequency?
- Understanding automotive RF front-end design techniques in one article