Skip to content

Fix battery charger fault decoding - #268

Merged
TobiasRoeddiger merged 3 commits into
mainfrom
battery-timer-fault-recovery
Aug 20, 2026
Merged

Fix battery charger fault decoding#268
TobiasRoeddiger merged 3 commits into
mainfrom
battery-timer-fault-recovery

Conversation

@TobiasRoeddiger

@TobiasRoeddiger TobiasRoeddiger commented Aug 19, 2026

Copy link
Copy Markdown
Member

Summary:

  • Correct the nRF5340 GPIO offsets so the charger CD pin is actually pulsed
  • Verify CD high/low levels, charger-current configuration, and safety-timer clearing
  • Decode VIN, battery overcurrent, temperature, VINDPM, reset, and timer states
  • Separate resettable conditions from electrical faults that require a safe stop
  • Make TWIM failures identify NACKs and stuck bus lines, and always issue STOP on errors
  • Clean up and resume the target after setup failures or Ctrl-C
  • Detect stalled recovery, enforce timeout/reset limits, and reject unsafe polling values
  • Preserve charger temperature monitoring and document recovery behavior

Testing:

  • 28 unit tests: python3 -m unittest discover -s tools/battery -p "test_*.py" -v
  • python3 -m py_compile tools/battery/battery_debug.py tools/battery/test_battery_debug.py
  • python3 tools/battery/battery_debug.py recover --help
  • Missing-probe CLI failure path
  • git diff --check

Hardware validation:

  • Not run in this pass because no J-Link probe is connected.

@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.elf.zip
openearable_v2_fota.zip

@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.elf.zip
openearable_v2_fota.zip

@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.elf.zip
openearable_v2_fota.zip

@TobiasRoeddiger
TobiasRoeddiger merged commit 5c50d71 into main Aug 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant