2025-05-26 3:00 AM - edited 2025-05-26 8:20 AM
Hi all,
So to my surprise, I have issues getting a button press to work in a Lora PingPong sequencer example, and I can't find any relevant posts, so ...
The part I'm using WLE5.
The ping-pong code is working fine, but I wanted to add a button to start sending from one end, and PA0 was my choice. I have setup the gpio, and falling edge interrupt, and everything works as far as to setting the Pending bit in EXTI/PR1/PIF bit 0 when I press the button. But no interrupt happens. I suppose I must have missed something. But what?
The code sits in HAL_PWR_EnterSLEEPMode() -> __WFI()
So I think my question is what parts could I have missed?
My main suspicion is related to HAL_NVIC_SetPriority() and HAL_NVIC_EnableIRQ(), which I don't seem to get a hang on. I have tried different arguments (EXTI0_IRQn, EXTI15_10_IRQn) to them, but it makes no difference. How do know which one to use for a particular gpio?
Edit: OK, so now I found that SYSCFG_EXTICR1->EXTI0 selects the interrupt, and I have verified that it is 000, so that means that EXTI0_IRQn should be fine. I have now;
HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI0_IRQn);
After setting up the gpio code.
But still no interrupt. (still sits with the "pending" bit active).
Solved! Go to Solution.
2025-05-26 8:49 AM
OK, so I knew it was something silly. Turns out only EXTI15_10 had a jump vector to the EXTI interrupt function. Oh well.
2025-05-26 8:49 AM
OK, so I knew it was something silly. Turns out only EXTI15_10 had a jump vector to the EXTI interrupt function. Oh well.