STM32 has 4 bits to define the preempt priority level and the sub-priority level. Here we will illustrate the priority level group. STM32F75xxx and STM32F74xxx vector table in File:STM32F745-STM32F746-Datasheet.pdf. For more information, please refer to the table 43. Here is a part of the interrupt vector table. In case of the interrupts with the same preemption priority and sub-priority, the interrupt vector table may help you to know which one has the higher priority level. For the interrupts with the same preemption priority, the one with the higher sub-priority has the higher interrupt priority. The one with the higher preemption priority has the higher interrupt priority. Stm32f4 hal disable interrupt gpio how to#How to judge the priority level among the interrupts? First, you should check the preemption priority. Sub-prioritydefines the interrupt prioritylevel.In case that the interrupts with the same preemption priority level are triggered simultaneously, the one with the higher sub-priority will run first. If the preemption priority level of B interrupt is lower than A interrupt, the program will keep running the A interrupt service routine and will not run the B interrupt service routine until the A interrupt service routine finished. If the preemption priority level of B interrupt is higher than A interrupt, the program will break the A interrupt service routine andjump to run the B interrupt service routine. The preemption prioritydefines theability of one interrupt to interrupt another.For example, A interrupt is triggered and the corresponding interrupt service routine are running, and then B interrupt is triggered as well. Otherwise,the program will not respond the interrupt request. In the case that the interrupt is enabled, the running program will jump to the interrupt service routine when the interrupt trigger conditions are met. Using the Enable checkbox, youcan check/uncheck to enable/disable the interrupt. There are three parameters involved, Enable checkbox, Preemption priority and Sub-priority (the highest the value, thelowest the priority). NVIC is used to control the interrupt response. Here we will shortly introduce what is NVIC (Nested Vector Interrupt Controller). And the two options on the right are used to set the preemption priority and sub-priority. In NVIC, check the option EXTI Line0 interrupt to enable PA0 interrupt. In the user label box, add the label WAKEUP. Select No pull-up and no pull-down in the option GPIO Pull-up/Pull-down. In the GPIO configuration, set PA0 as rising edge trigger. Since the WAKEUP key has connected to an external resistor, the PA0 will output high level when pressing WAKEUP key. PA0 should be configure to GPIO_EXTI0 mode. Click the file STM32F746I.ioc to open the project file STM32cubeMX for reconfiguration. Copy the GPIO project, and modify the folder name. The project presented in this chapter is modified based on the GPIO project described in the chapter above. Abstract: This chapter present the external interrupt operation flow of STM32.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |