Serial Interface

Serial interface settings and transport behavior for Koheron V1 firmware controllers.
Firmware V1 documentation ยท V1.0-rc54-2d701ce

Koheron products currently ship with firmware V0.x by default. Firmware V1 is under active development and is not publicly available yet.

Contact us if you would like early access or want to evaluate V1 firmware on your device.

Koheron V1 firmware is controlled through a UART serial interface. Refer to the product user guide for connector pinout and electrical levels.

Default serial settings

Setting Value
Baud rate 115200
Data bits 8
Parity none
Stop bits 1
Flow control none

The following baud rates are supported:

9600, 19200, 38400, 57600, 115200, 230400, 460800

Use brate to read or set the configured UART baud rate.

>> brate
115200
>> brate 230400
230400
>> save
A1B2

The new baud rate is effective after the next board boot. Use save after changing brate if the new value should be restored at boot.

Prompt and echo

In normal single-controller mode, the controller prints the >> prompt and echoes printable characters as they are received.

>> version
V1.x
>> tboard
25.45
>>

Do not send >>; it is a prompt, not part of the command.

Commands are terminated by CR, LF, or CRLF. Arguments may be separated by spaces, tabs, or commas.

Empty lines redraw the prompt. Backspace removes the previous received character before the line is processed.

Command pacing

For strict request-response ordering, send one complete command line at a time and wait for the response before sending the next command. In normal single-controller mode, the next >> prompt is a useful indication that the previous command has completed.

Do not rely only on prompts in modes where prompts may be suppressed, such as multiplexed UART mode or raw binary transactions. Host software should also parse the expected response for the command it sent.

Multiple short commands may be queued and processed normally while UART receive ring capacity remains available. If commands or bytes arrive faster than the firmware can consume them and the receive ring fills, at least one incoming byte is lost and the firmware reports UART_RX_OVERFLOW.

For line-oriented ASCII commands, a typical host transaction is:

  1. Write the command followed by CR, LF, or CRLF.
  2. Read the command response.
  3. Wait for the expected response and, when prompts are enabled, the next >> prompt.
  4. Send the next command.

Input handling details

Only printable ASCII characters are echoed in single-controller mode. Backspace removes the previous received character and updates the terminal display. Other control characters are not echoed.

CR or LF terminates the command line. CRLF is accepted; host software may send CR, LF, or CRLF.

An empty line redraws the prompt in single-controller mode.

If one command line or raw binary frame exceeds the CLI frame capacity, the firmware reports CMD_FRAME_TOO_LONG. This is distinct from UART_RX_OVERFLOW, which means the UART receive ring filled and at least one incoming byte was lost.

If a non-empty command is not recognized, the firmware reports CMD_UNKNOWN, common error bit 2 with mask 00000004, and prints cmd unknown in single-controller mode.

Numeric command responses are hexadecimal or decimal text depending on the command. Hexadecimal masks may omit leading zeros; for example, an error response of 4 means mask 00000004.

Raw binary commands

Most commands are line-oriented ASCII commands. Some commands include raw binary data or return raw binary frames and must be handled with byte-counted reads or writes.

Command Raw payload behavior
memr memr <page> returns a one-byte-size-prefixed status, page, 32-byte data, and CRC frame.
memw "memw " + HEX_PAGE + 0x20 + DATA[32] + CRC16_LE[2]: 0x20 ends the textual header; the next byte is always raw data, even when it is 0x09 or 0x20. No trailing CR or LF is sent.
% Returns a binary status frame. See Binary Status.
logerr Returns a binary status snapshot associated with the last error.

Do not use terminal line readers for raw byte payloads. Use byte-counted reads and writes. These memory transactions are silent: they have no echo, line ending, prompt, or ASCII error output.

Multiplexed UART mode

When muxon is 1 or 3, prompts and echo are suppressed. In mode 1, every command must start with an address header. Mode 3 also accepts unaddressed commands and is suitable for a GUI on a dedicated point-to-point UART. Do not use mode 3 on a shared UART, because every controller may execute an unaddressed command. Because prompts are suppressed, host software must pace commands by reading and parsing responses rather than waiting for >> alone.

See UART Multiplexing for the addressed command format and recovery commands.