docs: describe hardware loop-back tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Martin Jäger
2026-10-21 20:22:39 +02:00
co-authored by Claude Opus 5.5
parent 8213ec7383
commit 7a1a1b02b5
+40 -1
View File
@@ -16,7 +16,46 @@ All tests are run on ``native_sim`` with emulated drivers using twister:
The driver tests are additionally built (but not run) for some of the boards to ensure that the
drivers compile for all supported MCUs.
The firmware can be built for all boards and board revisions in the same way:
Hardware tests
--------------
The half-bridge drivers configure timers which drive the MOSFETs of the power stage. A wrong
configuration (e.g. missing dead time) could destroy the hardware. So the drivers are tested on a
Nucleo-G474RE board instead of an actual charge controller. The outputs of the half bridge are
wired to input capture channels of another timer (loop-back), which measures the frequency, duty
cycle, dead time and overlap of the signals at the pins.
The test is located in ``tests/drivers/half_bridge_loopback`` and covers the drivers for
advanced-control timers (TIM1), general-purpose timers (TIM3) and the HRTIM. The required wiring
is described in ``boards/nucleo_g474re.overlay`` of the test.
Twister only runs the test on boards providing the ``half_bridge_loopback`` fixture, which has to
be specified in a hardware map file (e.g. ``map.yaml``) together with the ID of the ST-LINK probe:
.. code-block:: yaml
- connected: true
id: 00180012544B500420343637
platform: nucleo_g474re
product: STLINK-V3
runner: pyocd
serial: /dev/ttyACM0
fixtures:
- half_bridge_loopback
A hardware map with the IDs of the connected probes can be generated with
``west twister --generate-hardware-map map.yaml``. Afterwards, run the tests with:
.. code-block:: bash
west twister -T tests/drivers/half_bridge_loopback --device-testing --hardware-map map.yaml
Without a hardware map (e.g. in CI), the test is only built.
Firmware builds
---------------
The firmware can be built for all boards and board revisions in the same way as the tests:
.. code-block:: bash