Skip to main content
AD�?b
Senior
June 17, 2019
Question

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

  • June 17, 2019
  • 3 replies
  • 760 views

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.

3 replies

S.Ma
Principal
June 17, 2019

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
June 18, 2019

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
June 18, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
AD�?b
AD�?bAuthor
Senior
June 18, 2019

This is a trial program. Did not work