Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firmware version barf #127

Open
jeffgi opened this issue Feb 25, 2024 · 10 comments
Open

firmware version barf #127

jeffgi opened this issue Feb 25, 2024 · 10 comments

Comments

@jeffgi
Copy link

jeffgi commented Feb 25, 2024

It's not a bug per se but I think I have an issue for uvk# radios going forward. I'm working with a recent uv-k6 from Amazon and a uv-k5(99) fresh from China. I suspect that the latest OEM firmware shipping is incompatible with establish protocols.

UVMod downloads firmware images. Both radios have the same 58,674 bytes firmware.
UVMod and several other modder softwares barf very early reporting No data received.

Python proves that drivers and cables are working. fwversion_read bombs with:
C:\jg\git2\amn02\Quansheng_UV-K5_Firmware\python-utils>python fwversion_read.py COM3
uvk5.uart_receive_msg<raw< abcd0800026910e6680d6224950bdcba
uvk5.uart_receive_msg<dec< abcd080014050400469c6f64b43edcba
Traceback (most recent call last):
File "C:\jg\git2\amn02\Quansheng_UV-K5_Firmware\python-utils\fwversion_read.py", line 14, in
print(radio.get_fw_version())
^^^^^^^^^^^^^^^^^^^^^^
File "C:\jg\git2\amn02\Quansheng_UV-K5_Firmware\python-utils\libuvk5.py", line 127, in get_fw_version
return reply[8:].split(b'\0', 1)[0].decode()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9c in position 1: invalid start byte

i comment out line 21 of configmem_read and get:
uvk5.uart_receive_msg<raw< abcd0c000d691ce66e9e054067a9ba2421ebdcba
uvk5.uart_receive_msg<dec< abcd0c001b050800400f0800469c6f6432e8dcba
469c6f64

firmware_read.py is incompatible with 58,674 bytes firmware?
if 469c6f64 is a reasonable configmem, successful fwversion_read is no longer a prerequisite in configmem_read (and other readers)?

@jeffgi jeffgi changed the title firmware version baf firmware version barf Feb 25, 2024
@amnemonic
Copy link
Owner

If there is no new version of firmware updater then it will be necessary to dump firmware using openocd to know if protocol changed or if 469c6f64 is indeed proper version number. Please check what version do you see in CPS software?
Clipboard01

@jeffgi
Copy link
Author

jeffgi commented Feb 27, 2024 via email

@jeffgi
Copy link
Author

jeffgi commented Feb 27, 2024

from sq5bpf k5prog:
"... firmware version number is 16 bytes at 0x2000"
"if we send a * as the first char, then all known boot loaders will accept it"

so all modded bin files must have an '*' at 0x2000?

my current thought is to write a special byte (obfuscated and/or xor-ed) to 0x2000?

@amnemonic
Copy link
Owner

reveal that the basic abcdXXXdcba structure is preserved

exactly! which rules out bad cable etc.
Can you try CPS in version 1.0.41?

@jeffgi
Copy link
Author

jeffgi commented Feb 28, 2024

i got 1.0.40 from China download two days ago. not sure where to get .41 and not sure what new it might tell us.

is true:
"... firmware version number is 16 bytes at 0x2000"
"if we send a * as the first char, then all known boot loaders will accept it"
?

I'm looking for workable values to write 16 bytes starting at 0x2000 to current problem radios.

@amnemonic
Copy link
Owner

not sure where to get .41

Link to v1.0.41 is right in my previous reply.

not sure what new it might tell us

It can tell us if XOR key has changed as it looks like it might be the case.

is true
"... firmware version number is 16 bytes...

yes, that is true however if firmware upgrade application is not able to recognize version then it probably would not flash it or what is worse - will flash it incorrectly thus bricking it.

I'm looking for workable values to write 16 bytes starting at 0x2000 to current problem radios.

I would rather like to try to find cause of this problem and then think about proper solution.

@jeffgi
Copy link
Author

jeffgi commented Feb 28, 2024

thx. I read the .41 text and didn't notice it was also a link. my bad, sorry.

downloaded and un-rarred. two *.exe files with same English name ending with two different Chinese characters
ran both and both say
"
Launcher Error
Unable to open archive
"

@jeffgi
Copy link
Author

jeffgi commented Feb 28, 2024

firmware XOR change would explain my observations. if so, it would require two CPSs which might explain two CPSs in the .41 zip? Did you get either to run?

@amnemonic
Copy link
Owner

You must rename *.exe files and remove Chinese characters from filename, then it works fine :)

@jeffgi
Copy link
Author

jeffgi commented Feb 29, 2024

thanks. rename allows install of two CPSs (just for the record, one Chinese chars, other English chars)
v1.0.40 from May 2023 gives same results as v1.0.41 from June, 2023: "Radio connection fail"
CPS from early 2023 are uninformative regarding a oem firmware build from Nov 2023.
XOR still a good theory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants