Skip to main content
AD�?b
Senior
Jun 17, 2019 6:38 PM UTC
Question

I have STM32F0DISCOVERY (STM32F051R8Tx). I work on CubeMX and Eclipse. I have a problem with setting EXTI interrupts. Please help.

I have STM32F0DISCOVERY (STM32F051R8Tx). I work on CubeMX and Eclipse. I have a problem with setting EXTI interrupts. Please help.

This topic has been closed for replies.

4 replies

S.Ma
Principal
Jun 17, 2019 6:57 PM UTC

What do you want to do?

Which pin(s) and trigger interrupt on which edge(s)?

Have you set and selected the pin to be "EXTI" on cubemx?

AD�?b
AD�?bAuthor
Senior
Jun 18, 2019 9:04 AM UTC

PB15 is set: [BAZA] GPIOEXTI15 (no mode). NVIC Enabled EXTI line 4 to 15 interrupts. GPIO mode External Interrupt Mode with Rising edge trigger detection. GPIO Poll-up/Pull-down: No pull-up and no pull-down. User label: BAZA.

I'm generating a program.

I write:

/* USER CODE BEGIN 4 */

void HAL_GPIO_EXIT_Callback(uint16_t GPIO_Pin) {

   if (GPIO_Pin == BAZA_Pin) {

      HAL_GPIO_WritePin(LED_BAZA_GPIO_Port, LED_BAZA_Pin, GPIO_PIN_RESET);

      HAL_Delay(10000);

   }

}

after pressing the BASE the LED is not lit.

The LED is well connected because it works when I turn it on and off not interrupt.

Tesla DeLorean
Guru
Jun 18, 2019 9:10 AM UTC

You should probably avoid delays in the callback.

So if you break-point the IRQ Handler and callback, you catch either in the debugger?

Check pin state.

Review initialization code and handlers.

Review peripheral states/settings/clocks in debugger. ie RCC, SYSCFG, GPIO, etc

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
AD�?b
AD�?bAuthor
Senior
Jun 18, 2019 11:28 AM UTC

This is a trial program. Did not work