Bootloader Update Utility for 5.0.xx Bootloaders

Topics on software tools like TileStudio, comments on documentation and tutorials (or the lack of) should go here.
Post Reply
User avatar
ry755
Posts: 225
Joined: Mon May 22, 2017 6:01 am

Bootloader Update Utility for 5.0.xx Bootloaders

Post by ry755 »

This is a little utility I made a couple years ago that I never posted here, that allows you to upgrade/downgrade your bootloader as long as you are already running some version of 5.0.xx. It works based on the fact that all 5.0.xx bootloaders have their `Prog_Page` routine stored at 0xFFAA.

SPIRAM is required, as this utility first copies the file from the SD card into SPIRAM to prevent any SD card read issues during the update.

Usage:
Bootloader Update expects a file called "blupdate.bin" on the SD card. This must be a binary file, so if you have a .hex file then it must be converted first, which can be done using objcopy:

Code: Select all

avr-objcopy -I ihex Bootloader5.hex -O binary blupdate.bin
A very basic form of error recovery is available, if verification fails then it will ask to retry.
This utility has been tested many times and has always worked for me, but in the event that something fails, a hardware flasher can always be used.

Demo:


Source:
https://github.com/ry755/bootloader-update
Attachments
bootloader-update.uze
(17.33 KiB) Downloaded 181 times
User avatar
D3thAdd3r
Posts: 3175
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Bootloader Update Utility for 5.0.xx Bootloaders

Post by D3thAdd3r »

I haven't tried this out yet, but it sure is a good idea. This should be in the main codebase I think. Should probably be on any SD that gets shipped with a kit too.

A bit off topic, but could a similar method overwrite arbitrary user flash pages also, or just the boot loader area?
User avatar
ry755
Posts: 225
Joined: Mon May 22, 2017 6:01 am

Re: Bootloader Update Utility for 5.0.xx Bootloaders

Post by ry755 »

D3thAdd3r wrote: Sun Apr 17, 2022 7:39 am I haven't tried this out yet, but it sure is a good idea. This should be in the main codebase I think. Should probably be on any SD that gets shipped with a kit too.
Thank you!! :D
D3thAdd3r wrote: Sun Apr 17, 2022 7:39 am A bit off topic, but could a similar method overwrite arbitrary user flash pages also, or just the boot loader area?
Yes, it would work for flashing anywhere, see this file for details: https://github.com/Uzebox/uzebox/blob/m ... er5/prog.s
User avatar
D3thAdd3r
Posts: 3175
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Bootloader Update Utility for 5.0.xx Bootloaders

Post by D3thAdd3r »

Cool, thanks for the info.

Since it uses SPI ram, there would be a good chance the user has an ESP8266 as well. If it was interesting enough to do, it would seem possible to have a file http://uzebox.org/blupdate.bin which always contains the latest bootloader. A simple http downloader could then fill SPI ram. Alternatively, a separate ROM that downloads files given a list in EEPROM or SD might make more sense.

Feature ideas are a dime a dozen of course, implementation is a bit more time consuming :roll:
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Bootloader Update Utility for 5.0.xx Bootloaders

Post by Artcfox »

Woah! I haven't tried it myself, but this would be great to update the bootloaders on several Uzebox DTVs, and on my main console without having to open it up.
Post Reply