STM32 call the system function's attention point when using FreeRTOS in interrupts

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.