cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L031F6P6 WKUP3 pin inconsistencies in firmware (and function)

David Koster
Associate II

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
#endif

So 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

1 ACCEPTED SOLUTION

Accepted Solutions
David Koster
Associate II

I blamed the firmware because I wasn't able to enable WKUP3 without working around the HAL functions, but in the end the board house was to blame, PA2 had a cold solder joint. Fixed! (:

View solution in original post

2 REPLIES 2
David Koster
Associate II

I blamed the firmware because I wasn't able to enable WKUP3 without working around the HAL functions, but in the end the board house was to blame, PA2 had a cold solder joint. Fixed! (:

Hello

check If PWR_WAKEUP_PIN3 has value 0x00000400 (bit 10 of PWR_CSR) If not , is a HAL typo