I am experimenting with some changes to the programming behavior, I will test it further on real hardware tomorrow.
Nothing radical, just that I introduced an approx. 4 sec delay to the user requested flashing. So when you call the bootloader to flash a new .uze, it will first show the empty progress bar for a little more than 4 seconds, and only then starts programming.
I also added a small delay (< 1secs) after programming before starting the game, so you can have an impression of the completed progress bar (which carries some info, like how much actual programming happened).
In total, this means that there is at least 5-7 seconds between each programming even if you wrote something (a pair of .UZE files) which tries to kill the ATMega, anyway, so there is time to pull the plug (it would demand almost a day to destroy the ATMega at this rate if it survived only 10K cycles).
I am doing some tests tomorrow still not because anything could be wrong here, rather to see how it looks like on actual television (including losses of sync).
Uzebox Bootloader V5
Re: New bootloader
I finalized the changes, version is updated on the top post (5.0.09).
You may try how user-requested flashing looks like by downloading the API demo from a previous post.
If you find this bootloader OK, I will introduce this onto the master (Alec accepted it, so I guess now it is all set for the transition). Only 4 bytes free
You may try how user-requested flashing looks like by downloading the API demo from a previous post.
If you find this bootloader OK, I will introduce this onto the master (Alec accepted it, so I guess now it is all set for the transition). Only 4 bytes free
Re: New bootloader
Sweet! That seems like a good compromise. I'm excited to try this, hopefully I'll get the chance soon.
Re: New bootloader
I added the bootloader to Master (under the name "Bootloader5"). Hopefully it works fine for everyone then! There are no changes, it is the same 5.0.09 version which is available to download from the top post here, but I didn't exactly receive much reinforcements on whether it works well on actual hardware. On my Uzeboxes it works fine of course.
Re: New bootloader
If a program sets up an external interrupt, then uses the bootloader API to flash a different .uze file, will that interrupt still work? Or does it clear all the interrupts while flashing?
(I'm still kinda a noob when it comes to the AVR architecture )
(I'm still kinda a noob when it comes to the AVR architecture )
Re: New bootloader
It won't work for two reasons.
First, when you pass over to the bootloader, it immediately disables all interrupts, then starts the bootloader's init sequence. The bootloader starts like normal, the API function just copies off the structure you pass to it to a safe spot in RAM where it can access it later. The bootloader has its own interrupt vector table (at 0xF000, beginning of the bootloader), so once it enables interrupts, your vector is not there.
Secondly, the bootloader of course programs the new .uze image, overriding the old one. Not wholly, only to the size of the .uze, but this still means that you interrupt handler (at least its initial jump) is gone. You could do tricks though by writing an incomplete .uze which requires data within the upper end of the game area in Flash, but this possibly have no much practical use.
Re: New bootloader
I have finally have a chance to install and play with your bootloader. I have to say I'm quite impressed and happy about it. Moreover it can read without issues a batch of cheap cards I've received and that totally fails to init with the current bootloader. So I will be testing it thoroughly and plan to use it for the next batch of kits.
Two comments:
Two comments:
- Is there any way to makes the clicks when moving the cursors more "soft" like in the current bootloader? On my monitor they are a bit irritating.
- How hard would it be to have an auto-repeat on up/down when using the cursor?
Re: New bootloader
That "click" was a dirty hack, however I could discover a more elaborate dirty hack to get something milder in the same ROM space: https://github.com/Jubatian/uzebox/tree/boot5010uze6666 wrote: ↑Thu Jan 18, 2018 9:09 pm I have finally have a chance to install and play with your bootloader. I have to say I'm quite impressed and happy about it. Moreover it can read without issues a batch of cheap cards I've received and that totally fails to init with the current bootloader. So I will be testing it thoroughly and plan to use it for the next batch of kits.
Two comments:Awesome work Jubatian!
- Is there any way to makes the clicks when moving the cursors more "soft" like in the current bootloader? On my monitor they are a bit irritating.
- How hard would it be to have an auto-repeat on up/down when using the cursor?
Check it out, if you agree that it is more pleasant, I will merge this.
I gave some thoughts to the auto-repeat (it didn't came in my mind this far, usually I bounced the button anyway even in the old bootloader as it was faster than waiting for the repeats to come). Along with the audio modification, I could free up 4 bytes, so I have now 8 bytes, 4 instructions. I couldn't discover any hack which could get such a functionality done in that. Moreover what I wouldn't like is if a held-down button for bootloader entry was interpreted as an user action (due to an autorepeat), which would require even more code to filter out. So for now I would rather pass this one, as I think it is still more user-friendly without it (that is, if there was no way to avoid registering a held-down button as a repeating press on startup).
Re: New bootloader
Huh, sorry, if you are worrying about compiling it yourself, here I provide a .hex for it. You shouldn't worry about it, though, it is full assembly, so it is completely deterministic, you would get the same bootloader binary. I just forgot that I should have provided one.
(If you like it, this will be the 5.0.10 version, otherwise just a test, don't save it yet)
(If you like it, this will be the 5.0.10 version, otherwise just a test, don't save it yet)
- Attachments
-
- Bootloader5.hex
- Using a different "click" sound.
- (11.28 KiB) Downloaded 402 times