I have created a custom cube project already, all is good, but thanks for your example. But can you help me with the algorithm to enter the Standby mode? I need to use WakeUp pin and RTC alarm. It was configured. But maybe something I didn’t turn off
Thanks for your example too.
ok, 20-50 uA will be perfect for me. But I think I didn’t turn off all module correctly. In your example, I didn’t find anything without RUI3. I use only low-level (C project with Keil)
Do you have the SWDIO connected? I see that use ~300 uA. Just this evening I ‘ported’ my RAK3172 sample repo to the RAK3172-SiP, which made it easy to measure sleep current of only the STM32WL + TCXO in isolation (excluding LDO current use, Vbatt divider current. etc).
With this I’m seeing under 2uA sleep current. I did have to tinker with the ADC configuration, I found it was consuming ~3mA unexpectedly, I have not root-caused that yet. It’s possible you have a peripheral that’s in a power-hungry state like this.
You might have a look at the ST errata list for the STM32WL, I will myself in the morning.
@beegee after the weekend, I should be publishing a branch of my repo with these changes. Overall, very little change needed, just the changed GPIOs for RF switch and configure RCC to use the TCXO.
@Yevhen when testing for sleep power, I find it necessary to remove the SWD interface, and use the serial boot0 mode to program firmware images. Using the same serial port PA2/PA3 and STM32CubeProgrammer, I use that to program the ELF binary directly from the STM32CubeIDE workspace.
Pull the BOOT0 high to Vdd, reset the MCU (pull NRST low) to enter boot mode. I can run the programmer at 921kbps.
Side-note - I replace the USART with LPUART in my configuration.
In my another project with Low power STM32, we are writing firmware by the ST link utility. And after reset we have around 5 uA in Standby mode
About base firmware - share this project is greate. I created my own base project by the instruction from digikey community. I think many people are looking the project like this
Oh, I believe it. I know that I’m reliably seeing about 330uA supply current when the ST/Link V2 SWD is connected in my case, even with SWD disabled in the configuration. Removing the ST/Link drops the STOP2 current to under 2uA. Haven’t looked to see if there’s perhaps a pull-up (10k at 3v3 is ~330uA) possibly involved, doesn’t really matter at this point.
It still contains a bit of code left-over from earlier experimentation, particularly, code that reads Vbatt on an RAK5005-type base, though the Vbatt divider is not present on the RAK3272-SiP. This may be a good example of how to use the ADC with STOP2 mode, or at least an example of the issues doing so (in STOP2, the ADC state is lost). Someday I want to clean this up into a simpler example, but if someone does so before I do, and submits a pull request, my ego won’t be bruised.
The changes for RAK3172-SiP are simple; update the RF switch control GPIOs and select the TCXO for HSE in the RCC config.
I realized the RAK3172-SiP doesn’t have the band-select resistor on PB12 - my code configured that as an input, I noticed the sleep current was drifting up, suspected a floating input, there it was. Fixed that and pushed the change to my repo.
Now, sleep current is low, seems to be sub-1uA. In fact, the combination of MCP1702 LDO and RAK3272-SiP is now ~2.1uA, and the LDO probably accounts for 2uA (!)