Skip to content

k5prog

Reads and writes a Quansheng UV-K5's memory, and flashes its firmware, over the programming cable

What it does

k5prog talks to a Quansheng UV-K5 handheld (and radios built on the same board) through its programming cable. It reads the radio's configuration EEPROM -- channels, settings, calibration -- to a file, and writes a file back in one of three ways of increasing risk: as the vendor's software does (-w), most of the EEPROM short of what is believed to be calibration (-W), or all of it (-B, which its own help calls "brick my radio" mode). With the radio started in its bootloader it also flashes firmware: a raw, unencrypted image, such as the community firmwares (egzumer, F4HWN and others) publish, not the vendor's encrypted update files. It writes firmware to the radio. Flashing replaces the program the radio runs; a wrong or damaged image can leave the radio unable to start until it is flashed again. k5prog makes you ask for that on purpose: the risky modes refuse until -Y is given enough times -- once to read the bootloader version or write the whole EEPROM, three times (-YYY) to flash, five to flash an image shorter than 50,000 bytes (read from k5prog.c) -- and its help warns that flashing "will likely brick your radio". Installing it changes nothing on any radio, and no firmware comes with it.

Why you would want it

The UV-K5 is the most-modified handheld of the decade, and most of what people do with it starts with replacing its firmware. The usual flashers are Quansheng's Windows program and browser-based ones; k5prog is the native Linux command-line way, and a backup of the EEPROM before any of that is the one step nobody regrets. For channels and settings, chirp (in the station profile) is the friendlier tool: it carries a driver for the stock firmware, and the community firmwares publish their own CHIRP driver modules, which CHIRP loads from a file and runs as Python inside itself -- read one before loading it. Which driver suits which firmware has not been measured here.

Before it will work

A UV-K5 programming cable: the two-pin Kenwood-style plug with a USB-serial chip in it. Access to the serial device -- the dialout group, then log out and in. The port defaults to /dev/ttyUSB0; give the cable's /dev/serial/by-id/ path with -p so the right device is written. For EEPROM work the radio is on as normal; for flashing it is started in its bootloader (PTT held while switching on, as k5prog's own warning describes it).

How it installs

  • git (make) — https://github.com/sq5bpf/k5prog at 241ab18b61f6d8933fecf60643fe94322fbf4198
  • build dependencies: build-essential
  • the project's build system has no install rule; the binaries listed below are copied into the prefix instead
  • Built on 2026-10-01 in a rootless debian:13 container the way this block runs it -- make -j 2 in the checkout as an unprivileged user, with build-essential only: exit 0, 0.3 s wall, 35 MiB peak, no compiler warnings. The executable is 65 KB and links only libc. The toolchain came to 84 packages and about 390 MB on a bare debian:13 image. The same build in kali-rolling and ubuntu:24.04 containers exited 0 in about a second each, with no warnings.

Binaries this produces:

  • k5prog

Known problems

Read before you write. Run k5prog -r first and keep the file it writes (k5_eeprom.raw, or the name given with -f): the EEPROM holds the radio's calibration, and a full write with -B from another radio's dump replaces it. The serial speed is fixed at 38400 baud. The program was written against the UV-K5 and its bootloader 2.00.06; newer revisions of the radio and the bootloaders they ship have not been measured here, and upstream has not changed since 2023-12-29. A refused mode (too few -Y) prints an error and exits with status 0, so a script cannot tell it from success by the exit status. What was measured: built on Debian 13, Kali and Ubuntu 24.04, and k5prog -h printed its help (v0.9). Not measured: any radio, cable, EEPROM read or write, or flash.

Keeping it current

  • probe: none
  • strategy: rebuild
  • No tags, and no commit since 2023-12-29. Read the default branch's head (D-032) at each yearly review; a new commit is a reason to read the log and rebuild, and continued silence is not a fault in a tool for one radio's fixed protocol.

Where to get help with the software itself

The author's repository: issues at the URL above, and the README in the tree, which documents every option and the protocol. The UV-K5 community firmware projects document their own flashing steps. Licence: GPL-3.0-or-later.

Source: catalog/packages/k5prog.yaml