Quansheng UV-K5/K6 Custom Firmware (takyonxxx Edition)
Forked from egzumer/uv-k5-firmware-custom, which is a merge of OneOfEleven custom firmware with fagci spectrum analyzer. All based on DualTachyon's open firmware.
Warning: Use this firmware at your own risk (entirely). There is absolutely no guarantee that it will work in any way shape or form on your radio(s), it may even brick your radio(s), in which case, you'd need to buy another radio. Anyway, have fun.
takyonxxx Custom Changes
Simplified Menu System
The menu has been reorganized into visible and hidden sections. Frequently used items are immediately accessible, rarely used items are moved to the hidden menu (accessible by holding PTT + upper side button during power-on).
Visible menu (13 items): Sql, Step, TxPwr, W/N, Demod, Mic, AM Fix, VOX, BatVol, BackLt, Beep, RxMode, VER
Hidden menu (moved from visible): RxDCS, RxCTCS, TxDCS, TxCTCS, TxODir, TxOffs, BusyCL, Compnd, ChSave, ChDele, ChName, Scramb, ScAdd1/2, SList/1/2, ScnRev, F1Shrt/Long, F2Shrt/Long, M Long, KeyLck, TxTOut, BatSav, MicBar, ChDisp, POnMsg, BatTxt, BLMin/Max, BltTRX, Roger, STE, RP STE, 1 Call, all DTMF items, plus the original hidden items (F Lock, Tx 200/350/500, 350 En, ScraEn, FrCali, BatCal, BatTyp, Reset).
Accessing the hidden menu: Turn off the radio. Press and hold both the PTT button and the upper side button simultaneously, then turn the radio on while keeping both buttons held. Release after the radio boots. The menu will now show all items including the hidden ones.
Automatic Demodulation by Frequency
The radio automatically selects the correct demodulation mode based on frequency:
| Frequency Range | Mode | Usage |
|---|---|---|
| Below 30 MHz | USB | HF / Shortwave bands |
| 118 - 136 MHz | AM | Aviation airband |
| All other frequencies | FM | VHF/UHF radio |
This works in three places: when entering a frequency via keypad, when tuning with UP/DOWN in VFO mode, and when loading channels from EEPROM. The mode can still be changed manually via the Demod menu item.
TX on All Frequencies
The TX_freq_check function has been modified to allow transmission on all valid frequencies (BX4819 chip gap excluded). The ENABLE_TX_WHEN_AM flag is enabled, allowing TX in AM mode. Note that BK4819 hardware only supports FM modulation for TX regardless of the demod setting.
Spectrum Analyzer
The original fagci spectrum analyzer is retained with peak hold functionality. Access via the assigned side button.
Recommended Airband Frequencies (Ankara)
For testing AM reception on the aviation band (118-136 MHz, auto-AM enabled):
- 118.100 — Esenboğa TWR (Tower)
- 119.100 — Esenboğa Approach
- 121.500 — International emergency frequency
- 121.800 — Esenboğa Ground
- 124.000 — Ankara ATIS (continuous automated broadcast, best for testing)
- 127.800 — Ankara ACC (Area Control)
Version String Fix
The version string in the menu has been split across two lines so it fits the 128px wide display without truncation.
Demodulation Menu Renamed
The demodulation type menu item has been renamed from "Demodu" to "Demod" for clarity.
FM/AM Demodulation Improvements
Two fixes to improve AM reception quality:
AGC bit bug fix: The RADIO_SetupAGC function had a bug where the disable parameter was ORed to the same bit position as listeningAM, effectively ignoring the disable flag. This caused the AGC to get stuck in wrong states during mode transitions.
AM +6dB post-demod gain: BK4819 REG_43 bit 2 is now enabled in AM mode, adding 6dB gain after FM demodulation. AM signals are inherently weaker than FM at the demodulator output, so this boost makes weak AM stations (like airband) noticeably more audible. The gain is automatically disabled when switching back to FM.
Squelch in AM mode uses the original BK4819 hardware squelch with all three detection methods (RSSI + noise + glitch). This was found to work better than software-based or RSSI-only approaches after extensive testing.
Improved AM Fix (from upstream)
Three improvements to the am_fix.c module that reduces AM demodulator saturation/clipping. The original algorithm structure, gain table, and target RSSI (-89dBm) are preserved: 4-sample RSSI sliding window, adaptive hysteresis, and slower gain recovery to prevent pumping artifacts.
Flashing the Firmware
- Open https://whosmatt.github.io/uvmod/ in Chrome or Edge.
- Turn off the radio.
- Press and hold the PTT button, then turn on the radio while still holding PTT. The flashlight should turn on while the screen stays dark — the radio is now in bootloader mode.
- Connect the programming cable (Baofeng/Kenwood type USB serial cable) to the radio.
- Click "Flash directly" on the UVMOD page.
- Select the
firmware.packed.binfile from the build output. - Select the COM port and click Connect.
- Wait for the process to finish. Your settings should remain intact.
Building from Source
Windows (Recommended)
1. Install ARM Toolchain
Download and install gcc-arm-none-eabi-10.3-2021.10-win32.exe from ARM Developer. Default install path: C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\
2. Install GNU Make
Download and install gnu_make-3.81.exe from GnuWin32. Default install path: C:\Program Files (x86)\GnuWin32\
3. Install Python 3
Download from python.org. During installation, check "Add python.exe to PATH". After install:
python -m pip install crcmod
4. Build
Edit win_make.bat and verify the three PATH lines match your install locations:
@set "PATH=C:\Users\YOUR_USER\AppData\Local\Programs\Python\Python3XX;%PATH%"
@set "PATH=C:\Users\YOUR_USER\AppData\Local\Programs\Python\Python3XX\Scripts;%PATH%"
@set "PATH=C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin;%PATH%"
@set "PATH=C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\arm-none-eabi\bin;%PATH%"
@set "PATH=C:\Program Files (x86)\GnuWin32\bin;%PATH%"
Then run:
win_make.bat
Output files: firmware.bin and firmware.packed.bin
Common issues:
'make' is not recognized— GnuWin32 not installed or not in PATH'arm-none-eabi-gcc' not found— ARM toolchain not installed or PATH mismatch inwin_make.bat'python' not recognized— Python not in PATH. Find your Python install location and update the PATH inwin_make.batPYTHON NOT FOUND, *.PACKED.BIN WON'T BE BUILT— Python PATH not set beforemakeruns. Ensure Python PATH lines are at the top ofwin_make.bat
Linux (Ubuntu/Debian)
sudo apt update
sudo apt install -y git make python3 python3-pip gcc-arm-none-eabi
pip3 install crcmod
git clone https://github.com/takyonxxx/uv-k5-firmware-custom.git
cd uv-k5-firmware-custom
make
Linux (Arch/Manjaro)
sudo pacman -S git make python python-pip arm-none-eabi-gcc arm-none-eabi-newlib
pip install crcmod
git clone https://github.com/takyonxxx/uv-k5-firmware-custom.git
cd uv-k5-firmware-custom
make
macOS
brew install git python3 armmbed/formulae/arm-none-eabi-gcc
pip3 install crcmod
git clone https://github.com/takyonxxx/uv-k5-firmware-custom.git
cd uv-k5-firmware-custom
make
Docker (any platform)
git clone https://github.com/takyonxxx/uv-k5-firmware-custom.git
cd uv-k5-firmware-custom
./compile-with-docker.sh
On Windows use compile-with-docker.bat instead.
Modified Files Summary
| File | Changes |
|---|---|
win_make.bat |
Fixed PATH quoting, added Python path |
ui/menu.c |
Menu reorganization (visible/hidden), renamed Demod |
version.c |
Version string split to two lines |
radio.c |
Auto AM for airband 118-136 MHz on channel load |
app/main.c |
Auto AM for airband on keypad entry and VFO tuning |
app/spectrum.c |
Original (unchanged) |
frequencies.c |
TX allowed on all frequencies |
Makefile |
ENABLE_TX_WHEN_AM = 1 |
Code Analysis
For a detailed breakdown of flash/RAM usage, per-function sizes, feature flag costs, and recommendations on what can be disabled to free up space, see ANALYSIS.md.
For a developer-oriented overview of the code architecture, source tree, execution flow, and key subsystems, see DEVELOPER.md.
Credits
This firmware is built upon the work of:
- DualTachyon — original open firmware reverse engineering
- OneOfEleven — AM fix, fast scanning, and many improvements
- fagci — spectrum analyzer
- egzumer — merged firmware with additional features
- takyonxxx — menu simplification, auto demodulation (airband AM, HF USB), AM demod improvements (AGC fix, +6dB gain), FM indicator on main screen, TX unlock
License
Apache License 2.0 — see LICENSE.
댓글 0
로그인하고 댓글을 남겨 보세요.