Skip to main content
June 29, 2025
Solved

Set an interrupt preemption priority for a pin using NVIC

  • June 29, 2025
  • 4 replies
  • 509 views

It's possible to set an interrupt priority for a pin in STM32F411 MCU, right?

My PC13 pin (user button) is set to GPIO_EXTI13 and I want to give it the preemption priority 3 in the NVIC (STM32Cube IDE ver: 1.18.1) but it's seemingly not possible!

Its value is zero and immutable!

Here's a screenshot:

Capture.PNG

    This topic has been closed for replies.
    Best answer by TDK

    You have 0 bits for preemption selected, so 0 is the only preemption priority available.

    TDK_0-1751215909573.png

     

    Change the priority group to have preemption bits and you can select something other than 0.

    TDK_1-1751215955792.png

     

    4 replies

    Super User
    June 29, 2025

    Click the dropdown to change it. Include your IOC file if you're having trouble.

    TDK_0-1751205585764.png

     

    June 29, 2025

    The drop-down contains only that value 0. It doesn't provide any other values (already tested).
    My LED.ioc file is attached. 

    TDKAnswer
    Super User
    June 29, 2025

    You have 0 bits for preemption selected, so 0 is the only preemption priority available.

    TDK_0-1751215909573.png

     

    Change the priority group to have preemption bits and you can select something other than 0.

    TDK_1-1751215955792.png

     

    July 4, 2025

    How about the GPIO Pull-up/Pull-down mode of that GPIO_EXTI13 pin?

    Should it be up or down and why please? 

    Super User
    July 5, 2025

    The original question is answered. Please make a new thread with the relevant info in it.