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

Enable RTT-based terminal #164

Open
1 of 7 tasks
henrygab opened this issue Dec 12, 2024 · 0 comments
Open
1 of 7 tasks

Enable RTT-based terminal #164

henrygab opened this issue Dec 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@henrygab
Copy link
Collaborator

henrygab commented Dec 12, 2024

The benefit is that a developer would only need to connect the SWD port (and power), and have:

  1. Debugging
  2. Programming new firmware
  3. Interactive Terminal

All through the single SWD connection.

This is not technically difficult. The firmware already has some basic concept to redirect the USB CDC to a UART. This would extend this concept.

At present, RTT Channel 0 exists and is setup for bi-directional communication, but no code checks for input from the host.

  • Adjust debug_rtt.h so that printf-style macro prints to a per-core buffer, prefixed with a non-zero virtual terminal indicator and ending with a zero virtual terminal indicator. (VT indicator is just byte 0xFF followed by a byte in range 0x00..0x0F to indicate the virtual terminal).
  • Hook the printf() style output to also output via RTT
  • Hook the getc() style input to also accept input from RTT

As an optimization / stretch goal:

  • Format strings once into the per-core buffer, with VTT prefix and postfix
  • Send the formatted string via RTT
  • Overwrite the postfix with NULL
  • Send the formatted string (starting at offset 2) to USB CDC and/or UART (per config)
@henrygab henrygab added the enhancement New feature or request label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant