probe-rs: Arm FaultResponse
Describe the bug Since 9eb1c2f, I’m unable to enumerate my CMSIS-DAP based probe with the nRF9160
The error:
thread 'main' panicked at modem_updater/src/lib.rs:373:44:
called `Result::unwrap()` on an `Err` value: Arm(AccessPort { address: FullyQualifiedApAddress { dp: Default, ap: V1(0) }, source: RegisterRead { address: 12, name: "DRW", source: Dap(FaultResponse) } })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
To Reproduce
This snippet is the failure point:
fn setup_device(&mut self) {
let mut target = self.session.core(0).unwrap();
// Init UICR.HFXOSR if necessary
if target.read_word_32(0x00FF801C).unwrap() == 0xFFFFFFFF {
log::info!("UICR.HFXOSR is not set, setting it to 0x0E");
target.write_32(0x00FF801C, &[0x0000000E]).unwrap();
}
The read in particular causes the exception.
I can also simply reproduce it by running probe-rs download --chip nRF9160_xxAA --binary-format hex ../_bin/v5-2-ga33aa1f-fast-blink.hex --allow-erase-all See full output below.
Expected behavior
To read and write to registers without access issues.
Stacktrace
modem_updater on main [$!?⇡] is 📦 v0.1.0 via 🦀 v1.80.0
❯ probe-rs download --chip nRF9160_xxAA --binary-format hex ../_bin/v5-2-ga33aa1f-fast-blink.hex --allow-erase-all
INFO probe_rs::config::target: Using sequence Arm(Nrf9160(()))
INFO attach: probe_rs::probe::cmsisdap: Using protocol SWD
INFO probe_rs::architecture::arm::sequences: Debug port Default is powered down, powering up
INFO probe_rs::vendor::nordicsemi::sequences::nrf: Checking if core 0 is unlocked
INFO probe_rs::vendor::nordicsemi::sequences::nrf: Core 0 is already unlocked
INFO probe_rs::session: Core status: Running
INFO probe_rs::session: Halting core...
INFO probe_rs::session: Resuming core...
INFO probe_rs::flashing::flash_algorithm: Chosen RAM to run the algo: RamRegion { name: None, range: 20000000..20040000, cores: ["main"], access: None } INFO probe_rs::flashing::flash_algorithm: Data will be loaded to: RamRegion { name: None, range: 20000000..20040000, cores: ["main"], access: None } INFO probe_rs::flashing::flash_algorithm: The flash algorithm will be configured with 512 bytes of stack INFO probe_rs::flashing::flash_algorithm: Stack top: 0x20002778 INFO probe_rs::flashing::flash_algorithm: Chosen RAM to run the algo: RamRegion { name: None, range: 20000000..20040000, cores: ["main"], access: None }
INFO probe_rs::flashing::flash_algorithm: Data will be loaded to: RamRegion { name: None, range: 20000000..20040000, cores: ["main"], access: None }
INFO probe_rs::flashing::flash_algorithm: The flash algorithm will be configured with 512 bytes of stack
INFO probe_rs::flashing::flash_algorithm: Stack top: 0x20002778
INFO session_drop: probe_rs::session: Core status: Halted(Exception) INFO probe_rs::architecture::arm::sequences: Powering down debug port Default INFO probe_rs::architecture::arm::sequences: Powering down debug port Default Error: The flashing procedure failed for '../_bin/v5-2-ga33aa1f-fast-blink.hex'.
Caused by:
0: Something during the interaction with the core went wrong
1: An ARM specific error occurred.
2: Error using access port FullyQualifiedApAddress { dp: Default, ap: V1(0) }.
3: Failed to write register DRW at address 0x0c
4: The debug probe encountered an error.
5: An error which is specific to the debug probe in use occurred.
6: CMSIS-DAP responded with an error
Desktop (please complete the following information):
PopOS 22.04
Edit: also tried it on Mac (Intel) (OSX 12.7.5) with the same result.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 32 (32 by maintainers)
Commits related to this issue
- arm: Set DbgSwEnable and some other flags on AP init. This was present in the CSW::new method and got lost in the last refactor in 9eb1c2f. Fixes #2788 — committed to ithinuel/probe-rs by ithinuel 2 years ago
- arm: Set DbgSwEnable and some other flags on AP init. This was present in the CSW::new method and got lost in the last refactor in 9eb1c2f. Fixes #2788 — committed to ithinuel/probe-rs by ithinuel 2 years ago
- arm: Set DbgSwEnable and some other flags on AP init. This was present in the CSW::new method and got lost in the last refactor in 9eb1c2f. Fixes #2788 — committed to ithinuel/probe-rs by ithinuel 2 years ago
- arm: Set DbgSwEnable and some other flags on AP init. This was present in the CSW::new method and got lost in the last refactor in 9eb1c2f. Fixes #2788 — committed to ithinuel/probe-rs by ithinuel 2 years ago
- probe-rs: arm: memory_ap: Default HNONSEC to !SPIDEN Some MCUs appear to have HNONSEC set to non-privileged mode by default. Because ADIv5 calls for HNONSEC to be privileged (that is, false) by defau... — committed to felipebalbi/probe-rs by felipebalbi 2 years ago
- probe-rs: arm: memory_ap: Default HNONSEC to !SPIDEN Some MCUs appear to have HNONSEC set to non-privileged mode by default. Because ADIv5 calls for HNONSEC to be privileged (that is, false) by defau... — committed to felipebalbi/probe-rs by felipebalbi 2 years ago
- probe-rs: arm: memory_ap: Default HNONSEC to !SPIDEN Some MCUs appear to have HNONSEC set to non-privileged mode by default. Because ADIv5 calls for HNONSEC to be privileged (that is, false) by defau... — committed to felipebalbi/probe-rs by felipebalbi 2 years ago
@jaredwolff & @felipebalbi would you mind testing that PR and let me know if that solves your issue ?
Same here.
trace.log
Yup:
Sorry @ithinuel no dice.
trace.log
You mean a working trace and a failing trace? Sure. I’ll try to get that tomorrow.
I have the same issue with MIMXRT685S. Trace attached. One extra piece of information is that if I reset to the commit right before 9eb1c2fe3ae5c836136ea3fc5ff39f5651b976ad to get a working run, then reset back to 9eb1c2fe3ae5c836136ea3fc5ff39f5651b976ad and run again without power cycling the board, then the “offending” commit works fine. As soon as I power cycle the board, it starts to fail again.
trace.log