qrp73 / K5TOOL

UV-K5 toolkit utility to read/write EEPROM and flashing firmware for Quansheng UV-K5 and UV-R5 radios
GNU General Public License v3.0
26 stars 2 forks source link

Can't write IJV calibration bin file #3

Closed intjonathan closed 1 week ago

intjonathan commented 1 month ago

In section 2.7 of the IJV firmware manual, guidance is given to load their associated calibration bin file:

https://www.universirius.com/en_gb/preppers/quansheng-uv-k5-manuale-del-firmware-ijv_v3/#Firmware-IJV

Attempting to unpack or write this file with k5tool results in an error, as it's not a full firmware:

intjonathan@farnsworth K5TOOL-v1.5 % ./k5tool -wrflash ~/Downloads/Calibration-v320.bin
Opening /dev/tty.usbserial-AK06II1Z
Read packed FLASH image from /Users/intjonathan/Downloads/Calibration-v320.bin...
Unpack image...
[ERROR] InvalidOperationException: WARNING: CRC CHECK FAILED! FIRMWARE NOT VALID!
Make sure to choose a flashable bin file.

How can I write this file to my radio?

qrp73 commented 1 month ago

Calibration is stored in EEPROM memory and can be written with -wree command.

You're trying -wrflash command, which is intended to write FLASH memory. It expects firmware flash image as input file.

At a glance it looks that Calibration-v320.bin contains last 512 bytes of EEPROM with calibration data. In such case it can be written in the following way:

First make full EEPROM backup:

./k5tool -rdee

it will create eeprom-0000-2000.raw file, copy this file and store it to be able to restore original calibration and settings.

Then write calibration file:

./k5tool -wree 0x1e00 ~/Downloads/Calibration-v320.bin

Note that this command should be executed in usual mode, when radio is powered on and working as usual. Disconnect the cable, power on the radio. Connect the cable and use -wree command.

Don't confuse it with -wrflash command which should be executed when radio is staying in bootloader mode (power on with pressed PTT button).

I strongly recommend you to get full EEPROM backup before using -wree command, it allows to restore it if you want to restore original firmware or if something will going wrong.

You can backup full EEPROM with this command:

./k5tool -rdee

This command will write backup into eeprom-0000-2000.raw file.

Also you can make calibration backup file with this command:

./k5tool -rdee 0x1e00 0x0200

This command will write backup into eeprom-1e00-0200.raw file. Later you can restore calibration with this command:

./k5tool -wree 0x1e00 eeprom-1e00-0200.raw