Exit codes
Interpret OnMCU CLI process exit codes in scripts and CI.
The CLI returns 0 only when the command succeeds. If a hardware job fails, is cancelled, or times out, onmcu run also fails.
| Code | Meaning |
|---|---|
0 | Success; for run, the hardware job completed successfully. |
2 | Unexpected trailing command arguments. |
3 | The configuration file could not be read or parsed. |
4 | Missing, malformed, or rejected authentication credential; also used for keyring access failures. |
5 | API request failure. |
6 | Firmware file or upload failure. |
7 | Interactive login input or API-key validation failure. |
8 | No matching board identifier was found. |
9 | The pending job was cancelled because no device became available. |
10 | The hardware job failed. |
11 | The hardware job was cancelled. |
12 | The hardware job timed out. |
13 | The CLI could not determine a final job status. |
14 | The authenticated account does not have permission for the request. |
Shell example
if onmcu run --board NUCLEO-H743ZI --file firmware.elf; then
echo "hardware test passed"
else
status=$?
echo "hardware test failed with OnMCU exit code $status" >&2
exit "$status"
fiDevice and CLI exit codes
The result passes through three layers:
- Firmware reports completion to the debugger, for example with ARM semihosting
SYS_EXIT_EXTENDED. - The OnMCU job records that result as
completedorfailed. - The CLI maps the final job state to its own stable process exit code (
0or10, respectively).
Read End a run with semihosting for C and Rust examples that end immediately instead of waiting for the run timeout.
CLI usage errors produced directly by the argument parser may also return 2, in line with normal command-line conventions.