Verify the timing of the half-bridge outputs at the pins without requiring a charge controller, where a wrong timer configuration could destroy the power stage. The outputs of the half bridge are wired to two input capture channels of a 32-bit timer (TIM2 or TIM5) on a Nucleo-G474RE board. As both channels share the same counter, the edges of the high-side and low-side signals can be put into chronological order to measure: - frequency and duty cycle (incl. duty cycle limits) - dead time at both switching transitions of each period - overlap of high-side and low-side on-time (shoot-through) - output states when stopped and with forced low-side switch The test covers the advtim (TIM1), gptim (TIM3) and HRTIM drivers with separate overlays. It requires the half_bridge_loopback fixture, so it is only built in CI and run with a twister hardware map on a board with the loop-back wiring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
714 B
Plaintext
33 lines
714 B
Plaintext
/*
|
|
* Copyright (c) The Libre Solar Project Contributors
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
&timers1 {
|
|
status = "okay";
|
|
|
|
halfbridge: half-bridge {
|
|
compatible = "libresolar,stm32-advtim-half-bridge";
|
|
pinctrl-0 = <&tim1_ch1_pa8 &tim1_ch1n_pb13>;
|
|
pinctrl-names = "default";
|
|
channel = <1>;
|
|
frequency = <70000>;
|
|
deadtime-ns = <300>;
|
|
};
|
|
};
|
|
|
|
/ {
|
|
loopback {
|
|
compatible = "test-half-bridge-loopback";
|
|
half-bridge = <&halfbridge>;
|
|
capture-timer = <&timers2>;
|
|
high-side-channel = <1>;
|
|
low-side-channel = <2>;
|
|
high-side-gpios = <&gpioa 0 GPIO_ACTIVE_HIGH>;
|
|
low-side-gpios = <&gpioa 1 GPIO_ACTIVE_HIGH>;
|
|
pinctrl-0 = <&tim2_ch1_pa0 &tim2_ch2_pa1>;
|
|
pinctrl-names = "default";
|
|
};
|
|
};
|