cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_GPIO_EXTI_Callback doesn't get called, except on the program start.

HTD
Senior III

The seemingly simplest thing, but weirdly it doesn't work.

So - maybe it's not that simple?

First, my setup is TouchGFX project on STM32H747-DISCO. I think this might be important.

I configured 2 GPIO pins for EXTI falling edge interrupt. PK6 and and PC13. Just to be sure that one of them actually works.

Then I implemented HAL_GPIO_EXTI_Callback(uint16_t pin) function in my code, I run the project with the debugger, it starts, works, doing stuff, but when I press any of the hardware buttons nothing happens, the breakpoint on my callback isn't hit.

Weirdly, the callback is called on the program start once.

What am I doing wrong here, why it doesn't work?

OK, for what I've learned - with STM32CubeIDE all you need to do is just configure a pin as external IRQ. Then the handler in the code just should be called when the pin state changes, right?

But it's H7, it runs RTOS and TouchGFX, so maybe there are some extra steps required?

EDIT:

Here's what the documentation says about my hardware:

0693W00000NrkHkQAJ.pngHere's what's set in Cube:

0693W00000NrkAzQAJ.png0693W00000NrkKKQAZ.png0693W00000NrkLwQAJ.pngWAIT, WHAT?!

I've just checked the EXTI line[15:10] - it was not checked!

Now I'll just sit watching the paint dry as the project builds...

1 REPLY 1
HTD
Senior III

Yep. NVIC setting. Both lines work. Many tutorials don't include that step.