Wake from STOP following USB Resume on STM32C0
In order to meet the USB suspend mode maximum current requirement I am using Stop mode once the suspend has taken effect. I have no difficulties getting it to go into Stop and the current consumption falls to well below 2.5mA, as required. My problem is that it won’t wake up following either a host-induced wakeup, or due to a remote wakeup that I have set up on my product’s buttons.
Host-induced wakeup does cause the current consumption to increase, but it doesn’t get going again. Remote wakeup has no effect whatsoever.
If I replace my HAL_PWR_EnterSTOPMode call with a simple __WFI() it wakes up from both without any difficulties, so I know the EXTIs are all set up correctly etc.
So what’s wrong? I actually know the answer (after days of head-scratching) and will post it as an answer to my own question so that this is documented and will hopefully save others similar frustration. Although I’m using a C0 with USBX, I imagine this applies to all MCUs.
