Skip to content

[1725] Report FWUpdate errors in Device Catalog firmware update - #135

Open
hangzqcom wants to merge 1 commit into
developfrom
fix/device-catalog-fwupdate-errors
Open

hangzqcom wants to merge 1 commit into
developfrom
fix/device-catalog-fwupdate-errors

Conversation

@hangzqcom

@hangzqcom hangzqcom commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In Device Catalog, Update firmware (DeviceCatalog::on__firmwareUpdateBtn_clicked) runs the separate FWUpdate utility once for each firmware variant (LP030, then LP038), but:

  • it never checks that FWUpdate started. When FWUpdate is not installed, exitCode() of the process that never ran is 0, so the button reports "Firmware Update Complete" although nothing was flashed;
  • it discards the FWUpdate output and exit code;
  • it waits 30 seconds and then reads the exit code of a process that may still be running, so a stuck FWUpdate is reported as "Firmware Update Complete";
  • every failure shows the same message: "Confirm whether a PSOC debug board is connected".

FWUpdate is not built from this repository and is not included in every installation, so in those installations the button can never succeed. docs/getting-started/03-Test-Automation-Controller.md also says that FWUpdate always ships with QTAC.

Root cause

Success was decided from exitCode() alone (since 5eee72b). QProcess::exitCode() is also 0 when FWUpdate cannot be started or when waitForFinished times out, and FWUpdate's output was discarded, so failures were reported as success or as one generic message.

Fix

  • FWUpdate is looked up next to Device Catalog. If it is not there, the Update firmware button and the firmware selector stay disabled, with a tooltip explaining why. If the update is started anyway, the message names the folder that was searched.
  • Check waitForStarted, merge stdout and stderr, and report the exit code and output for each variant that was tried.
  • A timeout is a failure: FWUpdate is stopped and no further variant is flashed. The timeout is raised from 30 to 120 seconds, because stopping a flash part way can leave the board unprogrammed.
  • If the selected firmware version is not installed, say so.
  • The LP030 → LP038 fallback is unchanged.
  • Docs: updated 03-Test-Automation-Controller.md and 05-Device-Catalog.md to say that FWUpdate may not be installed and that TAC should be closed before updating firmware.

Testing

A test program compiles the real DeviceCatalog.cpp from each tree and runs it offscreen. It uses a fake FWUpdate.exe that only records its arguments, and dummy firmware files in a temporary folder. No hardware is used.

Case develop this PR
Button state, FWUpdate not installed enabled disabled, tooltip explains
Click, FWUpdate not installed "Firmware Update Complete" (nothing ran) "FWUpdate utility was not found in …"
Button state, FWUpdate installed enabled enabled
FWUpdate succeeds success success
LP030 rejected, LP038 accepted success with LP038 success with LP038
FWUpdate fails (exit 3, "port in use") generic message exit code and output for each variant
Selected firmware not installed generic message "selected firmware is not installed"
FWUpdate hangs "Firmware Update Complete" failure after 120 s, no retry
Wrong results 5 of 8 0 of 8

DeviceCatalog also builds cleanly in the full Windows build.

The Update firmware button ran FWUpdate without checking that it
started, threw away its output and ignored a timeout. When FWUpdate
was not installed, or did not finish in 30 seconds, the update was
reported as complete although nothing was flashed. Every other
failure showed the same "Confirm whether a PSOC debug board is
connected" message.

- Look for FWUpdate next to Device Catalog. When it is not installed,
  disable the button with a tooltip that says why, and report the
  folder that was searched if the update is started anyway.
- Check that FWUpdate started, capture its output and show the exit
  code and output for each firmware variant that was tried.
- Treat a timeout as a failure: stop FWUpdate, report it and do not
  try the next variant on a board in an unknown state. Allow 120
  seconds instead of 30.
- Report when the selected firmware version is not installed.
- Docs: FWUpdate is not part of every installation; close TAC before
  updating the firmware.

Signed-off-by: hangzqcom <hangz@qti.qualcomm.com>
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