RAK3172 - Clock Speed In Arduino IDE

Hello everyone,

I use the RAK3172-T EU868 module on a custom PCB.
Software used: Arduino IDE

My project is to reduce power consumption as much as possible in order to extend the life of the device.

Is it possible to change the 48MHz clock speed via the Arduino IDE?
If not, if I change the clock via STM32CubeIDE, then reload an Arduino code, will the clock change be saved?

Thanks for your feedback,


Welcome to RAK forum @SauviaTron ,

The running clock speed cant be changed via Arduino. You can create your own custom setting of RCC settings via STM32CubeIE using ST SDK but once you load the RUI3 firmware, it will not be able to retain your custom setting but it will have the RUI3’s needed configuration.

Hello @carlrowan,

Thanks for your anwser.
I will try to tame STM32Cuve IDE.

Do you have any figure about consumption with an another clock speed ?

I haven’t tried changing clock speed so I do not have figures. If ever you got result, it will be good for the community if you can share :slight_smile:

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.

1 Like

Thanks for sharing @Hagrid .

Sleep current are really low on RUI3 too. I am thinking that @SauviaTron is doing some processes while device is active. Having lower clock speed my result to a lower current consumption while device is in active state. By how much, I am not sure if will be really significant.

Thanks @Hagrid & @carlrowan for your answer,

Yes, my main goal is to reduce power consumption during the run state.
On my board I have an GNSS module that use a few mA during sleep mode, so saving µA during sleeping state is not very important in my case.

This week-end I will try to change the clock of my on-board RAK3172 to see if I could get achieve some power saving.

1 Like