Skip to content
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

Separate out the SEGGER RTT\0\0\0 header from the rtt block #776

Open
thejpster opened this issue Sep 19, 2023 · 2 comments
Open

Separate out the SEGGER RTT\0\0\0 header from the rtt block #776

thejpster opened this issue Sep 19, 2023 · 2 comments
Labels
type: bug Something isn't working

Comments

@thejpster
Copy link

There is a small risk that the probe will inspect RAM whilst we are in the middle of copying from Flash to RAM, and it might see the SEGGER RTT header but then see invalid pointers.

So we should initialise with the header set to something other than SEGGER RTT and paint in those few bytes manually after the fact.

But also we should probably wait for probe-rs/probe-rs#1722 to land because making the RTT block valid later on in the boot cycle will increase the chance of it failing to find the block on the first pass.

@Urhengulas Urhengulas added the type: bug Something isn't working label Sep 19, 2023
@bugadani
Copy link

bugadani commented Apr 3, 2024

There is a small risk that the probe will inspect RAM whilst we are in the middle of copying from Flash to RAM

Interestingly, with certain ESP32 MCUs this is hit pretty often, causing probe-rs to print errors. Additionally, if defmt is used in firmware that is running from RAM, probe-rs may incorrectly detect the wrong magic string as the control block, completely breaking RTT.

For maximum compatibility, I'd suggest making sure the magic string is not present verbatim in the binary, and that it is written to the control block last. The official implementation contains the string backwards, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants