Bootterm – a developer-friendly serial terminal program

bootterm

There are plenty of terminal programs to access the serial console from minicom or screen to Putty. But Willy Tarreau was not quite happy with those tools, so he decided to write his own: Bootterm.

I was terribly fed up with the current state of serial terminals, which either don’t cope well with errors, or take ages to start, making you lose the first characters, or don’t support non-standard speeds etc. I finally wrote mine to address all that at once, plus support for automatic port detection (the last registered one is the good one by default), waiting for the port to be ready, and also support fixed or timed captures. And a few environment variables make it possible not to type any argument at all yet have the expected behavior. If that’s something of interest to you, you can check it there:

https://github.com/wtarreau/bootterm

It’s still young (no support for automatic speed switching nor macros yet) but pretty usable, and I already switched to it

I happen to have BBC Doctor Who HiFive inventor coding kit connected to my laptop right now, so I gave it a try in Ubuntu 20.04:


Usually, I check the serial interface by running dmesg, right after connecting the device:


Bootterm allows you to list all serial devices connected to your host:


The * in the list means it’s the last connected USB device which in most cases means the serial console you’d want to access. It will be selected by default if you don’t type the device in the command line. That means you don’t need to even check the device use, simply run bt to connect to the board:


Cool! It just works out of the box! No need to check for device, nor baud rate.

You’ve probably found yourselves wanting to check the output from the bootloader, as soon as you connect the device. If you’re using a USB to TTL debug board that’s fine, but if you’re using one of those boards with built-in serial like the HiFive board I’m using now, this normally involves plugging the board to the USB board, finding out the device name, connect to serial, and then rebooting the board. But with bootterm you can simply use the n parameter which stands for “New”:


This will wait for a new USB device, and then automatically connect to the serial console. Let’s try it with the HiFive Inventor board.


This connects automatically to the serial console from the ESP32 module on my board. Pretty neat. But there’s also a serial console for the SiFive Freedom E310 microcontroller which we can access by specifying the device:


If I press the reset button and the board I can get the boot log from the RISC-V MCU:


It’s much easier to use compared to minicom where I’ve had to enter setup mode, type the serial board, select the baud rate and disable hardware flow control before accessing the serial console. Let’s not forget how easy it is to forget the command to exit the program too. But wait… how do we exit bootterm? We are informed about the command each time we start the program:


So it’s not too hard to access the help:


bootterm special characterHopefully, the use of the right-square-bracket ‘]’ will not cause issues with some keyboard layouts. But Willy must have already thought about this potential problem, and provided a method to change the escape character as well…

You can adjust the escape character with bt -exx command with options listed on the table on the right.

The program will use 115,200 bps baud rate by default, but you’ll find an option to change that:


Bootterm could also be used as a serial port detector in conjunction with other scripts, as the following command line report the last connected USB device without  any extraneous strings:


Bootterm C program is still under development, and Willy plans to implement automatic speed switching and macros. He invites anybody to try it out and report issues on Github.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

Radxa Orion O6 Armv9 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
16 Comments
oldest
newest
Boardcon CM3588 Rockchip RK3588 System-on-Module designed for AI and IoT applications