Closed BackMountainDevil closed 10 months ago
configmem_dump wired, may be it's that I mess the meaning of that file. I mistake it used for dump firmware.
yes, it is used to dump configuration memory which is in EEPROM chip, dump firmware is possible only via SWD pads on PCB.
can I use a python script to flash firmware?
I was planning to add this option but after time I forgot about this. I've prepared this method which was intended to do the task. However finally I've decided to use official flashing app as it is safer.
piotr022/UV_K5_playground has a mem-map show start at 0x10C0(or Ox1000). But your docs shows flash start at 0x0F000 and end at 0x0FFFF
good point, when I was creating my memory map there was no possibility to "look" inside chip using SWD yet and firmware dumps, boot loader etc was obtained using modified functions running in firmware stock firmware, and the thing is that in FLASH memory of MCU boot loader is located at 0x0000
and regular firmware at 0x1000
but when boot process finishes then flash memory is remapped and then regular firmware is accessible at 0x0000
and bootloader at 0xF000
Thank you for your kindly reply. I think it is safer to use official flashing app before figure out the address. I think use dnSPY to dive into English version flashing app a good way to find the address and size limit. Maybe I will not dive into it. If I dive, I will reply again. Thanks for your work again.
@BackMountainDevil If you need only to find a way flashing the firmware on Linux, I just found this repo: https://github.com/sq5bpf/k5prog which does this task well for me.
I did that like this:
# fw.py is from https://github.com/fagci/qs-uvk5-firmware-modder
~/open-source/qs-uvk5-firmware-modder main ?2 ❯ ./fw.py dec ../UV-K5-Modded-Firmwares/k5_v2.01.19_mod_TX_50to850mhz.bin > ../k5prog/fw
Version: 2.01.19
~/open-source/qs-uvk5-firmware-modder main ?2 ❯ cd ../k5prog
~/open-source/k5prog main ?2 ❯ make && ./k5prog -F -YYY -b ./fw
<outputs while flashing>...
@bczhc Thank you for kindly reply. happy to know there is a way.
get_version, adc_read, batt_calibrator, reboot_radio, configmem_dump, configmem_read, configmem_write are tested and work good
configmem_dump wired, may be it's that I mess the meaning of that file. I mistake it used for dump firmware.
ps: can I use a python script to flash firmware? I tried use dnSPY to find out the address, lengeth, baudrate but failed cz I am not good at dnSPY. Good news your code shows the baudrate is 38400. piotr022/UV_K5_playground has a mem-map show start at 0x10C0(or Ox1000). But your docs shows flash start at 0x0F000 and end at 0x0FFFF
detail: