STM32L031F6P6 WKUP3 pin inconsistencies in firmware (and function)
I'm working on a batch of prototypes using the STM32L031 series, but can't seem to wake up the device using the WKUP3 pin. Waking it up through WKUP1 goes without problems, but I also need WKUP3.
In my stumble I've come across a few possible hints:
In CubeMX the pin (PA2) is clearly noted as SYS_WKUP3. Datasheets, too, reference manual as well.
However, when calling "HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN3);" we run into "assert_param(IS_PWR_WAKEUP_PIN(WakeUpPinx));". Here we see the following:
#elif defined (STM32L010x8) || defined (STM32L031xx) || defined (STM32L041xx)
#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1) || ((PIN) == PWR_WAKEUP_PIN2))This would indicate this chip does not have WKUP3. Looking further however we find:
#if defined (STM32L010x4) || defined (STM32L010x6) || defined (STM32L011xx) || defined (STM32L021xx) || defined (STM32L031xx) || defined (STM32L041xx) || defined (STM32L071xx) || defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx)
#define PWR_WAKEUP_PIN3 PWR_CSR_EWUP3
#endifSo it does have its own mask. Simply running the following (to avoid the assert_param) however still doesn't get me to boot from WKUP3.
PWR->CSR |= PWR_WAKEUP_PIN3;Does anyone have any tips or knowledge to help me further on this quest? All the documentation says it should work, but the firmware doesn't let me, and bypassing the HAL function also doesn't work.
Thanks!
- David
