-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
Do not try to attach to RTT if the elf doesn't advertise using RTT #1865
Comments
This was broken by #246 because `probe-rs` doesn't consider normal breakpoints as semi-hosting exit command. Note that `./scripts/hwci.sh nordic` is currently slow with `--release` because of probe-rs/probe-rs#1865
I am happy to change this behavior or at least enable this only via a flag, because I think most people have ELF debug info if RTT is enabled. |
What is checked exactly?
Exactly, so it would make sense to not try to connect to RTT if the ELF doesn't have debug symbols. That would be a first simple check. This check could be further improved by checking for an |
We check the ELF symbols :) That's something we did long before probe-run. We are just compatible with the Segger RTT standard while they went a more opinionated route. How our RTT impl goes about this is like so:
We could make step 2 optional. Or we deprecate it alltogether in |
Oh I see, so the only difference is that
|
Sorry, I was imprecise in my answer, the header symbol value in memory is probe-rs/target-gen/src/parser.rs Line 95 in 50a89a7
The only real fix here is 3. Because you compile in release mode - seemingly without debug symbols (you could ofc. generate them :)) - we cannot find the symbol and we start looking in RAM. Which doesn't have the header either (because you don't initialize it in release?) or it cannot find it within 10 secs. Dependent on memory size and where you start the scan this will take forever to find :D Maybe we should just patch this in the RTT code so there is a connect function that does not perform the scan if no symbol is found and use this. But maybe the flag would actually be a great choice so people that want to run without the debug info can still use it. |
I see, indeed only (3) is an option. I tried generating debug symbols but same issue. It looks to me that
Yes that would be the behavior of
Yes, I don't mind setting a flag to only rely on the debug symbols (my |
That is correct.
Yup.
I mean in the
I would make it so it needs to flag for the additional memory scan and otherwise just scans the ELF. |
Perfect, thanks a lot! |
YW! |
This was broken by google#246 because `probe-rs` doesn't consider normal breakpoints as semi-hosting exit command. Note that `./scripts/hwci.sh nordic` is currently slow with `--release` because of probe-rs/probe-rs#1865
This changes the default of scanning to not scanning. This should hopefully not impact many users since most tools define a `_SEGGER_RTT` symbol in the ELF, in which case only that particular address is checked. Fixes probe-rs#1865
This changes the default of scanning to not scanning. This should hopefully not impact many users since most tools define a `_SEGGER_RTT` symbol in the ELF, in which case only that particular address is checked. Fixes probe-rs#1865
Is your feature request related to a problem? Please describe.
As described in more details in #1863, if I compile my program without
defmt-rtt
thenprobe-rs
will try for an excessively long time to connect to the RTT, whileprobe-run
used to check the binary to see if it was compiled with RTT support.Describe the solution you'd like
I'd like
probe-rs
to also check the binary to guess whether RTT should be used or not (and when not, just look until the device halts, e.g. with a semi-hosting command).Describe alternatives you've considered
I've considered using
defmt-rtt
for my production binaries, but I don't like that too much.The text was updated successfully, but these errors were encountered: