1 Month Battery Life with Firmware Update

1 Month Battery Life with Firmware Update

1 Month Battery Life with Firmware Update

We are proud to announce that starting the firmware version 0.82, your Flipper Zero's battery life will last up to 1 month! It took us 2 years to resolve all firmware issues that prevented Flipper Zero from switching to power-saving mode, resulting in the same power consumption baseline in both idle and active states. As a result, Flipper Zero's battery life was approximately 1 week instead of the intended 1 month.

In this post, we will tell you about the new power saving mode and the challenges with the STM32 microcontroller we had to overcome to make the new mode a reality. We will also share updates about worldwide sales.

New Power-Saving Mode

The firmware version 0.82 is available — Update now! This version brings a new deep sleep feature that extends your device's battery life up to 1 month by dramatically decreasing power consumption when there are no running applications or connections on your Flipper Zero.

When Flipper Zero is not running any user applications, the device enters an idle state (sleep mode). Once an application starts, the device switches to an active state: the backlight activates, data exchange with the microSD card begins, and so on. In the active state, power consumption can reach up to 30 mA with a backlight, up to 400 mA with an active transceiver, and even up to 2 A with an active transceiver and connected external module.

The microcontroller used in Flipper Zero supports different sleep modes that have different levels of energy efficiency:

  • Before, we used a mode that wasn't a true sleep mode. This mode was easier to implement but less energy efficient. In this Legacy sleep mode, Flipper Zero consumed 9 mA of power in the idle state.
  • After resolving firmware issues, we enabled a new energy-efficient sleep mode, in which various microcontroller blocks are turned off, and the core clock is switched to a more energy-efficient clock generator. In this deep sleep mode, the power consumption baseline in the idle state is only 1.5 mA!
The new firmware results in power consumption of approximately 1.5 mA in the new deep sleep mode, compared to about 9 mA in the old sleep mode

How to check new deep sleep mode

The implementation of the deep sleep feature was complex. There are several scenarios where this mode may not be activated, such as when a background application is running, second processing core tasks are active, or a Remote Procedure Call (RPC) session is ongoing over Bluetooth LE.

To verify if your Flipper Zero is properly entering deep sleep mode, go to Settings →  Power → Battery Info and wait for the LCD backlight to turn off. A Napping... message should appear in the battery status.

Battery info widget shows if deep sleep mode is on

How to turn off deep sleep mode

This deep sleep mode is enabled by default. You don't need to disable it unless you have problems with your Flipper Zero. Mind that this deep sleep mode is still in its experimental phase. It may lead to unpredictable bugs and side effects. Our testing team has discovered and resolved most of the bugs, but there may still be some that we still need to identify. If you think the mode causes the bug, you can disable the mode for testing purposes and share the issue on the forum.

To disable the deep sleep mode on your device, go to Settings → System and set Sleep Method to Legacy.

Disable the new deep sleep mode in Settings

Why was the deep sleep feature so challenging?

We tried to implement deep sleep mode for a long time, but we could not understand why the system crashed after exiting deep sleep mode.

Flipper Zero is based on an STM32WB series microcontroller. Firmware development with this microcontroller is highly challenging due to its dual-core architecture, shared peripherals, and closed-source firmware for the Core 2 without the ability to debug it🤯

The second core runs proprietary binary blob firmware with no way to debug it

Another problem was poor documentation and incomplete Real-Time Operating System (RTOS) support in the Software Development Kit (SDK). We had to add support for deep sleep inside the operating system ourselves. The furi_hal_os_sleep() function performs tick suppression inside the OS domain.

Although the ARM architecture was initially designed for mobile usage and low power consumption in mind, the implementation of power-saving functions is actually carried out by chip vendors. Vendors use various approaches to implement power-saving functions and provide examples and SDKs to simplify developers' lives. But that doesn’t guarantee success, especially on multicore, shared periphery chips.

Challenges with Core 2

A set of hardware semaphores and Inter-processor communication controller are used to control subsystem ownership and signaling between Core 1 and Core 2. Core 1 firmware must explicitly take some of them to control the clock, flash, and other critical stages. Combining work with a flash controller and active BLE connection is an exceptionally complex task: using a flash controller stalls instruction/data fetch from memory, which causes Core 2 to miss transmission deadlines. The whole system is quite sophisticated and we'll cover it in a separate post.

Challenges with Clock & Power

Almost every electronic device has oscillators inside. Flipper Zero MCU has 7 oscillators. An oscillator is a circuit consisting of a small crystal of quartz and an amplifier that generates even pulses, which provide precise timing for the MCU core and subsystems! These pulses are crucial for the microcontroller's internal operations.

Oscillators play a crucial role in the functionality of Flipper Zero firmware

Three of these oscillators are especially important:

  • High-Speed External (HSE) and Low-Speed External (LSE) oscillators provide reference clocks, which are precise, but not energy efficient.
  • High-Speed Internal (HSI) oscillator provides an internal clock, which is energy efficient, but not precise.

The LSE oscillator is continuously active, the HSE oscillator is activated when an application is running, and the HSI oscillator is activated when the device enters deep sleep mode. However, using the HSE oscillator during deep sleep is impossible, requiring all clock domains to be switched to HSI before entering deep sleep mode. Overcoming this challenge, we have developed the furi_hal_clock_switch_to_hsi() function that facilitates a smooth and efficient transition to the energy-efficient HSI oscillator, enabling deep sleep functionality.

Since going into sleep mode physically turns off peripheral subsystems, they must be in a disabled state. That brings API design to a new level of complexity, especially in multitask OS. It took us some time to design APIs to be compatible with deep sleep mode. The furi_hal_power_deep_sleep() function is responsible for the transition into deep sleep mode at the power domain level.

Challenges with Debugging

Another problem is debugging Core 1 firmware when in deep sleep mode: MCU Debug subsystem must be specially configured to wake the system up from sleep. Debugging is also impossible if the system is misconfigured, exiting, or entering deep sleep mode and something goes wrong. Also, halting MCU while in sleep will wake it up on the HSI clock, which is much slower than HSE and requires a special debug adapter configuration.

As you can see, developing and debugging with the STM32WB series microcontroller is a challenging task. That is why it took us so long to identify and resolve all the issues related to our firmware. But thanks to our team of developers, the battery life of your Flipper Zero will last up to 1 month, starting the firmware version 0.82.

How to buy Flipper Zero worldwide

Sales of Flipper Zero are gaining momentum around the world. More than 200 thousand devices have already reached their owners! At the same time, worldwide delivery is a big challenge for us. We engage reseller partners to sell Flipper Zero worldwide.

For your convenience, we have created a How To Buy page where you can select your country and view live information about all official partners. The page is currently in beta mode but will soon update data about partners in real time.

Due to the incredible popularity of Flipper Zero, many fraudulent accounts have appeared on the Internet. Only the websites listed here are trusted. We do not sell our products on social networks like Instagram, Telegram, or TikTok.

⚠️ If you are offered to buy Flipper Zero anywhere else, it is most likely a fraudulent seller. Don't send them money, you will most probably be scammed. Please report all scammers to us via the Abuse Report Form.