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

Bump probe-rs to v0.13.0 #37

Open
wants to merge 2 commits into
base: rivos/main
Choose a base branch
from

Conversation

Edwardong
Copy link

Upstream probe-rs v0.13.0 has

  • Renamed some variables in probe-rs/src/core/mod.rs
    • CoreRegisterAddress -> RegisterId
  • Changed implementation of probe.attach()
    • Introduced a new struct called Permission that "represents what a [Session] is allowed to do with a target."

probe-rs in use: https://github.com/rivosinc/probe-rs/tree/dev/zheren/humility_bump

I also updated rusb: https://github.com/rivosinc/rusb/tree/dev/zheren/test_bump_probe-rs

@Edwardong Edwardong self-assigned this Nov 28, 2022
Copy link
Collaborator

@beezow beezow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this on actual board? I think we should also verify arm still works. I also kind of feel like we should squash these first 3 commits, as they are just changes to work with the updated interface. I think it will not build unless you use the last commit, right?

flake.nix Outdated Show resolved Hide resolved
humility-core/Cargo.toml Outdated Show resolved Hide resolved
humility-core/Cargo.toml Outdated Show resolved Hide resolved
humility-core/src/core/probe.rs Outdated Show resolved Hide resolved
@@ -146,7 +144,7 @@ impl Core for ProbeCore {
use num_traits::ToPrimitive;

core.write_core_reg(
Into::<probe_rs::CoreRegisterAddress>::into(reg_id),
Into::<probe_rs::RegisterId>::into(reg_id),
value as u32,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only cast to a u32 on a 32bit platform. I think this function is templated, so we can call a different version depending on our architecture.

}
}

self.halt_and_read(|core| {
rval = core.read_word_32(addr)?;
rval = core.read_word_32(addr.into())?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably implement read_word_64 too. The default implementation just calls this function twice.

humility-core/src/core/probe.rs Outdated Show resolved Hide resolved
@beezow beezow requested a review from a team November 29, 2022 04:08
@Edwardong
Copy link
Author

Edwardong commented Nov 29, 2022

Did you test this on actual board? I think we should also verify arm still works.

No I haven't. Will do so tomorrow. I agree we should also verify arm.

I also kind of feel like we should squash these first 3 commits, as they are just changes to work with the updated interface. I think it will not build unless you use the last commit, right?

Correct. They might need to be squashed.

@Edwardong Edwardong changed the base branch from rivos/main to dev/zheren/bump_rust_toolchain_version November 30, 2022 01:17
@Edwardong Edwardong force-pushed the dev/zheren/bump_rust_toolchain_version branch from cb4a1c4 to d88d7fe Compare December 1, 2022 00:59
Base automatically changed from dev/zheren/bump_rust_toolchain_version to rivos/main December 1, 2022 01:20
@Edwardong Edwardong force-pushed the dev/zheren/probe-rs_bump_0.13 branch 3 times, most recently from 3ea5821 to 5fc5daf Compare December 2, 2022 21:38
@Edwardong
Copy link
Author

Bumped to upstream master branch

  • At least one change we need is not released with v0.13.0
  • Upstream's release mechanism is not rigorous and everything on master branch is tested and passed upstream's CI. So instead of using v0.13.0, we will use latest master branch.
  • I think once that change @beezow mentioned gets released (probably with v0.14.0), we may consider switch to use crates.io (so-called) "stable" release.

@Edwardong Edwardong force-pushed the dev/zheren/probe-rs_bump_0.13 branch from 2dcee76 to 8831295 Compare December 2, 2022 22:27
- At least one change we need is not released with v0.13.0. Upstream's
release mechanism is not rigorous and everything on master branch is
tested and passed upstream's CI. So instead of using v0.13.0, we will
use latest master branch.
- updated implementations to reflect latest upstream changes(upstream
did many refactorings)
- rusb and libusb1-sys patch also need to be updated to a newer version
 as latest probe-rs is dependent on newer versions of rusb
- deleted out-of-date comments
@Edwardong Edwardong force-pushed the dev/zheren/probe-rs_bump_0.13 branch from f3f73f3 to 1a7d105 Compare December 2, 2022 22:31
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.

3 participants