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

Move probe-rs chip name into boards/*.toml, remove scary matches #1903

Merged
merged 2 commits into from
Oct 11, 2024

Commits on Oct 11, 2024

  1. archive version 9: now without openocd/pyocd flashing

    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 committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    9cb62cf View commit details
    Browse the repository at this point in the history
  2. Move probe-rs chip name into boards/*.toml

    Historically, the build system's flash support has contained a big scary
    match mapping board names to probe-rs chip names. This is super error
    prone, as I ranted about at length over in #1886.
    
    I recently introduced per-board configuration files as a way to (1)
    check that board names used in apps are not mispeld, and (2) store
    configuration like this.
    
    This change switches the build system to look in the toml files for the
    chip name, removing the final big scary match statement.
    
    Note that this information is _more specific_ than the information in
    chip.toml, because probe-rs is weirdly fanatical about specifying chip
    type (up to and including the package!), whereas Hubris's peripheral
    maps don't care.
    
    Fixes #1886.
    cbiffle committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    3ca5d91 View commit details
    Browse the repository at this point in the history