pyocd / pyocd/pyOCD

Pack targets should be preferred over builtin targets when targets of the same name exist in both

Open
#1,727 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

Right now, if there's a builtin target that matches the requested target, it is used over any pack targets. This is undesirable as pack targets may provide more functionality than builtin targets (such as having peripherals).

Specifically, I'm concerned with RP2040 target. There's a vendor published pack with contains peripheral SVDs for all the peripherals, which is very convenient when debugging and looking and peripheral registers, e.g. with 'monitor rr ...'.

Both the pack and the builtin registers targets under the name rp2040.

I think pyocd should, when a pack with the same target name as a builtin target is installed, prefer the pack target. The code right now only attempts to load target from a pack if there's no existing target in the list (which initially contains builtin targets).

I'm willing to make the necessary changes if we can nail down the behavior we want to have.

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 tracing the target-loading logic described in the issue, focusing on how builtin and pack targets are collected and resolved when both provide rp2040. Confirm the desired precedence for an installed pack target, then verify that the pack target is selected while existing builtin behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools, embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.