Skip to main content
AVins.1
Associate
March 13, 2023
Solved

[Solved] STM32L462RE Interrupt Issues, Cannot get GPIO interrupts to work in my project.

[Solution] Code was moved around and then it compiled correctly. Misinterpretation of the problem.

IOC Configuration:

Pin PB9 - External Interrupt with Rising/Falling Edge trigger detection

Pull-Down

NVIC EXTI line [9:5] Enabled Preemption Priority 1 Sub Priority 0

Code Changes: Inside Main.c

/* USER CODE BEGIN WHILE */

void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)

 {

HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, GPIO_PIN_SET);

 }

To my understanding to accomplish the interrupt with a callback to turn an led on all I need to do is change the state of the pin from high to low or visa versa. Then override the _weak definition of HAL_GPIO_EXTI_Callback.

Any advice would be very helpful here but I have tried almost all of the different settings for registering the interrupts without any luck.

This topic has been closed for replies.
Imen.DBest answer
ST Technical Moderator
March 15, 2023

Hello @AVins.1​ and welcome to the Community :)

Thank you for updating your post and sharing the solution.

"[Solution] Code was moved around and then it compiled correctly. Misinterpretation of the problem."

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks

1 reply

Imen.DBest answer
ST Technical Moderator
March 15, 2023

Hello @AVins.1​ and welcome to the Community :)

Thank you for updating your post and sharing the solution.

"[Solution] Code was moved around and then it compiled correctly. Misinterpretation of the problem."

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks