Clone
7
Home
JackCarterSmith edited this page 2026-04-04 14:09:19 +02:00

Summary

The PicoCalc use a STM32 microcontroller to handle the key components for proper functioning. This includes: PMIC (power management), keyboard handler and backlight control.

For these reasons, the latter is therefore nicknamed the PicoCalc's "southbridge".

The official STM32 firmware is very rudimentary, not optimised, and sorely lacking in basic features. So, I've rewrite the firmware to streamline the code as much as possible and add a few functions that mainly meet my needs.

Differences with the official firmware

  • The original code use the stm32duino framework as code base. It's mainly used as an arduino code style (main + loop + C++) to help beginner, but it add a heavy overhead and if you want an optimized code, you must NOT use it. This custom code use the official STM32 HAL as base code instead. The HAL will provide a good performance without going to deep in the low-level registers.
  • Debug UART message have been removed from the release version, this help with the previous point to reduce the firmware size by half.
  • The clock tree have been optimized to reduce power consumption from ~40 to 3.5 mA.
  • I2C handler have been hardened to allow Standard mode (100 kHz) and auto reset logic in case of malformed/corrupted transaction.
  • PMIC driver have been reduced to only AXP2101 chip support.

New features added

  • Configuration registers, including backlight selection, are saved inside STM32 flash memory.
  • Power management use the low power feature of the STM32 to allow long power-saving. The southbridge can wake-up the PicoCalc this way.
  • Internal RTC enabled to be used by the main MCU (RP2xxx, RKxxx, etc.).
  • New I2C registers to drive/configure the extended features added by this firmware.
  • If the main MCU is freeze for any reason, the combo shift + power button press allow a power reset of the main MCU.
  • Some internals mechanisms have been strengthened. If the STM32 freeze, the keyboard would be ineffective.

I2C protocol and registers

Specials keyboard shortcut

Combo Description
Alt+B Show the batteries power level. It doesn't do anything if no battery is present.
Shift+Power Reset the Pico board.