Serial Terminals
The Terminal dock is a tabbed container. The first tab is the interactive TEMU command terminal described in TEMU CLI Terminal, and every serial console the emulator exports gets its own tab beside it.
A serial tab is a real terminal for the target: bytes received on the console are displayed, and everything you type is sent to the target UART. This is the usual way to interact with flight software that expects a serial console, such as an RTEMS or Linux shell.
Exporting Serial Consoles from TEMU
Serial tabs come from the emulator, not from the debugger, so the console must be exported over TCF before a tab can appear.
When the TCF server starts, it automatically exports every connected serial console on the board. No extra command is needed for a standard board configuration:
TCFServer.new name=tcfServer
tcfServer.contextManager = cm0
tcfServer.start-server port=9000
Use add-serial-stream only when you want to override the name a console is
exported under, or to export a console variant that is not picked up
automatically:
tcfServer.add-serial-stream obj=board0-tty id=console0
Consoles that are created later, for example when a component is added at runtime, are exported as they appear.
Terminal Tabs
-
A tab is created as soon as the debugger learns about the console, and is named after the console context, for example Serial board0-tty.
-
A new tab is brought to the front and given keyboard focus, so you can type into it immediately.
-
When a console is removed on the target, or the debugger disconnects, the matching tab closes. Reconnecting recreates the tabs.
-
Switching to a tab returns keyboard focus to the terminal.
If no serial tab appears, the console was never exported.
Check that start-server ran before the software started, and look for
add-serial-stream errors in the emulator log.
|
Typing into the Target
The terminal does not echo locally by default. Characters appear only when the target echoes them back, just like a real serial line behaves.
- Enter
-
Sends the configured enter sequence,
CRby default. - Backspace
-
Sends
DEL. - Ctrl+A to Ctrl+Z
-
Send the matching control characters, so shell and editor shortcuts such as Ctrl+C reach the target.
- Arrow keys, Home, End, Page Up, Page Down, Delete
-
Send the usual terminal escape sequences.
- Tab and Esc
-
Are forwarded to the target rather than handled by the GUI.
Pasting with Ctrl+V sends the clipboard text to the target as if it had been typed. Key combinations that use both Ctrl and Shift are not sent to the target, so they remain available for local actions such as copying the selected output.
Terminal Options
Right-click inside a serial terminal to open its menu. Along with the standard text actions, it provides:
- Clear terminal
-
Empties the display. The target is not affected.
- Local echo
-
Also shows the characters you type. Turn this on for consoles that do not echo, and off again if you see every character twice.
- Enter key sequence
-
Selects what Enter sends:
CR (\r),LF (\n), orCRLF (\r\n). - Terminal formatting
-
Selects how escape sequences in the output are interpreted: TEMU colours, xterm, or VT100. A change applies to output received from then on, exactly as a real terminal reacts to a mode change.
These options are remembered between sessions.
Reading the Output
-
Color and formatting escapes sent by the target are rendered instead of being printed as raw escape codes.
-
The view follows the newest output. Scroll up to read back through the history, and scroll to the bottom to resume following.
-
[stream closed]is printed when the console goes away on the target. -
[serial error: …]is printed inline when a read or write fails, so problems are visible in the terminal rather than only in the logs.
Troubleshooting
- Nothing is displayed
-
Confirm the software actually writes to that console, and check that the board’s UART is connected to the console object in the system configuration.
- Every character appears twice
-
The target echoes and Local echo is on. Turn Local echo off.
- The target ignores Enter
-
The console expects a different line ending. Try
LForCRLFunder Enter key sequence. - Output looks garbled
-
Try a different mode under Terminal formatting.