Skip to content

TYT MD-380 support (#42) - #133

Merged
ww8l merged 1 commit into
mainfrom
issue-42-tyt-md380
Oct 10, 2026
Merged

ww8l merged 1 commit into
mainfrom
issue-42-tyt-md380

Conversation

@ww8l

@ww8l ww8l commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Closes #42.

The eleventh radio, and the first with no serial port: switched on normally with the cable in, the MD-380 itself enumerates as an STM32 DFU device (0483:DF11) and its 256 KiB codeplug is read and written over USB control transfers. macOS needs no driver.

What it does

  • Program a codeplug: channels (DMR talkgroup expansion, analog tones/DCS with polarity), talkgroup contacts, zones of 16 (longer lists split into numbered zones), scan lists. Backup first; verified by a fresh read after the radio restarts.
  • Backup / restore a whole image.
  • 59 settings (General Settings, side keys, menu switches) read and written from the profile editor; a settings write rewrites only the 64 KiB sector that changed. Passwords are deliberately not exposed.
  • No port picker for this radio — dialogs say "connected over USB directly".

Hardware (Tim's UHF MD-380, md380tools firmware)

  • Ladder rungs 1–5 all passed: identity write, one-byte write, full codeplug (screen-checked zones, contacts, channels, scan list), band probe, settings (13 written and seen on screen, 2 found by front-panel diff).
  • Dev-app click-through: profile settings read/write, program.
  • Found by measurement: the first read after a write's restart returns one blank block (the verify retries only that signature); 0x2F003 is the radio's current zone (clamped on program); Talk Permit's menu shows only the analog half; the radio validates nothing — a 2 m channel displays and keys but does not reach a 2 m repeater, so the 400–480 filter is the only guard.

Not verified

  • Windows: stt.rs talks to ST's STTub30 driver (installed by TYT's CPS) by DeviceIoControl — a Rust port of a PowerShell reader proven on Tim's Intel PC — and falls back to WinUSB. It compiles (cross-compiled for x86_64-pc-windows-gnu; CI builds it) but has not run on Windows with the radio attached. The README row says so until Tim tests it. The app never installs or changes drivers.
  • Whether a DMR channel with no RX group list hears its talkgroup (Tim's working codeplug uses none; parked).

Shared changes

  • ImageReader split out of ImageProgrammer (download a backup without claiming image programming); download_image capability; the five clone radios get it automatically via trait upcasting.
  • usb_direct capability + one shared port picker (src/components/radioPort.tsx).
  • export::invert_chirp_tones: one tone inverter shared by the AnyTone (its truth-table tests pass through it) and the MD-380.
  • ProgramReport carries verified, channels, skipped through to the generic dialog.
  • Program dialog's skipped/RX-only list keyed uniquely (DMR rows share a channel id).

🤖 Generated with Claude Code

The eleventh radio and the first with no serial port: switched on normally
with the cable in, the MD-380 itself enumerates as an STM32 DFU device and its
256 KiB codeplug moves over USB control transfers. macOS needs no driver.

- Transport (radios/tyt_md380/protocol.rs): dmrconfig's DFU sequence with the
  CPS prelude and md380tools' poll-to-idle order. Reads 0.9 s; writes erase
  and rewrite, verified by a FRESH read after the radio restarts, retrying the
  first-boot-after-write blank block the radio produces (measured).
- Planner: channels with talkgroup expansion, contacts in first-use order,
  zones of 16 (longer lists split into numbered zones), scan lists, per-channel
  scan list only from explicit assignment. Number Keys / One Touch follow their
  talkgroup to its new contact index; the radio's current-zone byte (0x2F003,
  measured) is clamped into the new zone count.
- 59 settings from one measurement sheet (13 written and seen on the radio's
  screen, 40 factory-consistent); passwords deliberately left out. A settings
  write rewrites only the 64 KiB sector that changed.
- Windows: the same requests through ST's STTub30 driver (installed by TYT's
  CPS) by DeviceIoControl, else WinUSB; the app never touches drivers. Compiles,
  NOT yet run on Windows hardware — the README says so.
- Shared machinery: an ImageReader capability split out of ImageProgrammer
  (download a backup without claiming image programming), `usb_direct` so the
  dialogs drop the serial-port picker, one shared CHIRP tone inverter
  (export::invert_chirp_tones) used by the AnyTone and the MD-380, one shared
  port picker, ProgramReport carries verified/channels/skipped.

Hardware: Tim's UHF MD-380 (md380tools firmware) — ladder rungs 1-5 passed,
dev-app click-through, band probe (edges fine; the radio validates nothing; a
2 m channel does not reach a 2 m repeater, so 2 m is dropped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ww8l
ww8l merged commit a7f05f6 into main Oct 10, 2026
3 checks passed
@ww8l
ww8l deleted the issue-42-tyt-md380 branch October 10, 2026 11:49
ww8l added a commit that referenced this pull request Oct 10, 2026
Bumps the four version files that must stay in sync. What this release adds:

**TYT MD-380** (#42, PR #133) — the eleventh radio, and the first with no
serial port: the radio itself is the USB device, and macOS needs no driver.

- Read, program and restore over USB, each backed up first and verified by a
  fresh read after the radio restarts. Every rung of the hardware ladder passed
  on a UHF MD-380 (md380tools firmware).
- Channels with DMR talkgroup expansion, talkgroup contacts, zones of 16
  (longer lists split into numbered zones) and scan lists; Number Keys and One
  Touch follow their talkgroup when the contact list is rebuilt.
- 59 settings — General Settings, side keys, menu switches — read and written
  from the radio profile; a settings write rewrites only the sector it changed.
- Windows uses the driver TYT's CPS installs; not yet tested on a Windows PC
  with the radio attached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add TYT MD-380 Support

1 participant