0
\$\begingroup\$

I have a problem with a project based on an STM32L051. I want to use the stop mode and wake up on an external (GPIO based) IRQ. This all works great but after the MCU woke up once, no IRQs seem to work. I have a very simple IRQ handler which just outputs some debug info for now. Naturally I do hal-initialize again after I woke up. Also the whole thing works when I use stand-by mode instead of stop mode. I tried to enable the related IRQ via HAL_NVIC_EnableIRQ(EXTI0_1_IRQn); explicitly but it did not help. Any idea what could be missing?

\$\endgroup\$
  • \$\begingroup\$ Is the GPIO clock still running in stop mode? \$\endgroup\$ – Jeroen3 Jan 20 '18 at 12:43
  • \$\begingroup\$ I don't know but as the the wake-up works, I guess yes. \$\endgroup\$ – vanthome Jan 22 '18 at 14:50
1
\$\begingroup\$

For me, a simple HAL_NVIC_SystemReset(); did the trick.

Update:

I also found out that this is sufficient and does not require a reset:

  HAL_NVIC_SetPriority(IRQn, 1, 1);
  HAL_NVIC_EnableIRQ(IRQn);
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.