Comments (9)
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:
- Check the ELF for the
SEGGER_RTT
symbol. - If it's not there, scan the live chip memory if we can maybe find the RTT header.
We could make step 2 optional. Or we deprecate it alltogether in probe-rs run
.
from probe-rs.
It looks to me that probe-rs doesn't check whether there are symbols but _SEGGER_RTT is absent as a signal that it should not scan the memory.
That is correct.
Yes that would be the behavior of probe-run as far as I understand.
Yup.
What do you mean by "patch this in the RTT code"?
I mean in the rtt
module in probe-rs we could add this :)
Yes, I don't mind setting a flag to only rely on the debug symbols
I would make it so it needs to flag for the additional memory scan and otherwise just scans the ELF.
from probe-rs.
probe-rs run
checks the binary just like probe-run
. The only difference is that we scan the memory for 10 seconds if we can't find the SEGGER_RTT
block because that's a valid usecase of RTT
in the original standard, if you do not have any debug symbols.
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.
from probe-rs.
probe-rs run
checks the binary just likeprobe-run
.
What is checked exactly? probe-run
checks the ELF, not the runtime memory.
I think most people have ELF debug info if RTT is enabled.
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 _SEGGER_RTT
symbol in the ELF like probe-run
does, but I don't need this and would be fine if it's not implemented.
from probe-rs.
Oh I see, so the only difference is that probe-run
checks for _SEGGER_RTT
which is what defmt
produces, while probe-rs
checks for SEGGER_RTT
. I see a few options to solve my problem then:
- Make
defmt-rtt
produceSEGGER_RTT
(either in addition to or instead of_SEGGER_RTT
) based on a feature to preserve backward compatibility. - Make
probe-rs
also check for_SEGGER_RTT
in additional toSEGGER_RTT
, possibly gated by a feature but this doesn't seem necessary. - Make
probe-rs
skip step 2 either based on a flag and/or based on whether the presence of debugging symbols in the ELF.
from probe-rs.
Sorry, I was imprecise in my answer, the header symbol value in memory is SEGGER_RTT
, the DWARF symbol in the ELF is _SEGGER_RTT
. You can find the code here.
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.
from probe-rs.
I see, indeed only (3) is an option.
I tried generating debug symbols but same issue. It looks to me that probe-rs
doesn't check whether there are symbols but _SEGGER_RTT
is absent as a signal that it should not scan the memory.
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.
Yes that would be the behavior of probe-run
as far as I understand. What do you mean by "patch this in the RTT code"?
But maybe the flag would actually be a great choice so people that want to run without the debug info can still use it.
Yes, I don't mind setting a flag to only rely on the debug symbols (my probe-rs
command line is generated anyway so it has no cost on my side and will always be set). I never want to scan the memory, I always set the symbol when I use RTT.
from probe-rs.
Perfect, thanks a lot!
from probe-rs.
YW!
from probe-rs.
Related Issues (20)
- Unable to read peripheral memory with GDB HOT 1
- Add support for Microchip SAM L10/L11 HOT 2
- Run from Ram HOT 1
- Flashing an STM32 target with JLink probe on Linux (Arch) fails unless `--disable-double-buffering` is used
- Please support more platforms for the pre-built binaries HOT 12
- Should we move LPC55 sequences into nxp_armv8m? HOT 1
- Unable to detect probe for RP2040 HOT 3
- Runner in VSCode behaves strangely HOT 4
- Tracking issue for unwind testing in the `debug/debuginfo.rs` module. HOT 2
- Strange RTT issues on ESP32C3 when using embassy HOT 9
- rtt upstream not working HOT 2
- Allow embedding metadata in elf's to pick the right probe (similar to teleprobe-meta).
- compile error on arm regarding `view_bits` in `probe-rs/src/probe/arm_jtag.rs` HOT 3
- Cortex-M55 and Cortex-M85 target-gen support HOT 4
- Failed to verify flash algorithm on esp32c3 with esp-idf std telf file. HOT 1
- Picoprobe not detected HOT 2
- MIMXRT1170-EVKB | MCU-LINK | no code execution HOT 4
- How to attach and read some registers without knowing the exact chip model HOT 4
- Xtensa architecture tracking issue HOT 1
- flash fail on esp32-c3 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from probe-rs.