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

Add support for SEGGER RTT STDIO (updated) #1411

Merged
merged 4 commits into from
Jul 21, 2024

Conversation

adfernandes
Copy link
Contributor

Supersedes #775, fixes #774 (ping @kilograham, @anaoum)

  • Segger's RTT is now included as a submodule

  • RTT is enabled via pico_enable_stdio_rtt(${TARGET_NAME} 1)

    • cr/lf conversion is supported via PICO_STDIO_RTT_DEFAULT_CRLF
    • a pico_stdio_test_rtt target was added to the test suite

Note the strange #include "../../../lib/rtt/RTT/SEGGER_RTT.c" in segger_rtt.c.

I did this because, as documented in the source file, cmake will not let us change the COMPILE_OPTIONS for a single source file if the target has one source file in the current directory tree and another source file in a directory outside the current directory tree.

Sadly, SEGGER_RTT.c produces warnings that are treated as errors, and without this fanciness, RTT will not compile with arm-gnu-toolchain-12.2.mpacbti-rel1.

@kilograham kilograham added this to the 1.6.0 milestone Jun 5, 2023
@kilograham
Copy link
Contributor

This is probably going to annoy you, but perhaps I'm leaning back towards not using a sub module. I think my main objection before was that we had copied an entire repo, however I think that you are only using SEGGER_RTT.c and SEGGER_RTT.h(and possibly a config header)... it is probably simpler to just copy these files into the same directory.

@adfernandes
Copy link
Contributor Author

Actually, I agree with you about getting rid of the submodule! 😆

Normally, with RTT, you need to include the libc intercepts and overrides for printf and puts and all that.

But the pico has it's own layered stdio implementation, so it just might be that SEGGER_RTT.c is all we need...

Let me check and test.

If it's just the source and few includes, I'll copy them in with a note of the revision.

That will allow me to get rid of the #include "...c" ugliness because I will be able to properly set the compile options.

Let me look into it tonight / tomorrow.

@kilograham kilograham modified the milestones: 1.6.0, 1.5.2 Jun 14, 2023
@kilograham kilograham self-assigned this Jul 19, 2024
kilograham
kilograham previously approved these changes Jul 21, 2024
@kilograham kilograham merged commit 0996a9e into raspberrypi:develop Jul 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants