LPRun or underclocking?

Hi All,

I’m wondering if there is anyway without having to resort to STM32 programming directly to use the LPRun mode or underclocking from 48mhz down to maybe 24mhz? I’m looking to save power when not in sleep all mode but the code I’m running doesn’t really need to juice of 48mhz.

Thanks

When you are developing your code, in the firsts steps, you will a development way, just to simplify:

  1. An infinity loop, the traditional Arduino way(Arduino BSP): setup() and a loop().
  2. Event driven(RTOS): when design the MCU behavior to sleep until a event happen ( a common case it is a hardware interruption, ISR), for example, an accelerometer saying that you have an amount of movement that mean that your MCU should wake up.

The event driven can be done by a Real Time Operation System(for example FreeRTOS) or RUI3 from RAKWireless.

Is it help you?

Regards,

Claudio

1 Like

There is no way on the RUI3 to operate/configure on lower speed. This is also not in the roadmap (maybe not a good news for you). This is something to be done on STM32 SDK directly maybe via system clock prescaler.

1 Like

Hi Claudio,

I’m already running event driven however when I do wake up i’m running a steady 5ma no matter what I’m doing. In this case I’m collecting and storing a few hundred ADC values and doing basic math, It’s not stressing the CPU in any way but it’s burning more power than it should

1 Like

Thanks for confirm this.

When dropping down to operating at the STM32 SDK direct level is there anyway to build in/use RUI3? Ideally all i’m wanting to do is either run LPRun @ 2mhz or run normal but at 16mhz which drops power consumption in 1/2.

Alternatively, is there a slower/lower power version of RAK3172 that I might have missed?

Thanks

Well,

I am not sure how to do it in RUI3, but in a Real Time Operational System, if you want to reduce the resources consumption, following the diagram below, you can:

  1. You can create each task that you want to control and after that:
    1.1) suspend a Task: the task will become Suspended, it will be putted out of Ready Tasks Queue, and then probably you will reduce the consumption :slight_smile:
    1.2) resume a suspended Task: when you need again the suspended Task, a Task Resume will send it back to the Read Task Queue
    1.3) when a Task is waiting for, for example a sensor interruption, this task will be blocked by the RTOS, and it will be released when the interruption happens
  2. Other important point is when you are planning a Lower Power design, all hardware should support a “low power operation mode”

What do you think?

FreeRTOS task states and state transitions described