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: 159
Joined: Mon May 22, 2017 6:01 am

Bootloader Update Utility for 5.0.xx Bootloaders

Post by ry755 » Sat Apr 16, 2022 2:09 am

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 14 times

User avatar
D3thAdd3r
Posts: 2483
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Bootloader Update Utility for 5.0.xx Bootloaders

Post by D3thAdd3r » 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.

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: 159
Joined: Mon May 22, 2017 6:01 am

Re: Bootloader Update Utility for 5.0.xx Bootloaders

Post by ry755 » Sun Apr 17, 2022 9:16 pm

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: 2483
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Bootloader Update Utility for 5.0.xx Bootloaders

Post by D3thAdd3r » Wed Apr 20, 2022 3:54 pm

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:

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests