Ralim / IronOS

Open Source Soldering Iron firmware
https://ralim.github.io/IronOS/
GNU General Public License v3.0
7.14k stars 712 forks source link

Custom boot logo - simpler conversion to binary format #798

Closed OndroNR closed 2 years ago

OndroNR commented 3 years ago

This is a [Question/Proposal]

What is purpose of repeating boot logo bitmap until INTELHEX_MINIMUM_SIZE is reached? I would like to use lightweight hex2bin.py instead of tool from RISCV toolchain, but hex2bin.py complains about data overlap. Removing duplicated data and converting with hex2bin.py results in same binary file as using riscv64-unknown-elf-objcopy. Even better would be if img2ts100.py produced binary file directly.

Boot logo bitmap is repeated 4 times in .hex file. hex2bin.py tool complains about data overlap. ERROR: bad HEX file: Hex file has data overlap at address 0x800F800 on line 66

Boot logo bitmap is present only once in .hex file

  1. python3 img2ts100.py 001_PINECIL.png 001_PINECIL.hex
  2. hex2bin.py 001_PINECIL.hex 001_PINECIL.hex.hex2bin

Using hex2bin.py from intelhex python package instead of tool from full RISCV toolchain.

macOS Mojave, Pinecil

Ralim commented 3 years ago

Hello,

The duplication is because of the miniware devices, as their bootloader has a minimum file size check.

It should be quite doable to just add a flag to the python code to directly output the binary however.

Ralim commented 3 years ago

Addionally, you can use basically any objcopy to do this as far as i'm aware so you could use any others you have on your system already for this. Using the riscv one is just reccomended as you most likely already have it if you are messing with the Pinecil firmware.

OndroNR commented 3 years ago

Well, for custom boot logo I don't need to compile firmware. I will look into modifying img2ts100.py, so it could output binary directly. Should it be format flag, or autodetection by file extension?

OndroNR commented 3 years ago

Just more thoughts about Intel HEX and Miniware:

Ralim commented 3 years ago

does repeating boot logo binary in hex file wear out flash memory area faster?

Unknown; have not decompiled their bootloader. I would expect that yes it does a few more cycles out of the thousands we have. People tend to reflash the firmware more than the logo.

could we replace duplicate content with spammy "no-op" records, like "Extended Linear Address" or "End Of File" (more than once at the end, against the spec)?

You are welcome to try, but given how amazingly bad their bootloader is, I would suspect that we cant.

cybernesto commented 2 years ago

I think this issue got solved with #1178. Can it be closed?