app: enable HS MOSFET fail-safe protection based on devicetree

The fuse destruction in case of a shorted high-side MOSFET was enabled
for all boards with DC/DC converter, even if the board doesn't have a
fuse at the low-side terminal (e.g. Nucleo G474RE).

Add an ls-fuse property to the charge-controller binding to describe
this hardware feature and make HS_MOSFET_FAIL_SAFE_PROTECTION depend on
it. The property is added to all MPPT boards, so the behavior does not
change for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Martin Jäger
2026-10-21 09:18:46 +02:00
co-authored by Claude Opus 5.5
parent b1cd0b6922
commit bfbe98a62e
7 changed files with 18 additions and 1 deletions
+5 -1
View File
@@ -19,11 +19,15 @@ config CONTROL_FREQUENCY
config HS_MOSFET_FAIL_SAFE_PROTECTION
bool
default y
depends on $(dt_node_bool_prop,/pcb,ls-fuse)
help
If enabled, the DC/DC control function will will detect if the high-side MOSFET has failed
If enabled, the DC/DC control function will detect if the high-side MOSFET has failed
short and trip the fuse by switching the low-side MOSFET continuously on. This will prevent
accidental overcharging of the battery.
Only available if the board has a fuse at the low-side terminal (ls-fuse property of the
pcb devicetree node).
#
# Visible (user-configurable) Kconfig symbols
#
@@ -20,6 +20,7 @@
hs-voltage-max = <40>;
ls-voltage-max = <16>;
dcdc-current-max = <10>;
ls-fuse;
};
chosen {
@@ -20,6 +20,7 @@
hs-voltage-max = <90>;
ls-voltage-max = <32>;
dcdc-current-max = <20>;
ls-fuse;
};
chosen {
@@ -22,6 +22,7 @@
hs-voltage-max = <80>;
ls-voltage-max = <32>;
dcdc-current-max = <20>;
ls-fuse;
};
chosen {
@@ -22,6 +22,7 @@
hs-voltage-max = <55>;
ls-voltage-max = <32>;
dcdc-current-max = <20>;
ls-fuse;
};
chosen {
@@ -22,6 +22,7 @@
hs-voltage-max = <80>;
ls-voltage-max = <32>;
dcdc-current-max = <20>;
ls-fuse;
};
chosen {
+8
View File
@@ -29,6 +29,14 @@ properties:
dcdc-current-max:
type: int
description: Maximum inductor current in amps (if existing in the charge controller)
ls-fuse:
type: boolean
description: |
Low-side (typically battery) terminal is protected by a fuse
The fuse can be blown by switching on the low-side MOSFET of the DC/DC converter
continuously, which shorts the low-side terminal through the inductor. This is used to
prevent overcharging of the battery in case of a shorted high-side MOSFET.
internal-tref-max:
type: int
default: 50