johnthagen
johnthagen

Reputation: 9169

How to enable GPIO interrupt on STM32F4DISCOVERY user button from STM32CubeMX

I would like to enable a GPIO interrupt whenever a user presses the user button on the STM32F4DISCOVERY board.

Steps I am following:

  1. Download and install STM32CubeMX 4.27.0
  2. New Project
  3. Board Selector
  4. STM32F4DISCOVERY
  5. Initialize all peripherals to their default Mode: Yes

Note that PA0 -> B1 [Blue Push Button].

enter image description here

My understanding is that PA0 should be mapped to EXTI0 interrupt.

  1. Configuration | GPIO confirms that PA0 is set to External Event Mode with Rising edge trigger detection

enter image description here

  1. Configuration | NVIC

But I don't see a way to enable EXTI0 interrupt:

enter image description here

Upvotes: 0

Views: 1973

Answers (1)

Bence Kaulics
Bence Kaulics

Reputation: 7271

Click on PA0 and select Reset_State, then select GPIO_EXTI0. After that, under GPIO configuration select "External Interrupt Mode ...".

Now EXTI line0 interrupt should be visible under NVIC configuration.

enter image description here

Upvotes: 1

Related Questions