Using the STM32CubeIDE for “low level” development, the generated firmware properly implements low power mode so the MCU is kept in stop state when not executing tasks - which for LoRaWAN is basically most of the time.
I am getting 1.8uA stop current for my PCB with the RAK3172-T and RAK3172 modules.
There is possibly no need to adjust the main clock - I run it at full speed to get its work done quicker to get back into stop mode.
Interestingly, the STM32 generated firmware usually has the MCU running from the HSI (internal RC oscillator) rather than relying on the actual crystal or TCXO. I thought this could be an issue but it really hasn’t been a problem at all:
- The Radio uses the crystal or TCXO (for the -T version) to maintain accurate radio frequency
- The MCU uses the 32768Hz LSE crystal via the RTC for accurately-timed wakeup events
Using the 48MHz HSI clock is accurate enough for UART speed of 115200.
Your application might need to change the RCC to use the HSE or TCXO for RCC, but mine is OK.
I have written a document on using STM32CubeIDE “from scratch” (doesn’t rely on the RAK LL code) for the RAK3172 that does achieve the Stop state low current. Message me for a copy of the latest version.