losehu / uv-k5-bootloader-custom

a custom bootloader for uv-k5
Apache License 2.0
16 stars 1 forks source link

multi boot #1

Open joc2 opened 1 month ago

joc2 commented 1 month ago

Hi,, i am working with egzumer and f4hwn custom firmware for the uvk5, the section for the chirp driver for them, ( egzumer is integrate in chirp for few month now )

i just found out that you made a multi boot loader to load different firmware. that is very very interesting idea...

what i understand. is that the firmware is hold in a 512kb eeprom and each one is at max 60kb for the size of the flash so in memory some where you can read info in eeprom and flash it to the flash memory that the firmware run it on next boot up...

is their a place in that eeprom that you keep the hole eeprom from the custom firmware.. in the case of the egzumer and f4hwn it's 2kb eeprom for now because quansheng change their production to put a bigger eeprom

i am interesting to do (modify ) a driver for chirp to work with your firmware.

for now chirp handle all the memory of the eeprom for each firmware.

for example some firmware, change the eeprom to put a bigger one to handle many more channel ( like ijv firmware )

the question is how you manage eeprom for each firmware....

kind of A firmware 60kb + eeprom 2k, B firmware 60kb + eeprom 4k, C firmware 60kb + eeprom 8k, D firmware 60kb + eeprom 4k, E firmware 60kb + eeprom 8k, F firmware 60kb + eeprom 2k, etc...

Do you over take the address of each eeprom address.

Let say firmware A is running in flash and try to access address 0X1FF2. What is done to access eeprom by the running firmware..

let me know, i am realy interest on how to work with it...

i love the idea to have multi firmware in a single radio....

Jocelyn

losehu commented 1 month ago

Hello,

Let me explain the principle of this bootloader in detail:

Bootloader A

  1. Bootloader A (4KB)
    • Programmed using STLINK to replace the original bootloader.
    • Main functions:
      • Press MENU while powering on: Load Bootloader B from EEPROM into RAM and execute Bootloader B in RAM.
      • Press PTT while powering on: Enable firmware upgrade via the serial port.

Bootloader B

  1. Bootloader B (about 12KB)
    • Stored in EEPROM.
    • Main functions:
      • Select the firmware to load via the UI.
      • Read the selected firmware from EEPROM and write it to flash memory for the next boot.

Configuration File Management for Each Firmware

  1. Backing up individual configuration files to EEPROM for each firmware is a good idea.
  2. However, the backup process takes a long time, meaning that switching firmware would take a long time, which does not align with my design concept. Currently, switching only takes 7 seconds.
  3. The size of each firmware’s configuration file is uncertain and difficult to manage. If possible, I would only consider backing up the first 8KB of content.

EEPROM Distribution for Firmware

  1. We have developed a web page called K5WEB, which supports both Chinese and English. The URL is: https://k5.vicicode.com/#/tool/bl.
  2. We divided the EEPROM into several 40B blocks, and users can decide which blocks to store each firmware in.
  3. Our multi-firmware only supports a 512KB EEPROM because we placed Bootloader B and other firmware in the 256-512KB region.

I hope this information helps you. If you have any better suggestions, I would greatly appreciate your advice.

Best regards, losehu