pyocd / pyocd/pyOCD

PyOCD incorrectly truncates device Serial Numbers starting with '0'

Open
#917 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Serial Numbers can begin with zeros, in our investigation into this it's common for JLINK devices to have serial numbers of this form:

  • 000820102635
  • 000682561275

Listing devices with PyOCD seems to truncate these serial numbers and removes the leading zeros (mbed-ls lists them correctly).

This has a knock-on effect that when specifying a device uid for an operation, the device isn't found even though a valid serial number is passed. e.g.:

> pyocd flash --uid 000820102635 ...

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 reproducing the issue with device listing and pyocd flash --uid 000820102635 ..., comparing the displayed UID with the supplied value. Trace where device serial numbers are represented and matched, then verify that leading zeros remain visible and that the example UID successfully finds the device.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.