intechstudio / knot

GNU General Public License v3.0
42 stars 5 forks source link

Display the version number of the current firmware in INFO_UF2.TXT #11

Closed jmickelin closed 7 months ago

jmickelin commented 7 months ago

The contents of the INFO_UF2.TXT file that shows up when the device is mounted for firmware updating currently looks something like this

TinyUF2 Bootloader ca0cacd - tinyusb (0.12.0-203-ga4cfd1c69)
Model: Intech Studio Knot
Board-ID: ESP32S3-Knot
Date: Sep  7 2022

It can be a bit unclear that the version number, date and ref hash correspond to the version of the bootloader and not that of the firmware itself. After updating my firmware (using mostly guesswork since there aren't any instructions as of me writing this), I thought I could confirm whether the update had worked by seeing if the contents of the INFO_UF2.TXT had updated, and had to do a double take when I discovered they hadn't.

Adding a second set of lines describing the firmware version would therefore help.

(What I ended up doing was to copy the CURRENT.UF2 file to my system and reading the top of the file in a hex editor, to reveal the version information:

$ xxd CURRENT.UF2
[...]
00000090: 3131 3a33 383a 3131 0000 0000 0000 0000  11:38:11........
000000a0: 4a75 6c20 3138 2032 3032 3300 0000 0000  Jul 18 2023.....
000000b0: 7635 2e32 2d64 6576 2d31 3733 362d 6761  v5.2-dev-1736-ga
000000c0: 3264 3736 6164 3338 6100 0000 0000 0000  2d76ad38a......
[...]

It works, but it's not very ergonomic.)

jmickelin commented 7 months ago

I see now that the bootloader info is created by TinyUF2 and not trivially extendable with more information, at least not information that can be changed when just flashing new firmware and leaving the bootloader untouched. After some investigation, this is also the case for the contents of the INDEX.HTM file...

I will close this as WONTFIX, unless you disagree :)