Last edited 2 months ago

How to transfer a file over serial console

Applicable for STM32MP13x lines, STM32MP15x lines, STM32MP25x lines

1. Purpose[edit source]

The article provides information that is useful when starting with ckermit.

2. Introduction[edit source]

C-Kermit is a combined network and serial communication software package offering a consistent, transport-independent, cross-platform approach to: connection establishment, terminal sessions, file transfer, file management, character-set translation, numeric and alphanumeric paging, automation of file transfer and management, dialogs, and communication tasks through its built-in scripting language.

In this article, we focus only on file-transfer between a host PC and an STMicroelectronics board via a serial console.

3. Installation on your target[edit source]

Kermit is installed on the STMicroelectronics images via the ckermit package

4. Installation on your PC[edit source]

The ckermit package MUST be installed on your PC to perform file tranfers via a serial console

On ubuntu

 sudo apt-get install ckermit
Info white.png Information
Depending of Linux Distibution and Distribution version, ckermit tools can be not present. Please in this case search the solution on Linux forum, search engine to find a solution adapted to your setup

5. Getting started[edit source]

  • generate a configuration file for kermit

Content of kermit_ttyACM0.cfg

set line /dev/ttyACM0
set speed 115200
set carrier-watch off
set flow-control none
set prefixing all
set parity none
set stop-bits 1
set modem none
Info white.png Information
ttyACM0 corresponds to the serial port on Linux connected to the board. It can vary depending on the type of serial connection (ttyS0, ttyUSB0,...
  • Download a file from a board to your PC:

Get the file /etc/hosts from the board:

 kermit kermit_ttyACM0.cfg -g /etc/hosts
  • Upload a file from your PC to a board:

Put the local file myfile.txt on the board at specific location: /home/root/

 kermit kermit_ttyACM0.cfg -s myfile.txt
Info white.png Information
To close the kermit session properly, don't forget to send the following command:
 kermit kermit_ttyACM0.cfg -f

6. Tips[edit source]

  • Serial port already in use

If you encounter this kind of message (or if the command line is stuck, and displays random characters)

 kermit kermit_ttyACM0.cfg -s /etc/hosts
Locked by process 24320
can't open device

Please kill/close the serial console application (generaly Minicom on Linux)