RAK3172 lowlevel sleep mode

I am trying to run Standby mode with ultra-low-power consumption of 1.69 μA (from documentation):

  1. set the Radio to sleep mode
  2. set enable WakeUp pin
  3. go to Standby mode

but after this, I have around 980 uA, maybe someone has any code example for ultra-low power mode?

For reference, using my repo as a basis and generating a customized Cube project, I see sleep current with the RAK3172 on the RAK5005 base of ~21.7uA

danak6jq/RAK3172: Port of STM32WLxx example for RAK3172 (github.com)

1.69uA is a theoretical value, with everything switched off and nothing connected to the STM32WLE5.

In reality you should get around the 20uA’s that Dana sees with her STM32CubeIDE application.

With RUI3 and this example code I am getting close to Dana’s results: RUI3-LowPower-Example

1 Like

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)

We do not have SDK examples.

Maybe Dana’s project can help you ==> RAK3172 lowlevel sleep mode - #2 by danak6jq

1 Like

My example is the ST example code, and it sleeps at 22uA. Perhaps you might find the answer in the ST example code, I didn’t do anything special.

1 Like

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.


Thank you Sir for sharing.
We don’t have the time to dig into the STM SDK and your contributions are very welcome.

1 Like

@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.

Happy to help. We do our production firmware on bare metal using STM32CubeIDE - it makes sense to share the ‘base’ 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.

Here’s the branch supporting RAK3172-SiP on the RAK breakoutboard:
danak6jq/RAK3172 at RAK3172-SiP (github.com)

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. :grin:

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 (!)

Hello Dana,
So I ran your code in my project, but I am getting
Can you guide regarding the issue?

Hi, Firstly your title mentions sleep mode, - but your looking for Standby mode right?

You need to ensure the sub-ghz is switched off first with:

LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN); // or standby
then call HAL_PWR_EnterSTANDBYMode

and you should get 2uA.

Occasionally my 3172 only drops to 2.5mA - which Im trying to figure out…

P.S dont confuse sleep/standby - thats why you have unrelated answers to your question. maybe change yr title.

Hello, I fixed this problem :slightly_smiling_face:

  1. turn off WAKE UP pin
  2. set RTC with wake up by alarm
  3. set Radio sleep mode

after this, I get 1.1 uA in standby mode

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.