Two macros are defined in FreeRTOSConfig.h:
- configKERNEL_INTERRUPT_PRIORITY
- configMAX_SYSCALL_INTERRUPT_PRIORITY
- configKERNEL_INTERRUPT_PRIORITY is used to set the interrupt priority of the RTOS kernel. Because the RTOS kernel interrupt is not allowed to preempt the interrupt used by the user, this macro is generally defined as the lowest hardware priority.
- configMAX_SYSCALL_INTERRUPT_PRIORITY is used to set the highest interrupt priority that can safely call FreeRTOS API functions in the interrupt service routine. When the priority is less than or equal to the priority represented by this macro, the program can safely call FreeRTOS API functions in the interrupt service routine; if the priority is greater than the priority represented by this macro, it means that FreeRTOS cannot disable this interrupt, and no API function can be called in this interrupt service routine.
That is, the RTOS interrupt nesting scheme divides the available interrupt priorities into two groups: those that will be overwritten by the RTOS critical section and those that will never be overwritten so these are always enabled. The configMAX_SYSCALL_INTERRUPT_PRIORITY setting is the boundary value between these two groups.
As shown in the figure above, when using FreeRTOS in STM32, the system defaults to:
//This is the raw value as per the Cortex-M3 NVIC. Values can be 255
(lowest) to 0 (1?) (highest).
#define configKERNEL_INTERRUPT_PRIORITY 255 (0xFF is priority 15)
//!!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html.
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 (0xBF is priority 11)
Therefore, interrupts with priority levels of 0 to 10 will not be delayed by the kernel and can be nested but cannot call API functions. Interrupts between 11 and 15 can call API functions ending with FromISR.
Previous article:Implementing the comprehensive design of stm32 in FSK modem
Next article:Detailed explanation of drone gyroscope application based on STM32
- Popular Resources
- Popular amplifiers
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
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Elk, a tiny JS engine for embedded systems
- A brief introduction to communication principles
- The company is recruiting LAYOUT hardware engineers. Not an agency.
- The analog signal is divided into two paths for signal processing!
- WeChat applet to obtain or upload data to onenet
- Unpacking: 65W USB PD charger
- Design of power domain isolation for voltage monitoring analog-to-digital converters
- Commonly used algorithms for drones - Kalman filter (V)
- What are the application areas of the Internet of Things?
- 【Silicon Labs BG22-EK4108A Bluetooth Development Review】I. Unboxing and LED Lighting Test