cancel
Showing results for 
Search instead for 
Did you mean: 

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

AD�?b
Senior

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

4 REPLIES 4
S.Ma
Principal

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
Senior

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.

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

This is a trial program. Did not work