just bought Quansheng UV-K5-8 radio.
I want to play with custom firmwares with AM/SSB and spectrum view.
But first I want to backup factory firmware and calibration data. But it's not clear, how to do it on linux?
I read that on windows it can be done with
k5prog-win which is designed for Windows and is based on
k5prog which is available on linux.
Tried k5prog:
$ ./k5prog -r -v
Quansheng UV-K5 EEPROM programmer v0.9 (c) 2023 Jacek Lipkowski <sq5bpf@lipkowski.org>
k5_prepare: try 0
cmd: 15 05 ok:1
****** Connected to firmware version: [2.01.32]
Successfully read EEPROM
It wrote k5_eeprom.raw file with size 8192 bytes. But I'm not sure is that eeprom file contains calibration data, or is it needs to be read with different command?
And I don't see the option in k5prog to read exiting firmware from radio. In documentation it has option -b to write firmware, but I want to read it from the radio. Is it possible?
According to
source code, it seems that the EEPROM size is
0x00002000 (8192) bytes.
And the last
0x00000200 (512) bytes is a calibration data block. Is it correct?
So, if I understand correctly,
k5prog -r reads all EEPROM include factory calibration data and it is enough for backup. Is it correct?
In case you have not already,
search "Chirp" and "Quansheng UV-K5-8 firmware"
They might get you to a forum with users
I was used Chirp on windows. But now I'm on linux and looking for linux software which is open source. Chirp is more general software, I want some specific for the radio to avoid a bunch of unwanted code and data.
At a glance it looks that k5prog is good enough for all modding stuff. I saved backup of EEPROM calibration data.
But I still didn't tried to flash custom firmware, because I don't know how to backup existing firmware.
It looks that there is no way to read existing firmware through baofeng cable. Is it correct?
Hi.
I backupped old fw of my K5.
But never going to back, new modded works so well.
There is 2 different programs, fw updater and other to add frequency etc.
I have heard Chirp works but havent tested yet.
I backupped old fw of my K5.
How?
According to source code research, I can backup entire EEPROM with this command:
./k5prog -r -v
it reads 8192 (0x2000) bytes, the last 512 (0x200) contains calibration data.
At offset 0x1F40 there are 8 uint16_t values which define battery indicator values:
[0] - 0 bar value
[1] - 1 bar value
[2] - 2 bar value
[3] - 3 bar value it equals to ADC value for 7.6 V
[4] - 4 bar value
[5] - always 0x2300 ???
[6] - always 0xFFFF ???
[7] - always 0xFFFF ???
The battery voltage can be calculated as V = (760 * ADC) / [3] / 100
And I can write new firmware to the radio with this command:
./k5prog -F -YYY -b firmware.bin
Still looking for a way to get current firmware from the radio
Some update
Since existing tools using some dirty coded protocol with mistakes, I wrote my own tool to read/write EEPROM and upload firmware.
It has more checks and detailed protocol log, so if something will going wrong you can read the log and check what is going on.
The tool supports both formats of firmware image - packed (as it come from manufacturer) and unpacked (decrypted). Also it allows to perform firmware image file conversion.
https://github.com/qrp73/K5TOOLRegarding to my original question, it appears that currently there is no tool to read firmware from the radio. But you can find firmware image with your version on internet. In my case, 2.01.32 is available here:
https://github.com/ludwich66/Quansheng_UV-K5_Wiki/tree/main/firmwareSee RT590_v2.01.32_publish.bin
The firmware and bootloader version of your radio can be checked with this command:
$ k5tool -reboot
Opening /dev/ttyUSB0
Handshake...
Firmware: "2.01.32"
HasCustomAesKey: 0
IsPasswordLocked: 0
Reboot device...
Bootloader: "2.00.06"
Done
Full EEPROM backup can be done with command:
$ k5tool -rdee
Opening /dev/ttyUSB0
Handshake...
Firmware: "2.01.32"
HasCustomAesKey: 0
IsPasswordLocked: 0
Read EEPROM offset=0x0000, size=0x2000 to eeprom-0000-2000.raw
Read 0000...0080: OK
Read 0080...0100: OK
Read 0100...0180: OK
...
Read 1f00...1f80: OK
Read 1f80...2000: OK
Done
Upload firmware can be done with command:
$ k5tool -wrflash RT590_v2.01.32_publish.bin
Opening /dev/ttyUSB0
Read packed FLASH image from RT590_v2.01.32_publish.bin...
Unpack image...
CRC check passed...
Write FLASH size=0xe5dc
Waiting for bootloader beacon...
Bootloader: 2.00.06
Send version "2.01.32"...
Bootloader: 2.00.06
Write 0000...0100: OK
Write 0100...0200: OK
Write 0200...0300: OK
Write 0300...0400: OK
...
Write e300...e400: OK
Write e400...e500: OK
Write e500...e5dc: OK
Done
That looks like it might be fund to play with, I think I might order one...
Are they USB programmable now, or do they still need a programming cable?
Are they USB programmable now, or do they still need a programming cable?
USB connector on UV-K5 is used for charge only. For programming you're needs programming cable, you can use one from Baofeng radio or just hand made by using USB-serial module, but it requires connector.