Uzebox SD Gameloader V0.4.5
- DaveyPocket
- Posts: 378
- Joined: Sun Sep 14, 2008 8:33 pm
- Contact:
Re: Uzebox SD Gameloader Alpha...at last!
I haven't been able to try this out yet(I still haven't installed the 3 volt regulator and the SD card socket on my Uzebox yet), but it looks great. Now I have a question; Is it possible to update the bootloader through the bootloader?
Re: Uzebox SD Gameloader Alpha...at last!
Im not sure. But I'm sure someone knows.I haven't been able to try this out yet(I still haven't installed the 3 volt regulator and the SD card socket on my Uzebox yet), but it looks great. Now I have a question; Is it possible to update the bootloader through the bootloader?
But we can always put another chip on the uzebox, and have that chip be a dedicated programmer for the first one.
Of course, that seems kind difficult when you can just reflash the bootloader.
>J
Lerc wrote:I intend to use my powerful skills of procrastination to ensure that when I get to making things, the chips will be available.
Re: Uzebox SD Gameloader Alpha...at last!
The SPM instruction can reprogram the whole flash including the bootloader area. However reprogramming mean reading 4K from the SD card using code stored in the same flash you are trying to reprogram. It's kinda chicken and egg problem... So it's possible but indeed very tricky.Now I have a question; Is it possible to update the bootloader through the bootloader?
-Uze
Re: Uzebox SD Gameloader Alpha...at last!
We did something like this on a commercial project to allow full firmware upgrade. As Uze says, it is possible, but it is a bit of a risky shell game (relocate the bootloader to rewrite the bootloader flash, etc, check checksums, possibly revert, etc).DaveyPocket wrote:Is it possible to update the bootloader through the bootloader?
Very convenient for us developers once we got it working though! Plug in the USB drive with the new image and reboot...repeat a dozen times for all prototype devices and you're off to the races.
-braddock gaskill
Re: Uzebox SD Gameloader Alpha...at last!
Won't the whole bootloader fit into RAM, as it is now?However reprogramming mean reading 4K from the SD card using code stored in the same flash you are trying to reprogram.
Can you store in RAM the code for reading SD cards, but keep out the code for i/o, and then execute the SD card copy from RAM?
>J
Lerc wrote:I intend to use my powerful skills of procrastination to ensure that when I get to making things, the chips will be available.
Re: Uzebox SD Gameloader Alpha...at last!
Not that easy since you need some RAM for variables and the call stack. A 512 bytes buffer is also require hold SD sector data.
-Uze
-Uze
Re: Uzebox SD Gameloader Alpha...at last!
Ok,
what if we dump the eeprom on to the SD card, copy the first half of the new bootloader to the eeprom, and write the first half of the bootloader to the Program Mem. then repeat for the second half, and restore the EEPROM.
>J
Edit: when I say "we", again I mean you and Pragma
EDIT2:
what if we dump the eeprom on to the SD card, copy the first half of the new bootloader to the eeprom, and write the first half of the bootloader to the Program Mem. then repeat for the second half, and restore the EEPROM.
>J
Edit: when I say "we", again I mean you and Pragma
EDIT2:
Or just have the EEPROM be the buffer.512 bytes buffe
Lerc wrote:I intend to use my powerful skills of procrastination to ensure that when I get to making things, the chips will be available.
Re: Uzebox SD Gameloader Alpha...at last!
Great work, its make uzebox more complete game station (and it was great before) and love to see the code of bootloader
It really make it easy swap between games and demos, how ever reset commando from joy pad don't seem to work on all application "check for a reset condition (a+b+select+start)".
If you really want to upgrade bootloader from SD-card you can have small area (block that won't be eras) that you call from program space and not from bootloader space exmpel:
or somethings like that.
then you only have to copy new bootloader from program space and not from SD.... so it (I believe) pretty easy.
It really make it easy swap between games and demos, how ever reset commando from joy pad don't seem to work on all application "check for a reset condition (a+b+select+start)".
If you really want to upgrade bootloader from SD-card you can have small area (block that won't be eras) that you call from program space and not from bootloader space exmpel:
Code: Select all
//program space
..
#define bspm 0x7ff0
call bspm
..
//botloader space
.org 0x7ff0
bspm:
spm
ret
then you only have to copy new bootloader from program space and not from SD.... so it (I believe) pretty easy.
Re: Uzebox SD Gameloader Alpha...at last!
Yes, I had an issue at one point with the reset code, it would reboot the console indefinitely if no joystick was plugged in. So it was commented out. It indeed should be fixed as I realized myself it's a bit annoying having to get up and hit the reset button each time I want to switch game. Still, it's a lot less annoying than having to get up to my work room to reprogram each game... I'll add it to the todo list on the wiki.how ever reset commando from joy pad don't seem to work on all application "check for a reset condition (a+b+select+start)"
Btw, not sure I fully grasped what you meant, but I think it's a very interesting idea you got concerning the reprogramming of the bootloader from SD. Pre-flashing the bootloader in lower memory would waste a rewrite cycle but that doesn't happen so often so it's no big deal. It would allow to pre-load everything, then require only a few instructions to flash almost all the bootloader from regular memory. I feel it's the way to go.
Onto another subject. One thing I wondered for a while. To the Fuzeboxers outhere: you guys are using the FTDI cable to flash the chip...to use this bootloader you'd have 2 choices. 1.Buy a SPI programmer or 2.buy a new mega644 with our new super-duper bootloader and *ideally* FTDI support also (but definitively not guaranteed). What would you go for (considering an SPI programmer is reusable for any future atmeaga project you'd like in the future)??
-Uze
Re: Uzebox SD Gameloader Alpha...at last!
I have a Fuzebox, but I also have an SPI programmer.uze6666 wrote: Onto another subject. One thing I wondered for a while. To the Fuzeboxers outhere: you guys are using the FTDI cable to flash the chip...to use this bootloader you'd have 2 choices. 1.Buy a SPI programmer or 2.buy a new mega644 with our new super-duper bootloader and *ideally* FTDI support also (but definitively not guaranteed). What would you go for (considering an SPI programmer is reusable for any future atmeaga project you'd like in the future)??
I really don't see any great need for FTDI support. It would be a nice extra, but I think most people would find SD support more useful. I always viewed the FTDI bootloader as just a placeholder for the SD support.