sq5bpf / k5prog

Quansheng UV-K5 EEPROM programmer
GNU General Public License v3.0
145 stars 31 forks source link

Cannot read data from new Quansheng UV-K5(8) radio #27

Open qrp73 opened 4 months ago

qrp73 commented 4 months ago

I have two UV-K5(8), the first one was ordered before new year (2024) and k5prog can read it ok. The second one I ordered two weeks ago and it looks exactly the same, but k5prog cannot read it.

Both are ordered from the same seller on aliexpress.

Here is the log from the second radio:

$ ./k5prog -r -v
Quansheng UV-K5 EEPROM programmer v0.9 (c) 2023 Jacek Lipkowski <sq5bpf@lipkowski.org>

k5_prepare: try 0
** the protocol actually uses proper crc on datagrams from the radio, please inform the author of the radio/firmware version
********  k5 command hexdump [obf_len:16 clear_len:10 crc_ok:0 **********
## obfuscated ##

0x000010 |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |a |b |c |d |e |f |
---------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+------------
0x000000: ab cd 08 00 02 69 10 e6 44 a8 5a 24 b9 a9 dc ba   .....i..D.Z$....   
## cleartext ##

0x00000a |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |a |b |c |d |e |f |
---------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+------------
0x000000: 14 05 04 00 6a 39 57 64 98 9c                     ....j9Wd..         
*****************
cmd: 14 05 ok:0
******  Connected to firmware version: [j9Wd��]
** the protocol actually uses proper crc on datagrams from the radio, please inform the author of the radio/firmware version
********  k5 command hexdump [obf_len:20 clear_len:14 crc_ok:0 **********
## obfuscated ##

0x000014 |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |a |b |c |d |e |f |
---------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+------------
0x000000: ab cd 0c 00 0d 69 1c e6 2e 91 8d 40 4b 0c 82 24   .....i.....@K..$   
0x000010: 56 ec dc ba                                       V...               
## cleartext ##
...
...

it reads incorrect k5_eeprom.raw which consists some repeating pattern: 20240509_07h18m56s_grim

Any idea what is wrong? How to fix it?

qrp73 commented 4 months ago

After several attempts. I tried to enter to flash mode (power with pressed TX) and then tried again but after some attempts it stopped to respond on k5prog -r -v requests at all.

Now I got this:

$ ./k5prog -r -v
Quansheng UV-K5 EEPROM programmer v0.9 (c) 2023 Jacek Lipkowski <sq5bpf@lipkowski.org>

k5_prepare: try 0
read_timeout
k5_receive: err read1
k5_prepare: try 1
read_timeout
k5_receive: err read1
k5_prepare: try 2
read_timeout
k5_receive: err read1
k5_prepare: try 3
read_timeout
k5_receive: err read1
k5_prepare: try 4
...

The radio works, but no way to read it with k5prog...

My old radio (bought before new year) works ok:

$ ./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

Both radio has the same version printed on PCB: R51-V1.6 ZH18. But there is different production date on the PCB and on sticker under battery: 2333 on PCB / 2023.10 on sticker - works ok with k5prog 2342 on PCB / 2024.01 on sticker - don't works with k5prog

Any idea what is wrong with new UV-K5(8) radio?

qrp73 commented 4 months ago

just wrote my own implementation of protocol to read/write eeprom. Carefully analyzed logs from first connection. It appears that the new UV-K5 just worked as echo feedback, there is no sign of response on protocol requests. The radio just don't respond at all when radio is powered in usual mode.

But when I enter into flashing mode, it sends flasher message:

rx: abcd24000e6934e62f930e422d669f735e40168f656cb9e61cbf3d700f05e3402709e980166c14c6ffffdcba
WARN: Decode: crc=0x86eb, expected=0x6ed1
RX: 18052000010203020c534a334d43ff0f7300ad00322e30302e303600340a000000000020
recv PacketAckFlasher {
  HdrSize=32
  Version="2.00.06"
  Data=01 02 03 02 0c 53 4a 33 4d 43 ff 0f 73 00 ad 00
}
rx: abcd24000e6934e62f930e422d669f735e40168f656cb9e61cbf3d700f05e3402709e980166c14c6ffffdcba
WARN: Decode: crc=0x86eb, expected=0x6ed1
RX: 18052000010203020c534a334d43ff0f7300ad00322e30302e303600340a000000000020
recv PacketAckFlasher {
  HdrSize=32
  Version="2.00.06"
  Data=01 02 03 02 0c 53 4a 33 4d 43 ff 0f 73 00 ad 00
}

Official software also cannot connect. Official flasher can see flashing mode, but fails to upload firmware.

I suspect it can send data to PC, but cannot receive data from PC. Any idea how to check it?

qrp73 commented 2 months ago

the issue happens because RX UART line on UV-K5 radio don't works for some unknown reason and the radio is unable to listen communication requests from PC.

CyberPingU commented 1 month ago

Hi @qrp73 , did you have any luck with this new version? I'm stuck on the same issue (I'm not able to analyse code, I'm not a programmer): the rtx just doesn't answer.

qrp73 commented 1 month ago

Hi @qrp73 , did you have any luck with this new version? I'm stuck on the same issue (I'm not able to analyse code, I'm not a programmer): the rtx just doesn't answer.

if it sends bootloader beacon packet, but don't respond on requests, the radio is defective, RX line on radio UART just don't works. It maybe due to bad connector, or due to broken chip.

You can try my all-in-one tool for UV-K5 radio - K5TOOL, it has more detailed logging and allows read/write eeprom, write flash, pack and unpack firmware, and some more:
https://github.com/qrp73/K5TOOL