New bootloader

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
Artcfox
Posts: 1026
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: New bootloader

Post by Artcfox » Tue Jun 09, 2020 4:56 pm

nicksen782 wrote:
Tue Jun 09, 2020 3:38 pm
I have not been able to play Tornado on real hardware. I have played it on the emulators though. I would really like to play it on a real tv.

So, there is a new bootloader that will support Tornado and a new update to Tornado too?

Uze (or whomever knows for certain) what should the fuses be set to?
Yes! Using SDHC cards.

The new bootloader (5.0.12) lives in this directory of the official Uzebox repository:

Code: Select all

uzebox/demos/Bootloader5
(Make sure you do a git pull, since there were recent changes.)

The new Tornado 2000 that supports SDHC cards can be found in this post and the data file it needs can be downloaded here.

Once you build the bootloader, you can flash it onto a Uzebox using:

Code: Select all

avrdude -c avrispmkII -P usb -p m644 -U flash:w:Bootloader5.hex
And then flash the fuses with:

Code: Select all

avrdude -c avrispmkII -P usb -p m644 -U hfuse:w:0xd2:m -U lfuse:w:0xf7:m -U efuse:w:0xfc:m
If you aren't using an AVR ISP mkII, then change the:

Code: Select all

avrispmkII
to whatever the avrdude name of your programmer is.

IIRC, changing that extended fuse raises the brownout detection to 4.5V, so the chip doesn't come out of reset until the power is more stable. (It helped my original Uzebox from a kit get a more reliable video signal when powering it on with the new bootloader.) I'm not sure what the impact of having that level of brownout detection on the Uzebox Portable is, but so far mine has been running fine with it. I just hope that it's still below the level where the low battery LED comes on. If you don't want to mess with the brownout detection, then you can leave off the:

Code: Select all

 -U efuse:w:0xfc:m
part of that command.

If you are reflashing this bootloader on a Uzebox DTV, you will have to change the device name in the above commands to:

Code: Select all

m644p
and FYI, the ICSP pinouts for the Uzebox DTV are: GND, VCC, RESET, SCK, MISO, MOSI with GND being the pin closest to the uSD card.
Last edited by Artcfox on Thu Jun 11, 2020 4:35 am, edited 1 time in total.

User avatar
Jubatian
Posts: 1469
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: New bootloader

Post by Jubatian » Tue Jun 09, 2020 9:31 pm

Those fuses indeed might need some thought, seems to me you (Artcfox) are leaning towards keeping it safe (selecting longer startup delays and adding the BOD), which in fact is a good idea! Especially due to the thing being overclocked.

On normal Uzeboxes (using the DIP ATmega) either the 644 or the 644p can occur, whichever chip you happen to have (ATmega644 and ATmega644A are 644, while ATmega644P and ATmega644PA are 644p, tried all four at some point, either works).

Setting the BOD might be reasonable not only for the startup, but since it just can not really be expected that the MCU runs okay almost 1.5 times its rated frequency at lower power. The startup delays (for frequency stabilization) might be interesting to tweak as shortening them (BOD only, no extra milliseconds) can allow for smoother transition between bootloader and game (depending on display).

User avatar
Artcfox
Posts: 1026
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: New bootloader

Post by Artcfox » Sat Jun 13, 2020 10:12 pm

I was messing around with different themes for the new Bootloader, and I think I finally settled on the one to use for my D3thAdd3r-themed Uzebox, and Uzebox Portable:
Screenshot from 2020-06-12 15-01-37.png
Screenshot from 2020-06-12 15-01-37.png (15.61 KiB) Viewed 1050 times
IMG_20151120_231400.jpg
IMG_20151120_231400.jpg (110.25 KiB) Viewed 1050 times
Here is a diff against the latest Bootloader5 from the main Uzebox repo. (It also corrects the capitalization of "Uzebox" in the bootloader.)

Code: Select all

diff --git a/demos/Bootloader5/graphics.s b/demos/Bootloader5/graphics.s
index 941c764..5352eb1 100644
--- a/demos/Bootloader5/graphics.s
+++ b/demos/Bootloader5/graphics.s
@@ -177,7 +177,7 @@ Graphics_InitPal:
 
 Graphics_paldata:
        .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-       .byte 0xAD, 0xB6, 0xB7, 0xFF, 0xFF, 0xB7, 0xB6, 0xAD
-       .byte 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-       .byte 0x01, 0x0A, 0x0B, 0x13, 0x13, 0x0B, 0x0A, 0x01
+       .byte 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F
+       .byte 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+       .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
diff --git a/demos/Bootloader5/res.s b/demos/Bootloader5/res.s
index 7fa37ab..e56c8b5 100644
--- a/demos/Bootloader5/res.s
+++ b/demos/Bootloader5/res.s
@@ -221,7 +221,7 @@ RGCR_data_empty:
        .byte ' ' - 32, 'C' - 32, 'a' - 32, 'r' - 32, 'd' - 32
 
 RGCR_data_title:
-       .byte 'U' - 32, 'z' - 32, 'e' - 32, 'B' - 32, 'o' - 32, 'x' - 32, ' ' - 32, 'G' - 32
+       .byte 'U' - 32, 'z' - 32, 'e' - 32, 'b' - 32, 'o' - 32, 'x' - 32, ' ' - 32, 'G' - 32
        .byte 'a' - 32, 'm' - 32, 'e' - 32, ' ' - 32, 'L' - 32, 'o' - 32, 'a' - 32, 'd' - 32
        .byte 'e' - 32, 'r' - 32, ' ' - 32, ' ' - 32, ' ' - 32, ' ' - 32, ' ' - 32, ' ' - 32
        .byte 'V' - 32, '.' - 32
And I've also attached a Bootloader5.hex file.
Attachments
Bootloader5.hex
(11.29 KiB) Downloaded 23 times

User avatar
Jubatian
Posts: 1469
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: New bootloader

Post by Jubatian » Sun Jun 21, 2020 12:47 pm

Artcfox wrote:
Sat Jun 13, 2020 10:12 pm
I was messing around with different themes for the new Bootloader, and I think I finally settled on the one to use for my D3thAdd3r-themed Uzebox, and Uzebox Portable:
Nice! Glad to see it is hackable enough to pull of such tweaks! :)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests