Skip to main content

Reset a board with DTR and RTS from the CLI

Many boards reset or enter their bootloader through the modem-control lines of a USB-serial adapter. Use mimick uart to drive those lines from your terminal or from a runbook, and to change the port's baud rate and framing without a restart.

What you need​

  • Operator access to the bench
  • A serial port (linux-tty) with a uart interface, wired to your DUT
  • An active bench (mimick bench use <your-bench>)

Find the uart location with mimick peripheral list. It ends in .uart0.

Read the lines​

mimick uart <location> lines

The output lists DTR and RTS, the two outputs, and CTS, DSR, RI, and DCD, the four inputs. A line is asserted when it is driven active and released otherwise. Add --format json to get the same state as JSON for scripts.

DTR and RTS show what the bench last set. A port starts with both asserted unless its peripheral config sets initial_dtr and initial_rts.

Set a line​

mimick uart <location> lines --dtr on --rts off

on asserts a line and off releases it. A line you leave out stays as it is.

Pulse a line​

A reset pulse is short, and the network between you and the bench adds delay that varies from call to call. Pass the whole sequence with --seq and the bench runs it on its own clock:

mimick uart <location> lines --seq "dtr=1,rts=1:10ms,rts=0"

Steps are separated by commas. A step sets dtr, rts, or both joined with +, and an optional : and a duration says how long to wait before the next step. The example asserts DTR, asserts RTS for 10 ms, then releases RTS.

LimitValue
Steps64
Total hold time30 seconds
Hold resolutionWhole milliseconds, such as 10ms

A sequence over a limit is rejected before any line changes.

Send a break​

mimick uart <location> break --duration 250ms

The transmit line is held in break for the duration, up to 10 seconds, and then released.

Change the line settings​

mimick uart <location> config
mimick uart <location> config --baud 115200 --parity even --stop-bits 1

With no flags, the command prints the current settings. With flags, it changes the ones you name on the open port, and prints the result. The change lasts until the bench reopens the port, for example after a replug or a new peripheral config, and then the port goes back to its configured settings.

In a runbook​

Runbooks have the mimick CLI. A script that puts a board in its bootloader and speaks to it looks like this:

mimick uart bootloader.uart0 lines --seq "dtr=1,rts=1:10ms,rts=0"
mimick uart bootloader.uart0 config --parity even

If a command fails​

What you seeWhat to do
this peripheral does not support ...The port's driver can't drive control lines or change settings on an open port.
RTS is reserved while flow_control is hardwareSet flow_control to none in the peripheral config, or drive DTR only.
the Station does not know how to ...The Station runs an older release. Update it, then try again.
the bench "<name>" is offlineCheck that the bench has power and a network connection.
A permission errorAsk your org admin for the Operator grant on the bench.