Skip to content

Version 30

Choose a tag to compare

@dacarson dacarson released this 07 Aug 16:14
· 23 commits to main since this release

UPSPlus Firmware Release Notes — Version 30

Fix: Button Power-On Could Immediately Drive Battery Back Toward Cutoff
The button-press power-on check only compared battery voltage against the bare protection-voltage threshold, with no hysteresis margin. A real test found this let a button press power the Pi back on with the battery at 2.81V (protection threshold 2800mV) and no charger attached, immediately driving it back toward cutoff. Button power-on now requires the same protection-voltage-plus-hysteresis margin the automatic power-on path already uses. (It still intentionally ignores the low-battery-percent warning — a user pressing the button is explicitly asking to power on now regardless of charge percent.)

Fix: Stale VDDA Reference Caused Voltage Readings to Drift Near Battery Cutoff
Pogopin/battery/USB voltage conversions are ratiometric against VDDA, but VDDA was only recalibrated while the Pi was off, then only on a slow ~41s timer — so it stayed frozen at its boot-time value for the entire time the Pi was on. A real discharge test showed output voltage climbing well above 5V right at battery cutoff while INA219 current/power stayed flat, confirming stale-VDDA bias rather than an actual rail event. VDDA now recalibrates every ADC cycle (~500ms) regardless of power/charger state, using the VREFINT sample already taken on every round-robin scan.

Fix: INA219 Calibration Register Could Get Zeroed at Runtime
If the INA219 supply rail resets independently of the MCU (e.g. during a full battery-drain power cycle), its calibration register reads back 0 and current readings silently go to 0 while still reporting valid, with no other symptom until the next full MCU power cycle. The firmware now reads the calibration register alongside current on every poll and repairs it immediately if it's found zeroed, discarding that one sample while the existing retry picks up a good value moments later. (Fixes #13)

Recovered Flash Space
Flash was nearly full. Removed errno support (unused) and added a small __aeabi_idiv override that reuses the already-linked unsigned divide instead of pulling in libgcc's full signed-division routine, recovering close to 500 bytes combined.

Documentation / Internal Cleanup
Linker script vector-table and data-section addresses are now derived from ORIGIN(RAM)/SIZEOF() instead of hardcoded magic numbers, so they stay in sync if the RAM origin or vector table size ever changes. Clarified that IP5328 thermal shutdown doesn't directly affect the Raspberry Pi, since it's powered separately.

Firmware version bumped to 30.

Linux NUT driver
No changes since Version 29. Still available here: https://github.com/dacarson/nut/releases/tag/v2.8.5-upsplus


Full changelog: Version-29...Version-30