When a unit fails in the field, the first question is "what firmware was it running?" If you can't answer that from your test records, you're stuck guessing. TofuPilot lets you tag every test run with the firmware version so you can filter, trace, and report on it later.
Why Firmware Version Tracking Matters
Firmware changes between production batches are common. A bug fix in v2.4.2 might introduce a regression that only shows up under specific conditions. Without version tracking, you can't correlate failure spikes with firmware releases.
Regulatory standards (IEC 62304, FDA 21 CFR Part 820, ISO 13485) require you to document the software configuration of each device at the time of production. For field returns, you need to prove which firmware was loaded when the unit left your factory.
Firmware tracking also helps during EVT/DVT/PVT transitions. You can compare FPY and measurement distributions across firmware versions to verify that a new build doesn't degrade performance.
Recording Firmware Version as a Measurement
The simplest approach is to record the firmware version as a measurement in your test. This makes it visible in every run record.
import openhtf as htf
from tofupilot.openhtf import TofuPilot
@htf.measures(
htf.Measurement("firmware_version"),
htf.Measurement("boot_time")
.in_range(maximum=2000),
htf.Measurement("self_test_pass")
.equals(True),
)
def boot_validation(test):
test.measurements.firmware_version = "3.1.0-rc2"
test.measurements.boot_time = 843
test.measurements.self_test_pass = True
@htf.measures(
htf.Measurement("ble_rssi")
.in_range(minimum=-70, maximum=-20),
htf.Measurement("wifi_throughput")
.in_range(minimum=50.0),
)
def wireless_check(test):
test.measurements.ble_rssi = -42
test.measurements.wifi_throughput = 87.3
def main():
test = htf.Test(
boot_validation,
wireless_check,
station_id="STATION-FT-04",
)
with TofuPilot(test):
test.execute(test_start=lambda: "HUB-2026-03-00891")
if __name__ == "__main__":
main()Every run in TofuPilot will carry the firmware version as a searchable field. You can filter your run history by this value directly from the dashboard.
Reading Firmware Version from the DUT
In production, you shouldn't hardcode the firmware version. Read it from the device during the test so the record always reflects what's actually on the unit.
import openhtf as htf
from openhtf.plugs import BasePlug
from tofupilot.openhtf import TofuPilot
class DeviceConnection(BasePlug):
"""Connects to the DUT over serial to read device info."""
def read_firmware_version(self):
# Replace with your actual device communication
# e.g., send AT command, read UART, query USB descriptor
return "3.1.0-rc2"
def read_bootloader_version(self):
return "1.2.0"
def tearDown(self):
pass
@htf.measures(
htf.Measurement("firmware_version"),
htf.Measurement("bootloader_version"),
)
@htf.plug(device=DeviceConnection)
def read_device_info(test, device):
fw = device.read_firmware_version()
bl = device.read_bootloader_version()
test.measurements.firmware_version = fw
test.measurements.bootloader_version = bl
@htf.measures(
htf.Measurement("adc_accuracy_percent")
.in_range(maximum=0.5),
htf.Measurement("watchdog_recovery_pass")
.equals(True),
)
def functional_test(test):
test.measurements.adc_accuracy_percent = 0.12
test.measurements.watchdog_recovery_pass = True
def main():
test = htf.Test(
read_device_info,
functional_test,
station_id="STATION-FT-01",
)
with TofuPilot(test):
test.execute(test_start=lambda: "SENS-2026-04217")
if __name__ == "__main__":
main()This approach records the firmware version as a measurement (visible in the run detail) and ensures TofuPilot captures exactly what was on the device, not what you expected to be on it.
Filtering Runs by Firmware Version
Once your runs carry firmware version data, TofuPilot's dashboard lets you filter by it. This is where the tracking pays off.
Failure investigation. Filter runs to a specific firmware version and check FPY. If v3.1.0-rc2 has a lower yield than v3.0.9, you've found your suspect.
Regulatory evidence. During an audit, filter by firmware version to show that all units shipped with the validated release. Export the filtered view as evidence.
Field return correlation. When a customer reports a failure, look up the unit's serial number, find the firmware version from the test record, and check if other units with the same firmware show similar behavior.
What to Track Beyond Firmware
Firmware version is the most critical, but consider tracking other software and configuration data that affects test outcomes.
| Field | Example Value | Why It Matters |
|---|---|---|
firmware_version | 3.1.0-rc2 | Core software on the DUT |
bootloader_version | 1.2.0 | Can affect boot behavior and update paths |
hardware_revision | rev-C | PCB changes affect test results |
config_profile | US-120V | Regional or customer-specific settings |
test_script_version | 2.0.4 | Proves which test logic was used |
Record these as measurements in your test phases so they're stored with every run in TofuPilot.