pyocd / pyocd/pyOCD

[cli] pyocd commander -W -u 12345: return code always is 0

Open
#1,794 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
560
Avg merge
1h 41m
Merged PRs (30d)
3

Description

The CLI return code is zero even if pyocd commander cannot connect to target.
The expected behaviour should be return a none-zero code

Reproduce Steps:

# 12345 is a fake unique id
pyocd commander -W -u 12345
No connected debug probe matches unique ID '12345'


# windows check return code
echo %errorlevel%

Background: We are using pyocd commander to do some automation, sometimes the boards cannot be enumrated due to usb power.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reported pyocd commander -W -u 12345 reproduction and trace the commander CLI entry point's handling of connection failure. Done means the command returns a non-zero status when no probe matches, with the behavior verified using the Windows %errorlevel% check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.