https://github.com/ucb-bar/tsi
Standalone tethered serial interface (TSI) implementation with CLI utilities.
https://github.com/ucb-bar/tsi
Last synced: 3 months ago
JSON representation
Standalone tethered serial interface (TSI) implementation with CLI utilities.
- Host: GitHub
- URL: https://github.com/ucb-bar/tsi
- Owner: ucb-bar
- Created: 2024-02-09T19:49:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-26T04:04:32.000Z (about 1 year ago)
- Last Synced: 2025-02-03T08:44:54.400Z (4 months ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 1
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TSI
A standalone implementation of the Tethered Serial Interface (TSI).
TSI involves sending chunks of 32 bits. An operation typically looks like this:
```
| CMD | ADDR % 32 | ADDR >> 32 | LEN % 32 | LEN >> 32 | DATA CHUNK 1 | DATA CHUNK 2 | ... |
```## Usage
```
Usage: uarttsi --tty --baudCommands:
read Help message for read
write Help message for write
help Print this message or the help of the given subcommand(s)Options:
-t, --tty
-b, --baud
-h, --help Print help
-V, --version Print version
```## Testing
To build the debug binary, run `cargo build`. The binary will be located in `target/debug/uarttsi`.
To create a pseudo-TTY for testing purposes, run the following:
```
socat -d -d pty,raw,echo=0 pty,raw,echo=0
```Then, use `utils/read_tty_raw.py` to listen on one of the created pseudo-TTYs by modifying the `fp_out`
variable:```
fp_out = open("/dev/ttys011", "rb")
```Then, run the script using python:
```
python3 read_tty_raw.py
```When you write to the other pseudo-TTY, the raw bytes should show up in the terminal where you ran the
Python scripts.On Mac OS, you will need to specify a baud rate of zero when reading/writing pseudo-TTYs:
```
./target/debug/uarttsi -t /dev/ttys011 -b 0 write 0x1000 deadbeef
```## Design
Default baud rate is 115200.
### Read commands
Takes in an address as a mandatory position argument. Can output read data as raw bytes or hex display.
Length provided as optional flag, default is 4.### Write commands
Takes in an address as a mandatory position argument. Can take data as hex or decimal using same strategy as address.
Length provided as mandatory flag.### Write binary command
Takes in an address and file as a mandatory position argument. Option to reset core and start executing.
### Things to debug
- Why does FPGA get reset
- Why does FPGA not work on lab computer