Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions cmd/reset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ fn reset(context: &mut ExecutionContext) -> Result<()> {
// Detect bogus archives by looking at the chip member
if let Some(archive) = &context.archive
&& chip.is_some()
&& archive.wants_reset_handoff_token()
{
Behavior::ResetWithHandoff(archive)
} else {
Expand All @@ -66,6 +67,12 @@ fn reset(context: &mut ExecutionContext) -> Result<()> {
if let Some(archive) = &context.archive
&& chip.is_some()
{
if !archive.wants_reset_handoff_token() {
anyhow::bail!(
"--use-token=true was specified, but the archive \
does not have the relevant kernel feature"
);
}
Behavior::ResetWithHandoff(archive)
} else {
anyhow::bail!(
Expand Down
2 changes: 1 addition & 1 deletion humility-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[package]
name = "humility-bin"
edition.workspace = true
version = "0.12.9"
version = "0.12.10"
license = "MPL-2.0"

[build-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions humility-bin/tests/cmd/chip.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For more information try --help

```
$ humility --chip this-can-be-anything -V
humility 0.12.9
humility 0.12.10

```

Expand All @@ -28,7 +28,7 @@ For more information try --help

```
$ humility -c apx432 -V
humility 0.12.9
humility 0.12.10

```

4 changes: 2 additions & 2 deletions humility-bin/tests/cmd/version.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Long version flag:

```
$ humility --version
humility 0.12.9
humility 0.12.10

```

Short version flag:

```
$ humility -V
humility 0.12.9
humility 0.12.10

```
2 changes: 1 addition & 1 deletion humility-core/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub trait Core {
/// the `measurement-token` crate in `lpc55_support`, which is also used in
/// the SP firmware.
fn reset_with_handoff(&mut self, hubris: &HubrisArchive) -> Result<()> {
if hubris.manifest.features.iter().any(|s| s == "measurement-handoff") {
if hubris.wants_reset_handoff_token() {
self.reset_and_halt(std::time::Duration::from_millis(25))?;
crate::msg!("skipping measurement token handoff");
self.write_word_32(
Expand Down
5 changes: 5 additions & 0 deletions humility-core/src/hubris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3773,6 +3773,11 @@ impl HubrisArchive {
.get(&pc)
.and_then(|p| p.as_ref().map(|p| p.as_slice()))
}

/// Returns `true` if this archive should use a reset handoff token
pub fn wants_reset_handoff_token(&self) -> bool {
self.manifest.features.iter().any(|s| s == "measurement-handoff")
}
}

/// Loader for a single ELF file
Expand Down
Loading