Hi everyone,
I redesigned the original STM32 firmware of the picocalc (aka “BIOS” or keyboard driver) to better suit my needs.
A brief overview of the differences:
- persistent saving of settings like backlight,
- internal use of the RTC (provide external access through I2C),
- drastic reduction in static power consumption,
- reduced (probably wiped out) duplicate key press,
- …
Here is the source https://git.jcsmith.fr/jackcartersmith/picocalc_BIOS and the binary firmware for flashing.
Please note that this is a pre-release version, so I haven’t tested it much yet. There may be hidden bugs…
But if you want to try it and give me a feedback, it’s always appreciated!
In this case, I recommend reading the rest of this post.
=== About the RTC wake-up feature - EDIT 17-05===
I’ve come to a lot of annoying issues with the RTC… For this reason, I’m considering to switch the MCU to the STM32F405 instead.
As for the original F103, I’ll try to work on a different approach for the “wake-up” feature…
In the worst case scenario, it will be available as an experimental (understand “don’t rely on it”) feature in the v1.
=== Technical details ===
The settings of the backlight are saved inside the STM32 chip 1.5s after the last value change. Saved settings are keep between restart and further firmware upgrade. The only way to clear it is by erasing the full flash.
The brightness curve has also been revised.
A new TYPE register (addr = 0x00) have been added to identify custom firmware, as the official firmware will always answer 0x00 when accessed.
This custom firmware use the TYPE-ID 0xCA.
You can use this register to test what kind of firmware is running on your stm32 and set the corresponding registers table (I’ll push a driver exemple in time with the v1 release, and possibly a pull-request on the legacy driver of the picocalc repo to be used in picomite or others projects).
I made some change in the backlight value range, this only change from raw 8-bit value to 10 steps [0-9]. This only impact from you if you drive the backlight from the pico.
If you write a value greater than 9, the firmware will compute an approximate linear value of the PWM. This behavior have been added for the compatibility with the official i2ckbd driver.
RTC interface have been implemented correctly since v0.6. The date and time registers are accessible on I2C interface, the alarm only trigger the IRQ signal (no wake-up).
The RTC have some issues with the calendar and its memory. It don’t remember the date during sleep mode and completly miss the day change if the day go beyond 25h. I’ll manage to patch the last thing but I’ll not implement the wake-up feature (see the top EDIT).
The power manager has also been further developed: the AXP2101 PMU is no longer stopped but the STM32 is put to a “sleep” state when the picocalc is stopped. It’s mandatory for the RTC to work. This mode has overall consumption <0.1 mA. And in the event of a fault or low battery level, it switches everything off.
The I2C registers mapping will be compatible with official firmware and driver. Plus the power performance, RTC access, sleep mode and preferences saving. Only the planned “wake-up” feature is postponed.
It’s forked from the 1.2 official firmware.
I’ve used the STM32 HAL and CMSIS lib to reduce the firmware size and allow more features to be implemented in the future.
=== Important notes ===
That’s for me like an “alternative”, not a replacement! (but 99% of the features are compatible)
I am still planning to provide a replacement i2ckbd driver that will work with this (and others custom) firmware and the original.
Using the default driver should work too but you’ll lake of the news registers/features from the custom firmware.
Hack’n Play!