Closed ilmai closed 1 year ago
I'm having the same issue on nRF52. I think it will happen for any firmware that does not have the reset vector in the elf file (i.e. any firmware using a bootloader, softdevice, etc).
I am also facing this issue on the rp2040 with the latest release. Reverting to the previous version, the error goes away.
Facing the same issue on RP2040.
Incidentally, I've worked around the issue in my local install by replacing https://github.com/knurling-rs/probe-run/blob/e6482fb1208ad1f2128d1618f46bf24bd726c5ea/src/main.rs#L486-L490 with:
let reset_size = match reset_symbols.len() {
1 => reset_symbols.remove(0).size() as u32,
_ => 4,
};
Stack unwinding fails after getting to the app entry point, but that doesn't bother me much. I doubt this is how the maintainers would want to address the issue, but it works for me and may be useful to others here.
Same issue here on rp2040
.
Sorry that this problem made it into the release.
Two questions:
Can one of you who faces this issue install probe-run
from the following branch and report what they are seeing? I just added a log statement and made the failure modes more granular.
$ cargo install --git https://github.com/knurling-rs/probe-run --branch debug-391
Is anyone aware of a method to determine the size of the reset handler, if it is not in the symbols? probe-run
obtains the address of the reset handler in another way[^1], but relies on the symbols for the size.
[^1]: We read if from the program counter after a hard-reset
Sure thing, here's the output:
(HOST) INFO success!
(HOST) INFO reset_address=0xef
Error: unable to determine reset handler
On nrf52 with MBR, Softdevice, and bootloader:
(HOST) INFO success!
(HOST) INFO reset_address=0xa81
Error: unable to determine reset handler
I don't think it's possible to determine the size of the reset handler when it's not part of the application code. In my case, the reset handler is in the nRF MBR which then passes control to the bootloader which passes control to the Softdevice before control finally enters the entry point of my application. I don't think you can even assume that the stack is meaningful before reaching the app's entry point (e.g. a bootloader could choose to reset the stack before jumping to the app's entry point since the app is not supposed to ever return).
The current approach is probably fine for a best-effort type solution, but it shouldn't panic on failure.
As a work-around, if you wish to use probe-run on an RP2040, or a nRF chip with the soft-device, or anything else where the boot code isn't visible to probe-run, please use 0.3.6:
cargo install probe-run --version=0.3.6
Describe the bug Since updating to latest probe-run today, I'm getting this error when trying to run my RP2040 code.
To Reproduce Steps to reproduce the behavior:
probe-run --chip RP2040 <path>
Expected and observed behavior Expected probe-run to remain open while printing output from RP2040 as before.
Instead, getting this output:
config.toml The contents of your project's
.cargo/config.toml
fileProbe details
[0]: Picoprobe CMSIS-DAP (VID: 2e8a, PID: 000c, Serial: E6614864D35F8C21, CmsisDap)
Operating System: Linux running under WSL
Additional context Like mentioned above, things worked as expected with the previous version.