Closed astraw closed 2 years ago
I also tried with the swd-protocol
branch of probe-run installed from git and observed the same behavior.
I'm working with a Nucleo-H745ZI-Q board and the same versions of these libraries on a Linux host, and am seeing the same behavior.
Looking at the output of probe-run -vv
in the original working case, I see Jtag is being used, there, too, so this is not the problem. I updated this aspect of my original comment.
With a bit more digging, the Operation timed out
error is coming from core.wait_for_core_halted(Duration::from_secs(5))?;
in fn set_rtt_to_blocking
after setting a hardware breakpoint and running. So it seems something with stm32h7xx-hal
version 0.11.0 or cortex-m-rt
0.7.1 changed behavior in a relevant way here.
So testing stm32h7xx-hal 0.11.0 with cortex-m-rt 0.6.15 shows this combination works fine. I think the culprit is thus cortex-m-rt 0.7 and I opened the issue https://github.com/rust-embedded/cortex-m/issues/426.
With a bit more digging, the
Operation timed out
error is coming fromcore.wait_for_core_halted(Duration::from_secs(5))?;
infn set_rtt_to_blocking
after setting a hardware breakpoint and running. So it seems something withstm32h7xx-hal
version 0.11.0 orcortex-m-rt
0.7.1 changed behavior in a relevant way here.
If we look at the lines you identified as the error location, it seems that the core never reaches the main_fn_address
and therefore times out. So probably something in how we calculate the main_fn_address
is wrong when using cortex-m-rt 0.7
.
From skimming the cortex-m-rt changelog the only change which mentions the main fn is https://github.com/rust-embedded/cortex-m-rt/pull/278, "Mark main() with a C ABI", but I don't know if this could trigger this error.
As mentioned in the new issue I opened https://github.com/rust-embedded/cortex-m/issues/426, I identified the first problematic commit https://github.com/rust-embedded/cortex-m-rt/commit/1fd84a8fc5a02854b561b413fd5c828a2f798e03. This commit changes in the linker script link.x.in
, but this gets out of my experience.
I've posted some details in https://github.com/rust-embedded/cortex-m/issues/426; starting from scratch using https://github.com/knurling-rs/app-template, the latest master
and v0.11.0 release of the HAL work just fine with cortex-m == 0.7.4
and probe-run == {0.2.6, 0.3.3}
.
I think that the issue is something to do with the BSP crates; or perhaps we needed to update memory.x
(which is copied into the project from the HAL crate) when updating the HAL crate. In any event, it doesn't seem to be a problem with probe-run
.
Thanks @kellyk. Indeed this is no bug in probe-run and I have fixed the nucleo-h743zi
to use the latest cortex-m-rt (0.7.1) and confirm this works with probe-run. Closing the issue here. Further discussion should be at https://github.com/rust-embedded/cortex-m/issues/426.
Thanks everyone for investigating this issue!
Describe the bug I am working on the
knurling
branch of rust examples for the nucleo-h743zi and nucleo-h743zi2 boards (direct link toknurling
branch). I updated the nucleo code to take advantage ofdefmt
andpanic-probe
and flashed an ran all this withprobe-run
and all worked great with the onboard STLINKv3 on my nucleo-h743zi2. Then I updated the Cargo.toml to usestm32h7xx-hal
0.11.0 (from 0.10.0) andcortex-m-rt
0.7.1 (from 0.6.15) andprobe-run
(0.3.3) now fails withError: An error with the usage of the probe occured
after reporting flashing the device successfully. Running with probe-run with-vv
indicates that probe-run is wrongly choosing JTAG instead of SWD in this case.There are the final lines before exit from the
probe-run -vv
:It seems with the older dependencies, probe-run correctly uses SWD but with the updated dependencies, it attempts to incorrectly use JTAG.Update 2022-04-02: in the working case I also seeCurrent device mode: Jtag
in the output, indicating that JTag is indeed used in the original working scenario.Also, it seems possible that the bug is not with
probe-run
but with one of these other crates.To Reproduce Steps to reproduce the behavior:
Install probe-run 0.3.3.
First observe error-free behavior:
Then update
Cargo.toml
to usestm32h7xx-hal
0.11.0 andcortex-m-rt
0.7.1. (This also updates thestm32h7
dependency from 0.13.0 to 0.14.0.) Re-runcargo run --release --bin blinky
. Observe that probe run fails withError: An error with the usage of the probe occured
.Expected and observed behavior I expected that probe-run would run without error. I observed the error mentioned above.
Probe details
Operating System: Windows