This file defines the operational workflow for flash, deployment, serial debug, and log collection.
Derived from:
qpy-vscode-extension-master/src/sidebar/firmwareDownload.tsqpy-vscode-extension-master/src/api/fileDownload.tsqpy-vscode-extension-master/src/api/commands.tsqpy-vscode-extension-master/src/serial/commandLine.tsqpy-vscode-extension-master/src/api/userInterface.tsqpy-vscode-extension-master/scripts/q_init_fs.txt
- Identify module model and download port.
- Select local firmware or fetch online firmware package.
- Resolve actual flash target file (
.pac,.bin, or model-specific package). - Run flash tool and monitor progress.
- Capture success/failure with evidence logs.
Command template (tool-driven, Windows):
- Select download port and firmware package.
- Run flash executable through toolchain wrapper:
QuecPythonDownload.exe -d <COMx> -b 115200 -f <firmware_file>
- Expected output contains progress percentage and exit code
0on success. - On failure, record: port id, firmware path, module model, last 20 progress lines.
- Connect serial port (correct baudrate and line terminator).
- Download target script/files to
/usr(or/usr/<subdir>). - Run entry script (
_main.pyor designated module file). - Confirm runtime output and startup markers.
Command templates:
- Download file to
/usr:
QPYcom.exe -d <COMx> -b <baudrate> -f cp <local_file> :/usr/<target_name>
- Download file to custom directory:
QPYcom.exe -d <COMx> -b <baudrate> -f cp <local_file> :/usr/<subdir>/<target_name>
- Run script from REPL:
import example
example.exec('usr/_main.py')- Initialize/read module file tree from
/usr. - Create directory as needed.
- Remove stale files/dirs carefully.
- Refresh and verify final tree state.
Command templates (REPL):
import ql_fs
ql_fs.mkdirs('/usr/test')import uos
uos.remove('/usr/old.py')
uos.rmdir('/usr/old_dir')- Keep serial output attached during flash/deploy/run.
- For persistent evidence, enable log-to-file channel when needed.
- Correlate failures by stage: connect, flash, download, execute, runtime.
Log capture template:
- Enable output channel/file logging in tool settings when needed.
- Keep timestamps in logs.
- Store evidence blocks by stage:
CONNECT,FLASH,DOWNLOAD,EXECUTE,RUNTIME.
- Port not visible: check driver, cable, module mode, download port id.
- Flash fails: check firmware package type and module match.
- Download fails:
check active serial session and target
/usrpath. - Script not running: verify entry file, import path, and runtime exceptions.
Minimum triage payload:
- Module model + firmware version.
- Port path + baudrate.
- Executed command line.
- Last visible error line and stage label.
Use bundled script for one-shot validation before complex operations:
python scripts/device_smoke_test.py --risk-mode safe --auto-ports --print-port-map --repl-baud 115200What it checks:
- AT link (
AT/ATI/AT+CSQ). - REPL link and prompt response.
/usrlist via REPL (default) orQPYcom(explicitly selected).- Optional deploy/import/cleanup probe file on
/usr(REPL default). - Optional continuous REPL log capture (
--follow-seconds) with timestamped output. - Optional report export:
--log-file(text),--json-report(structured data). - Built-in failure classification hints: port-in-use, access failure, tool missing, timeout, BOM encoding, import path.
Recommended command:
python scripts/device_smoke_test.py --risk-mode safe --auto-ports --repl-baud 115200 --ls-via repl --deploy-via repl --follow-seconds 10 --log-file review/device-smoke.log --json-report review/device-smoke.jsonFor standard mode, QPYcom backend is disabled by default and can be enabled explicitly:
python scripts/device_smoke_test.py --risk-mode standard --auto-ports --ls-via repl --deploy-via repl --json-report review/device-smoke-standard.json
python scripts/device_smoke_test.py --risk-mode standard --enable-qpycom-check --auto-ports --ls-via qpycom --deploy-via qpycom --skip-deploy --json-report review/device-smoke-standard-qpycom.jsonFor official firmware lifecycle operations, use:
python scripts/qpy_firmware_manager.py --model EG800AK --latest-only
python scripts/qpy_firmware_manager.py --model EG800AK --stable-only --download-dir review/downloadsFlash only after explicit confirmation:
python scripts/qpy_firmware_manager.py --model EG800AK --stable-only --download-dir review/downloads --flash --flash-port COM7 --flash-baud 115200 --post-smoke --post-smoke-risk-mode safe- Keep
device_smoke_test.pyin--risk-mode safeunless host stability is confirmed. qpy_device_fs_cli.pyonlyqpycombackend operations require--allow-qpycom-riskexplicit acknowledgment.- If host freeze/restart appears, pause flash/deploy and run:
python scripts/qpy_crash_triage.py --days 2 --json-out review/host_crash_triage.json --json