The priority of the cortex kernel is that the smaller the number, the higher the priority, i.e. 0 is the highest priority. FreeRTOS on the contrary, in order to meet the needs of some applications for real-time interrupt demand, so that the interrupt priority above a certain value, the operating system can not invoke kernel functions to improve real-time. The common mistake we make is to set the priority of the interrupt above this value, but also to invoke the API provided by the operating system in the interrupt. When the priority is changed to a larger value, the program can run normally. Note: 1: The first step is to set the interrupt nesting to preemption priority. 2: Set the priority of the FreeRTOS system core interrupt (configkernel_interrupt_priority) to the lowest level.
3: Set the maximum system call interrupt priority (Configmax_syscall_interrupt_priority) for the FreeRTOS to the appropriate priority, such as 11. 4: If there is a user interrupt function call to the system function provided by FreeRTOS, be sure to use the system function provided by FreeRTOS with FROMISR, and the priority of this user interrupt must be in Configkernel_interrupt_ Priority and Configmax_syscall_interrupt_priority priorities. 5: There are no special requirements for the priority of other interrupts that are not called to the FreeRTOS provided by the system functions. The parameter of the priority value set in FreeRTOS is configmax_syscall_interupt_prority. The default value is 5, so to use operating system functions in interrupts requires that the priority of the interrupt be set greater than or equal to 5.