Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make OpenOCD/PyOCD flash config optional in archive. #514

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

cbiffle
Copy link
Contributor

@cbiffle cbiffle commented Oct 10, 2024

The support for forcing flashing with openocd winds up producing a bunch of extra support code in the build system, for a feature we basically never use anymore.

The support for PyOCD has, apparently, never been finished, and does not work.

So I'm hoping to remove them from the Hubris build system, but the first step toward that is teaching Humility to behave gracefully if they're omitted from the img/flash.ron file.

This change makes the fields optional, and Humility now only requires their presence if the user explicitly asks for the old --force-openocd switch.

cbiffle added a commit to oxidecomputer/hubris that referenced this pull request Oct 10, 2024
Humility has historically had support for a --force-openocd flag on the
flash subcommand, as a hedge against probe-rs having bugs or limited
chip support. In practice, as far as I can tell, we never use it.

This support required one of the three giant merge-conflict-prone match
statements on which I declared war in #1886. The second such match
statement was providing similar support for PyOCD, which Humility
appears to have never actually implemented!

So this change removes both. Archives built at or after this change can
only be flashed (by Humility) using probe-rs. One giant scary match
statement remains, but it's in my sights.

I have left the openocd.cfg file in the archive because it's useful for
debugging, even if we don't use it for _flashing._ (My workflow if I
need gdb is typically to flash with Humility via probe-rs, and _then_
fire up openocd.)

I've bumped the archive version here so that using such an archive with
an older Humility gets you a cogent error. (Otherwise, you get a weird
crash about loading flash.ron, no matter what you're trying to do.)

Note that this requires a corresponding change in Humility, both to
tolerate the absence of the removed fields, and to handle the new
archive version.

    oxidecomputer/humility#514
The support for forcing flashing with openocd winds up producing a bunch
of extra support code in the build system, for a feature we basically
never use anymore.

The support for PyOCD has, apparently, never been finished, and does not
work.

So I'm hoping to remove them from the Hubris build system, but the first
step toward that is teaching Humility to behave gracefully if they're
omitted from the img/flash.ron file.

This change makes the fields optional, and Humility now only requires
their presence if the user explicitly asks for the old --force-openocd
switch.
@cbiffle cbiffle requested a review from mkeeter October 10, 2024 22:04
cbiffle added a commit to oxidecomputer/hubris that referenced this pull request Oct 10, 2024
Humility has historically had support for a --force-openocd flag on the
flash subcommand, as a hedge against probe-rs having bugs or limited
chip support. In practice, as far as I can tell, we never use it.

This support required one of the three giant merge-conflict-prone match
statements on which I declared war in #1886. The second such match
statement was providing similar support for PyOCD, which Humility
appears to have never actually implemented!

So this change removes both. Archives built at or after this change can
only be flashed (by Humility) using probe-rs. One giant scary match
statement remains, but it's in my sights.

I have left the openocd.cfg file in the archive because it's useful for
debugging, even if we don't use it for _flashing._ (My workflow if I
need gdb is typically to flash with Humility via probe-rs, and _then_
fire up openocd.)

I've bumped the archive version here so that using such an archive with
an older Humility gets you a cogent error. (Otherwise, you get a weird
crash about loading flash.ron, no matter what you're trying to do.)

Note that this requires a corresponding change in Humility, both to
tolerate the absence of the removed fields, and to handle the new
archive version.

    oxidecomputer/humility#514
@cbiffle cbiffle merged commit 5214d64 into master Oct 11, 2024
11 checks passed
@cbiffle cbiffle deleted the cbiffle/openocd-optional branch October 11, 2024 18:06
cbiffle added a commit to oxidecomputer/hubris that referenced this pull request Oct 11, 2024
Humility has historically had support for a --force-openocd flag on the
flash subcommand, as a hedge against probe-rs having bugs or limited
chip support. In practice, as far as I can tell, we never use it.

This support required one of the three giant merge-conflict-prone match
statements on which I declared war in #1886. The second such match
statement was providing similar support for PyOCD, which Humility
appears to have never actually implemented!

So this change removes both. Archives built at or after this change can
only be flashed (by Humility) using probe-rs. One giant scary match
statement remains, but it's in my sights.

I have left the openocd.cfg file in the archive because it's useful for
debugging, even if we don't use it for _flashing._ (My workflow if I
need gdb is typically to flash with Humility via probe-rs, and _then_
fire up openocd.)

I've bumped the archive version here so that using such an archive with
an older Humility gets you a cogent error. (Otherwise, you get a weird
crash about loading flash.ron, no matter what you're trying to do.)

Note that this requires a corresponding change in Humility, both to
tolerate the absence of the removed fields, and to handle the new
archive version.

    oxidecomputer/humility#514
cbiffle added a commit to oxidecomputer/hubris that referenced this pull request Oct 11, 2024
Humility has historically had support for a --force-openocd flag on the
flash subcommand, as a hedge against probe-rs having bugs or limited
chip support. In practice, as far as I can tell, we never use it.

This support required one of the three giant merge-conflict-prone match
statements on which I declared war in #1886. The second such match
statement was providing similar support for PyOCD, which Humility
appears to have never actually implemented!

So this change removes both. Archives built at or after this change can
only be flashed (by Humility) using probe-rs. One giant scary match
statement remains, but it's in my sights.

I have left the openocd.cfg file in the archive because it's useful for
debugging, even if we don't use it for _flashing._ (My workflow if I
need gdb is typically to flash with Humility via probe-rs, and _then_
fire up openocd.)

I've bumped the archive version here so that using such an archive with
an older Humility gets you a cogent error. (Otherwise, you get a weird
crash about loading flash.ron, no matter what you're trying to do.)

Note that this requires a corresponding change in Humility, both to
tolerate the absence of the removed fields, and to handle the new
archive version.

    oxidecomputer/humility#514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants