Tiny little tools to interact with U-Boot via the serial console
Project description
ubtools
Tiny little tools to interact with U-Boot via the serial console
Also included is a simple yet robust Python 3.11 library to talk to U-Boot.
Usage
To install the tools:
pipx install ubtools
To run without installing:
cd src
python -m ubtools.cli.COMMAND ...
To build and test:
./build
./run-tests
pipx install -e .
Configuration
Defaults are loaded from the serial section of ~/.config/ubtools/config.toml, if present:
[serial]
port = "/dev/ttyUSB0"
baud = 115200
timeout = 0.1
mode = "exclusive"
#prompt = "U-Boot #"
Environment variables of the form UBTOOLS_* (UBTOOLS_PORT, etc.) can override those values.
Commands
| Command | Description |
|---|---|
| ubint | Interrupt U-Boot autoboot via the serial console |
| ubcmd | Send a command to U-Boot via the serial console and print the output |
| ubread | Read from U-Boot memory via the serial console |
| ubwrite | Write to U-Boot memory via the serial console |
ubint
Interrupt U-Boot autoboot via the serial console
usage: ubint [-i] [-q] [-r] [-s STR] [-p PORT] [-b BAUD] [--timeout SECONDS]
[--mode {shared,exclusive,none}] [--prompt PROMPT] [-h]
[--version]
Interrupt U-Boot autoboot via the serial console
options:
-i, --bdinfo query board info
-q, --quiet do not show progress
-r, --reset send reset command first
-s STR, --string STR interrupt using custom string
-p PORT, --port PORT serial port device
-b BAUD, --baud BAUD serial port baud rate
--timeout SECONDS serial port receive timeout
--mode {shared,exclusive,none}
serial port locking mode
--prompt PROMPT specify expected prompt
-h, --help show help message and exit
--version show version number and exit
ubcmd
Send a command to U-Boot via the serial console and print the output
usage: ubcmd [-n | -q] [-p PORT] [-b BAUD] [--timeout SECONDS]
[--mode {shared,exclusive,none}] [--prompt PROMPT] [-h]
[--version]
COMMAND ...
Send a command to U-Boot via the serial console and print the output
positional arguments:
COMMAND command to send
ARGS arguments
options:
-n, --no-reply do not retrieve output nor exit code
-q, --quiet do not show non-zero exit code
-p PORT, --port PORT serial port device
-b BAUD, --baud BAUD serial port baud rate
--timeout SECONDS serial port receive timeout
--mode {shared,exclusive,none}
serial port locking mode
--prompt PROMPT specify expected prompt
-h, --help show help message and exit
--version show version number and exit
ubread
Read from U-Boot memory via the serial console
usage: ubread [-q] [-w BITS] [-p PORT] [-b BAUD] [--timeout SECONDS]
[--mode {shared,exclusive,none}] [--prompt PROMPT] [-h]
[--version]
FILE ADDRESS LENGTH
Read from U-Boot memory via the serial console
positional arguments:
FILE Output file (use '-' for stdout)
ADDRESS memory address (decimal or hex)
LENGTH number of bytes (decimal or hex)
options:
-q, --quiet do not show progress
-w BITS, --word BITS use reads of specified bit width
-p PORT, --port PORT serial port device
-b BAUD, --baud BAUD serial port baud rate
--timeout SECONDS serial port receive timeout
--mode {shared,exclusive,none}
serial port locking mode
--prompt PROMPT specify expected prompt
-h, --help show help message and exit
--version show version number and exit
ubwrite
Write to U-Boot memory via the serial console
usage: ubwrite [-q] [-w BITS] [-p PORT] [-b BAUD] [--timeout SECONDS]
[--mode {shared,exclusive,none}] [--prompt PROMPT] [-h]
[--version]
FILE ADDRESS
Write to U-Boot memory via the serial console
positional arguments:
FILE input file (use '-' for stdin)
ADDRESS memory address (decimal or hex)
options:
-q, --quiet do not show progress
-w BITS, --word BITS use writes of specified bit width
-p PORT, --port PORT serial port device
-b BAUD, --baud BAUD serial port baud rate
--timeout SECONDS serial port receive timeout
--mode {shared,exclusive,none}
serial port locking mode
--prompt PROMPT specify expected prompt
-h, --help show help message and exit
--version show version number and exit
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ubtools-0.2.2.tar.gz.
File metadata
- Download URL: ubtools-0.2.2.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dd7333da5594542ae3cec2898b4130d03f94eb88026512b18f1686a6543f1e9
|
|
| MD5 |
72b3adee759660303ae3717622d6679b
|
|
| BLAKE2b-256 |
123c49661919a7461cd54ede6172d2136a4e3d7e11ef592e860b0c01a7a87bd8
|
Provenance
The following attestation bundles were made for ubtools-0.2.2.tar.gz:
Publisher:
publish.yml on Lanchon/ubtools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ubtools-0.2.2.tar.gz -
Subject digest:
8dd7333da5594542ae3cec2898b4130d03f94eb88026512b18f1686a6543f1e9 - Sigstore transparency entry: 1409306483
- Sigstore integration time:
-
Permalink:
Lanchon/ubtools@a28cef719c136656fa92e2364762a1def3f44a55 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/Lanchon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a28cef719c136656fa92e2364762a1def3f44a55 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ubtools-0.2.2-py3-none-any.whl.
File metadata
- Download URL: ubtools-0.2.2-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58eeaa5f76183314cc5e07df71041e6c72698bfcdc8a615baa29ada248fea141
|
|
| MD5 |
348301f205bfd0a09abf06092349914f
|
|
| BLAKE2b-256 |
a96ad69e1a0ba66066634eb98571bbf8124672bcd34b9fa05aeec4f4453fd482
|
Provenance
The following attestation bundles were made for ubtools-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on Lanchon/ubtools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ubtools-0.2.2-py3-none-any.whl -
Subject digest:
58eeaa5f76183314cc5e07df71041e6c72698bfcdc8a615baa29ada248fea141 - Sigstore transparency entry: 1409306488
- Sigstore integration time:
-
Permalink:
Lanchon/ubtools@a28cef719c136656fa92e2364762a1def3f44a55 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/Lanchon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a28cef719c136656fa92e2364762a1def3f44a55 -
Trigger Event:
push
-
Statement type: