Docs

UTools-SI104 Docs

Read product documentation, quick starts, and protocol references online.

Overview

UTools-SI104 Product Overview V1.1

USB to 4-channel I2C / single-channel SPI for application development and integration

Document information Value
Document number LM-SI104-OV-001
Revision V1.1
Release date 2026-10-31
Audience Development, test, integration and technical support engineers

1. Product positioning

UTools-SI104 is a USB multi-bus bridge for peripheral register access, board bring-up, automated tests and production fixtures. One USB connection provides four independent I2C interfaces and one SPI interface, with C++, Python and Rust SDKs and Linux I2C/SPI kernel drivers.

Windows and Linux applications can use the same direct USB interface. Linux systems can alternatively integrate through the standard I2C/SPI subsystems. Only one access path may own a given USB interface at a time.

2. Key capabilities

Item Capability
USB VID 0x34B7 / PID 0xE481; Vendor Bulk; automatic Windows WinUSB binding
I2C Four channels; master or slave; common rates of 100 kHz, 400 kHz and 1 MHz
I2C slave Raw, mailbox and register modes; register mirror and event queries
SPI One channel; modes 0-3; MSB/LSB bit order; common 8/16/32-bit words
SPI master clock Accepted settings: 50 kHz-40 MHz; actual frequency is divider-quantized
Long TX transaction Up to 1024 complete words at 8/16/32 bits: 1024/2048/4096 bytes
Chip select Active-low or active-high in master single-I/O mode; one CS cycle per long TX
Connector 24-pin dual-row header: SPI0 / I2C3 / I2C2 / I2C1 / I2C0

Long TX uploads USB chunks before committing one SPI bus transaction. It requires master, single-I/O and TX-only operation. Ordinary full-duplex limits remain 504 TX bytes and 512 RX bytes. The USB frame limit and SPI transaction length are separate limits.

3. Software and documentation

Deliverable Purpose
SDK package Separate cpp, python and rust directories; Windows/Linux x64 runtimes, examples and both PDF guides in docs/
Linux driver package I2C/SPI kernel modules and build files; build for the target kernel
Technical manual Wiring, SDK setup, protocol, operating limits, recovery and deployment
SDK: programming guide Language APIs, runtime setup, errors and concurrency
SDK: integration and maintenance guide Kernel driver deployment, application maintenance and deployment checks
SEC application image Complete packaged application, delivered separately from the SDK

SDK and device software have independent version numbers. The SDK package is for application development; device images are supplied separately, while both PDF usage guides are included in docs/. The device-query API exposes identification and running version for system management.

4. Typical workflow

  1. Follow the connector pinout and check common ground, voltage compatibility and I2C pull-ups.
  2. Choose the USB SDK or Linux kernel driver; confirm serial number and interface ownership.
  3. Query capabilities and limits, then configure the bus. Start SPI testing at a lower clock rate.
  4. Perform a transfer or a 1024-word TX; check the response and peripheral state.
  5. After a disconnect or timeout, establish device and peripheral state before a new transaction.

5. Applications and operating boundaries

Typical applications include sensors, power devices, EEPROMs, SPI peripheral modules, automated register tests, protocol bring-up and Linux integration.

Validate maximum clock use against the actual cable and peripheral timing. Long RX, 4096-byte full duplex and multi-segment transactions holding CS across segments are outside the current long-TX interface. Use an oscilloscope or logic analyzer to accept continuous CS and edge timing; compilation and software success do not replace waveform records.

Official downloads: https://www.lanmotion.com/en/downloads/

Online technical documentation: https://www.lanmotion.com/en/docs/utools-si104/


Manual

UTools-SI104 Technical Manual V1.2

USB integration, I2C/SPI protocol and system deployment

Document information Value
Document number LM-SI104-TM-001
Revision V1.2
Release date 2026-10-31
Applicable versions Protocol 1.3; SDK 1.0.5; device software 1.46.668
Audience Application developers, test engineers, FAEs and system integrators

Reading guide

  • Chapter 1: Wiring and USB interfaces.
  • Chapters 2-4: SDK setup, SPI and I2C operation and limits.
  • Chapters 5-8: USB framing, discovery and SPI/I2C command fields.
  • Chapters 9-10: Recovery, deployment, device updates and acceptance.

The SDK and device images are delivered separately. The SDK does not implement device updating. This manual defines public interfaces and operating rules; consult the SDK programming guide for the complete language APIs.

1. Connection and identification

The device uses VID 0x34B7, PID 0xE481 and product name UTools SI104. Current USB serial numbers consist of SI104 followed by the uppercase hexadecimal representation of the 16-byte UUID, totaling 37 characters. Read the actual serial through enumeration instead of hard-coding the historical fixed serial.

Interface Function OUT endpoint IN endpoint
0-3 I2C CH0-CH3 0x01-0x04 0x81-0x84
4 SPI 0x05 0x85
5 Device maintenance 0x06 0x86

MS OS 2.0 descriptors enable automatic WinUSB binding for MI_00-MI_05 on Windows. Select devices by VID/PID, serial and interface number. Linux user processes also require USB access permission. The maintenance interface uses a separate protocol and does not accept the I2C/SPI frames in this manual.

1.1 24-pin connector

The connector is a 2x12 dual-row header. The column order below follows the product markings; verify plug orientation before wiring.

Column 1 2 3 4 5 6 7 8 9 10 11 12
Group SPI0 SPI0 SPI0 SPI0 I2C3 I2C3 I2C2 I2C2 I2C1 I2C1 I2C0 I2C0
Upper D2 D0 CS GND SCL GND SCL GND SCL GND SCL GND
Lower D3 D1 CLK VCC SDA VCC SDA VCC SDA VCC SDA VCC

Connect a common ground and check signal voltage and pull-up compatibility. I2C VCC is a shared rail and is not enabled by the default setup. Explicitly enable it only after checking external power and wiring. Voltage monitoring alone does not enable power. Do not directly connect the device VCC output to another power supply.

1.2 Access paths

The Windows/Linux USB SDK supports applications and scripts. Linux kernel drivers integrate with the standard I2C/SPI subsystems. Only one path may own an interface at a time; close application handles or unload the corresponding module before switching.

2. C++, Python and Rust SDK setup

SDK 1.0.5 uses ABI 1.0 and contains cpp, python, rust, runtime, docs and licenses directories. Runtimes support Windows x64 and Linux x64; Linux requires system libusb. Retain third-party licenses and match application, runtime and toolchain architectures.

2.1 C++

Add the runtime bin directory to PATH, or its Linux lib directory to LD_LIBRARY_PATH. Use find_package(si104 CONFIG REQUIRED), link si104::sdk and set CMAKE_PREFIX_PATH to the platform runtime directory.

cpp
#include <si104/si104.hpp>
#include <numeric>

si104::Device dev("YOUR_SERIAL", SI104_SPI_ONLY);
si104::SpiConfig cfg;
cfg.data_bits = 32;
cfg.sclk_hz = 1000000;
cfg.cs_active_high = 0;
dev.spi_configure(cfg);
std::vector<uint32_t> words(1024);
std::iota(words.begin(), words.end(), 0);
dev.spi_tx_words(words);

2.2 Python

Install the platform wheel from python/wheels. It bundles the native SDK. If using the Python directory independently, set SI104_SDK_LIBRARY to the runtime library.

python
from si104 import Device, SpiConfig

with Device("YOUR_SERIAL", interfaces=Device.SPI_ONLY) as dev:
    dev.spi_configure(SpiConfig(
        data_bits=16, sclk_hz=1_000_000,
        cpol=0, cpha=0, cs_active_high=True))
    dev.spi_tx_words(range(1024))

2.3 Rust

The crate locates runtime automatically inside the complete package. For independent integration, set SI104_SDK_DIR to the platform lib directory. Windows requires the MSVC x64 toolchain and the DLL directory on PATH.

rust
use si104::{Device, SpiConfig, SPI_ONLY};

fn send() -> Result<(), si104::Error> {
    let dev = Device::open(Some("YOUR_SERIAL"), SPI_ONLY, 3000)?;
    dev.spi_configure(&SpiConfig {
        data_bits: 8, sclk_hz: 1_000_000,
        cs_active_high: 0, ..Default::default()
    })?;
    let words: Vec<u32> = (0..1024).map(|n| n & 255).collect();
    dev.spi_tx_words(&words, 1)?;
    Ok(())
}

These examples transmit real SPI data. Run them only after checking wiring and the target protocol. Enumeration and queries can be used for initial read-only checks. Device-query APIs including info, capabilities and limits remain available.

3. SPI configuration and lengths

Parameter Values and limits
CPOL / CPHA Each 0 or 1; SPI modes 0-3
Bit order MSB first or LSB first
data_bits Configuration accepts 1-32; use 8/16/32 for common integration and long TX
Master SCLK 50000-40000000 Hz; actual frequency is divider-quantized
CS polarity Active-low or active-high in master single-I/O; slave supports active-low only
Bus timeout 1-60000 ms; allow additional USB scheduling margin
DMA Prefer DMA or force FIFO; actual selection depends on device and configuration

The status frequency is the requested setting, not a measurement. Dual/Quad require appropriate wiring and are outside single-I/O long TX. Confirm storage alignment and peripheral timing separately for other word widths.

3.1 USB frame versus complete transaction

Operation Maximum length Conditions
Ordinary SPI_XFER 504 TX bytes; 512 RX bytes TX-only, RX-only or ordinary full duplex
8-bit long TX 1024 words / 1024 bytes Master, single-I/O, TX-only
16-bit long TX 1024 words / 2048 bytes Master, single-I/O, TX-only
32-bit long TX 1024 words / 4096 bytes Master, single-I/O, TX-only

spi_tx_words accepts 1-1024 words and rejects values exceeding the configured width. USB storage is little-endian; lsb_first controls bit order on the SPI bus. USB chunks are uploaded before COMMIT starts one SPI transaction, rather than a host loop producing multiple CS cycles.

CS becomes active at transaction start. The device waits for SPI idle before releasing it, including the FIFO tail after DMA completion. This is the interface behavior; continuous electrical timing still requires capture with physical probes. Long RX, 4096-byte full duplex and multi-segment CS-hold transactions are unsupported by the current long-TX interface.

3.2 Basic validation matrix

Cover six combinations: 8/16/32 bits and active-low/active-high CS. Send 1024 words in each, check results, a new transaction after errors, and CS/SCLK/MOSI waveforms. MOSI-MISO loopback checks ordinary short full-duplex data; it cannot prove that a peripheral received all 1024 TX-only words.

4. I2C functions and limits

Channels 0-3 can each operate as master or slave. Standard, fast and fast-plus select 100 kHz, 400 kHz and 1 MHz. Custom settings accept 10 kHz-1 MHz. Master operations support 7/10-bit addresses; the Linux adapter path supports 7-bit only.

Operation Per-operation limit or rule
Master write Up to 504 TX bytes
Master read Up to 512 RX bytes; 506 with VCC monitoring
Write then read Nonzero TX and RX select repeated START
Slave buffer write / mailbox push Up to 256 bytes
Register mirror write Up to 508 bytes; address range must not wrap
Register reply read Up to 256 bytes
Slave event Up to 32 sample bytes; read by polling

Slave logic modes are raw, mailbox and register. Register mode provides a mirror, 8/16-bit pointers and virtual page mapping. After configuring slave mode, poll initialized=1 before starting the external I2C master. A CONFIG response acknowledges acceptance, not successful completion of deferred initialization.

python
from si104 import Device, I2cConfig

with Device("YOUR_SERIAL", interfaces=1) as dev:
    dev.i2c_configure(0, I2cConfig(mode=1, bus_hz=400000))
    data = dev.i2c_transfer(0, 0x50, b"\x00", 16)

Replace address, register and length with the target protocol. The SDK does not automatically enable VCC. With monitor_vcc enabled, inspect returned voltage information. Configure thresholds and power control according to actual wiring.

One worker services all four I2C channels. A blocking transaction on one channel can delay the others. Separate interfaces do not imply simultaneous bus start or real-time synchronization guarantees.

5. USB Bulk framing and status

I2C/SPI requests and replies share a 12-byte header, little-endian without padding. Header version remains 1; query commands provide capability versions.

Offset Field Size / rule
0 magic u16, 0xA55A
2 version u8, 1
3 cmd u8 command
4 channel u8, I2C 0-3 or SPI 0; must match the endpoint
5 reserved u8, 0
6 seq u16 correlation number, echoed by the reply
8 payload_len u16, 0-512
10 status u16, zero in requests; status code in replies

Each OUT transfer carries one complete request; each IN transfer carries one complete response. Maximum frame length is 524 bytes. USB HS packets are 512 bytes and FS packets 64 bytes. Append a ZLP when the complete frame length is an exact multiple of the endpoint packet size; do not test payload length alone. The SDK and drivers handle this rule. USB/IP forwarding must also carry zero-length OUT transfers.

Validate response magic, version, command, channel, sequence, reserved=0 and exact length. Fixed-length commands reject trailing bytes, and undefined flags must be zero. Frames shorter than the header may be dropped; other validation failures return an error without starting peripheral operations.

Status Name Meaning
0 OK Success
1 / 2 BAD_MAGIC / BAD_VERSION Invalid identifier or version
3 / 4 BAD_LENGTH / BAD_CMD Invalid length or command
5 / 6 BAD_STATE / BAD_PARAM Invalid state or parameter
7 / 8 IO_ERROR / TIMEOUT Bus error or timeout
9 / 10 / 11 UNSUPPORTED / BUSY / NO_POWER Unsupported, busy or power condition not met

Sequence numbers correlate replies; they are not execution deduplication tokens. Keep one outstanding request per interface and serialize the full long-TX configuration/upload/commit sequence. A USB timeout does not prove that an operation was not executed. Never automatically replay requests with side effects.

6. Common query commands

All requests below have empty payloads. Older devices may return BAD_CMD for newer queries; use discovered capabilities before choosing long TX or selectable CS polarity.

Command ID Response
PING 0x01 Four ASCII bytes: PONG
GET_VERSION 0x02 Four bytes: I2C [1,3,4,0], SPI [1,3,3,0]
GET_STATUS 0x03 I2C 32 bytes; SPI 24 bytes
GET_RUNTIME_STATUS 0x04 Runtime statistics; 188 bytes in protocol 1.3
GET_INFO 0x05 64 bytes: u32 model, u32 running version, 16 UUID bytes, 40 serial bytes
GET_CAPS 0x06 20 bytes: BBBBIIII
GET_LIMITS 0x07 28 bytes: 8HIIHH

GET_INFO model is 0x53490104. Running version encodes major<<24, minor<<16 and UTC days since 2025-01-01. The serial is NUL-terminated. SPI GET_VERSION byte 2 is a feature bitmap: bit 0 long TX, bit 1 master CS polarity.

GET_CAPS contains u8 major, minor, kind and channel_count, followed by u32 features, role_mask, io_mode_mask and data_width_mask. Kind is 1 for I2C and 2 for SPI. Feature bits 0-5 indicate discovery, strict framing, USB session invalidation, SPI TX status, staged TX and master CS polarity. I2C features=7; SPI features=63. Role bits 0/1 mean master/slave, I/O bits 0/1/2 mean Single/Dual/Quad, and width bit N-1 means N bits.

GET_LIMITS field order I2C SPI
payload_max 512 512
tx_max / rx_max 504 / 512 504 / 512
reg_write_max / mailbox_max 508 / 256 0 / 0
staged_bytes_max / staged_words_max / chunk_max 0 / 0 / 0 4096 / 1024 / 508
hz_min / hz_max (u32) 10000 / 1000000 50000 / 40000000
timeout_min_ms / timeout_max_ms 1 / 60000 1 / 60000

All other limit fields are u16. Limits describe accepted settings and protocol capacity, not measured clock frequency.

7. SPI commands and transaction state

Command ID Request payload
SPI_CONFIG 0x20 16-byte configuration
SPI_XFER 0x21 8-byte header plus TX bytes
SPI_ABORT 0x22 Empty
SPI_TX_BEGIN 0x23 u16 tx_bytes, rx_bytes=0, flags, reserved=0
SPI_TX_DATA 0x24 u16 offset, count; then 1-508 data bytes
SPI_TX_COMMIT 0x25 Empty
SPI_TX_STATUS 0x26 Empty; returns 16 bytes

SPI_CONFIG begins with eight u8 fields: role, cpol, cpha, bit_order, data_bits, io_mode, cfg_flags and reserved. These are followed by u32 sclk_hz, u16 timeout_ms and u16 reserved. Role: master=0, slave=1; bit_order: MSB=0, LSB=1; io_mode: Single=0, Dual=1, Quad=2. cfg_flags bit 0 prefers DMA and bit 1 selects active-high CS. Other bits and reserved fields are zero.

SPI_XFER starts with four u16 fields: tx_len, rx_len, flags and reserved=0. Flag bit 0 prefers DMA, bit 1 forces FIFO; zero uses configured defaults. Nonzero TX and RX select full duplex, clocked for the longer direction. The response contains only RX data. Lengths must contain complete words.

7.1 Long TX sequence

BEGIN declares total length; DATA uploads contiguous offsets; COMMIT starts the bus. BEGIN/DATA produce no SPI clocks. Requirements are master, Single, 8/16/32 bits, 1-1024 words and rx_bytes=0. ABORT or CONFIG cancels pending upload. After 30 seconds without accepted upload activity, expiry is checked on the next SPI command.

7.2 SPI_TX_STATUS

The BB5HI response contains u8 state, reserved=0; u16 total_bytes, received_bytes, begin_seq, commit_seq, result; and u32 session_id. States: 0 idle, 1 receiving, 2 ready, 3 completed successfully, 4 completed with error, 5 canceled/expired. Result is BAD_STATE before COMMIT and TIMEOUT on expiry.

Completed records survive ABORT until the next BEGIN or USB session reset. Duplicate COMMIT is rejected without overwriting the record. After a lost reply, accept completion only when session, BEGIN/COMMIT sequences, lengths and result match. Never submit COMMIT again. The SDK preserves uncertain completion; when unresolved, inspect the peripheral before deciding what to do next.

The synchronous SPI worker processes ABORT after an active transaction finishes or times out. ABORT is not an out-of-band emergency stop and cannot undo electrical operations.

8. I2C command fields

I2C_CONFIG is 12 bytes: u8 role, mode, addr_10bit, logic_flags; u32 bus_hz; u16 slave_addr, timeout_ms. Role: master=0, slave=1; mode: standard=0, fast=1, fast-plus=2, custom=3. logic_flags bits 0-1 select raw=0, mailbox=1 or register=2; bit 2 selects 16-bit register addresses, bit 3 16-bit data, bit 4 big-endian data. Other bits are zero. I2C timeout_ms=0 selects the 1000 ms default.

Command / ID Payload and purpose
CONFIG / 0x10 The 12-byte configuration above
MASTER_XFER / 0x11 u16 addr, flags, tx_len, rx_len plus TX; only flag bit 15 VCC_MONITOR is defined
SLAVE_READ / 0x12 u16 len; read slave RX buffer
SLAVE_WRITE / 0x13 Up to 256 raw bytes; set slave TX buffer
ABORT / RESET / 0x14 / 0x15 Empty; abort or reset the channel
MAILBOX_PUSH / 0x16 Up to 256 raw bytes
MAILBOX_POP / 0x17 Empty or u16 max_len; pop received data
REG_WRITE / 0x18 u16 addr, count plus count bytes
REG_READ / REG_REPLY / 0x19 / 0x1A u16 addr, len; read mirror or reply buffer
EVENT_POLL / 0x1B Empty; return event header and sample
VADDR_SET / 0x1C u8 slot, high_byte
VADDR_GET / 0x1D Empty; return slot_count and 31 mapped high bytes
VCC_SET / 0x1E u8 enable, save; each 0/1; save=1 persists the setting
VCC_THRESHOLD / 0x1F Empty query, or u16 threshold_mv and u8 save

Nonzero tx_len and rx_len select write followed by repeated START and read. Replies contain RX data. With VCC_MONITOR set, append six bytes: u16 adc_mv, u16 threshold_mv, u8 adc_valid, u8 vcc_output_enabled. IO_ERROR includes NACK and other controller errors; this protocol does not provide distinct NACK/arbitration codes.

I2C GET_STATUS fields are u8 role, mode, addr_10bit, initialized; u32 bus_hz; u16 slave_addr, timeout_ms; u32 req_count, err_count; u8 slave_logic_mode, reg_addr_width; u16 reg_ptr, mailbox_rx_len, mailbox_tx_len, event_pending, event_dropped.

EVENT_POLL header BBHHH contains type, sample_len, addr, len, dropped, then 0-32 sample bytes. Type 0=no event, 1=external master write, 2=pointer set, 3=host mirror write. Dropped counts discarded events. The 10-byte VCC response BBHHBBH contains output_enabled, persist_enable, threshold_mv, adc_mv, fail_reason, op_result, measured_mv. op_result=0 indicates success; frame status alone does not establish that power control succeeded.

Each channel has an 8192-byte mirror: 32 pages of 256 bytes. Page 0 maps high byte 0. Slots 1-31 map high bytes 0x01-0xFE; 0xFF unbinds a slot. Unmapped reads return zero and writes are ignored. Respect discovered capabilities, buffer ranges and the peripheral protocol.

9. Recovery and deployment

SDK errors include a unified code, USB backend code, device status and completion_unknown. When the latter is true, the operation may already have occurred. Do not blindly repeat writes or COMMIT.

Situation Action
USB disconnect or re-enumeration Close the old handle, reopen by serial, reconfigure and inspect peripheral state
Upload failure The exclusive interface owner clears pending upload before starting a new transaction
Lost COMMIT reply Query completion; if uncertain, inspect the peripheral instead of replaying COMMIT
Aligned frame timeout over USB/IP Check zero-length OUT forwarding and compare with native USB
Slave initialization incomplete Poll initialized and error counters; check configuration and wiring

USB reset, disconnect and configuration change advance the session. Old queued requests/replies become invalid. An operation already executing may finish; a session change does not prove otherwise. Each SDK handle serializes access. Do not race close/destruction against other calls.

9.1 Linux drivers

After extracting the driver package, build inside linux-driver against the target kernel. The I2C module registers i2c_adapter in master role; the SPI module registers a controller. Configure SPI children and spidev binding according to the target system.

sh
cd linux-driver
make
sudo insmod si104_i2c.ko
sudo insmod si104_spi.ko
# Stop applications before changing the access path.
sudo rmmod si104_spi
sudo rmmod si104_i2c

Submit 1024-word SPI TX as one transfer; len is in bytes. Multi-segment CS hold, cs_change, transfer delays and word delays are unsupported. Shared VCC is disabled by default. The kernel module and USB SDK cannot own the same interface simultaneously.

9.2 Device update and application address

Check model, version and SHA256 first. Stop bus work and use the official maintenance tool with the matching product plan. SEC BIN is already packaged and does not require encryption again. Program the complete App1 file at Flash offset 0x00024000, CPU mapped address 0x80024000. Address 0x80025000 is the entry after the 4 KB header, not the programming address for the complete BIN.

Preserve the installed bootloader. Successful upload does not prove the new application is running. Reconnect, query the running version, then resume work. Recover from update or power failures according to observed device state; do not send repeated peripheral traffic as a recovery attempt.

10. Verification, acceptance and revisions

Official downloads provide SDK, drivers and SEC BIN separately. The SDK docs/ directory contains both the Programming Guide and the Integration and Maintenance Guide as formal PDFs. SDK and device software use independent versions. Verify downloaded files using SHA256SUMS, and match image, driver and runtime to the device and system architecture.

Acceptance layer Required checks and evidence
Software package Windows/Linux builds, three-language loading, archive integrity and hashes
USB protocol Frame validation, aligned OUT/ZLP, timeouts, stale replies and reconnection
SPI functions 8/16/32 bits, 1024 words, both CS polarities and a new transaction after errors
Electrical waveforms Capture CS/SCLK/MOSI; verify continuous assertion and release after the final bit
Physical power loss Remove every supply path; record offline detection, power-up and running version

This revision undergoes software and delivery checks. The new image does not inherit hardware qualification from other versions. Software success alone cannot prove acceptance of every word by the target. Continuous-CS qualification still requires instrument records.

Revision Date Changes
V1.2 2026-10-31 Three-language SDK, 1024-word TX, CS polarity, protocol 1.3, recovery and formal downloads
V1.1 2026-05-19 SPI clock/DMA, USB interface and maintenance descriptions

Official downloads: https://www.lanmotion.com/en/downloads/

Online documentation: https://www.lanmotion.com/en/docs/utools-si104/