2025-07-07 11:05 AM - last edited on 2025-07-08 3:52 AM by Andrew Neil
I am using the STM32L433RCT6 and need to assign a GPIO pin as an external interrupt, which will be used to wake and shutdown the MCU (shutdown must use minimal power).
However, I am not sure if I have to use a specific GPIO pin, or if I can use any GPIO pin for the external interrupt ?
The external interrput will be connected to a momentary push button (net PWR_SWITCH)...
There will be a procedure to wake and shutdown the MCU as explained below (there is also a link to a video to demonstrate the procedure)...
Start the switch-on cycle by clicking the button once. After approx. one second, an LED will flash. You must
acknowledge the LED light immediately by clicking the button again. This sequence - a click as soon as the LED appears - will be repeated two more times. After a total of four clicks, the MCU will wake up.
If you do not act promptly after seeing the LED light, or if you push the button too soon, it will ignore the switch-on attempt. This four-click switch-on cycle has been designed to prevent the MCU from being switched on accidentally.
The proceudre to shutdown the MCU will consist of holding the button for a fixed time e.g. 10 seconds
An example is shown in this video...
https://www.youtube.com/watch?v=TpTqGVCbXGE
Solved! Go to Solution.
2025-07-08 8:09 AM
@freeflyer wrote:Using a WKUP pin becuase it allows for lower sleep currents is the sort of advice I am lookng for
You can see that from the tables: the "deeper" sleep modes have only WKUP (not GPIO) as possible wakeup sources.
If that's now answered your question, please mark the solution.
@freeflyer wrote:I believe the 32.768kHz low speed external crystal reduces power consumption ?
That's a whole new question - please start a new thread for a new question.
TL;DR: it depends ...
2025-07-08 8:30 AM
After approx. one second, an LED will flash require timing and advanced current of running MCU 1s = waste battery.
Next waste is lighting LEDs 4x usw.
2025-07-08 8:44 AM
So on the LQFP64...
(WKUP3 is not available on LQFP64)
In STM32CubeIDE, do I set one of the above pins to GPIO_EXTIx or SYS_WKUPx ?
2025-07-08 8:57 AM
@freeflyer wrote:In STM32CubeIDE, do I set one of the above pins to GPIO_EXTIx or SYS_WKUPx ?
You want to use it as WKUP - not EXTI - so set it to SYS_WKUPx
2025-07-08 9:10 AM
EXTI for STOP and up modes. WKUP for STANDBY and SHUTDOWN.
EXTI is limited to one pin on one line for example PB0 EXTI result cant PA0, PC0 ...
2025-07-10 2:51 AM
Follow-up question: WKUP pin - which edge (rising/falling) and can it still be monitored when MCU is running ?