-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine all different firmwares in FLASH #39
Comments
Hi, being able to do that would be amazing. If you have any code examples I'd be very interested! |
Ok, I will create a demo project and put in on public GIT and give you the link. |
Here it is: https://github.com/jeroentaverne/pico_multi_firmware |
Hi! Amazing job, @jeroentaverne I did a quick-and-dirty mix of your work and polpo's code and got a working multi-firmware picogus (6 firmwares) and modified pgusinit to manage it.
The pg-multi.uf2 must be flashed via USB to the pico ( Once flashed, to change between modes (firmwares), use:
On cold boot, the default firmware is always GUS. If I get some time I'll upload the (ugly) code changes somewhere. |
I do not own a picogus yet to try it. I will order a few soon. :-) |
Hey @smymm I tried writing your firmware to my picogus (the v2.0 hardware) via USB but it fails to write, after copying the uf2 file over the statuslight on the picogus continually flashes and then when it's in the system pgusinit always just says picogus not found. If there's anything I can do to help debug let me know. This is such a fantastic feature for a fantastic card |
@smymm that's amazing! I'd love to see your code, even if it's ugly. I love ugly code! 😄 I definitely see this being the future of changing modes for PicoGUS. @jfharden if the status light continually flashes, that could mean there's an issue reading the chip's PSRAM. I wonder what could cause that on this particular firmware... |
Hi! I made some changes and attached new files (uf2 and pgusinit) here: Now flashing pg-multi.uf2 using pgusinit.exe is working. As the size is much bigger, time needed for flash erase has to be bigger too. I zipped the code changes (only the added and modified files!! not the whole project!) and attached here: picogus-multifw-1.2.5-code-differences.zip I think I didn't miss any file, but let me know if something is not there. Check with the new file, and also try with pgusinit flash, now that it works. I only tested this with a v1.1 board and everything is working here, so if someone could test on other board versions and confirm, that would be great. Note for @polpo: I think it would be even better if something could be done to select permanent selection of a firmware at cold-boot (first boot). "Scratch" section used for the mode change is lost when powered off. Maybe some reserved zone in the flash for the # of firmware user wants to boot first could be a good idea. |
Perhaps generic code like firmware flashing and mode selection by pgusinit can be moved to bootloader.c. Firmware sections can be made smaller and firmware flashing quicker. |
@smymm I just tried flashing multifw-1.2.5 via usb and it worked! I tried it out (my setup is a little unusual, it's an Amiga 2000 with an A2286 bridgeboard inside (think of it as a 286 PC on a card, but the amiga 2000 mainboard has some ISA slots which can only be used by the bridgeboard, not the amiga)) and it works fantastic! Playing modfiles in gus mode worked a charm, switching to the soundblaster firmware using Incredible stuff! I can't test flashing the firmware from DOS unfortunately since that already isn't working on the original 1.2.0 firmware. This specific limitation I have is actually what made me very excited about this work since it fixes my inability to change modes without removing the picogus from the Amiga! Thank you! |
About build.sh , it's not needed. Everything is now merged into /sw/release/create_release.sh , it builds the firmwares, the tools you provided and the merge of the firmwares, ... About code in bootloader. I think it's not great to boot to bootloader and stay there until pgusinit does something. It's important to have a working card working in x mode at boot (gus or whatever) without any program required, asi it is now. That way you can use, for example, an original game that boots from floppy disk and run it with a sound card in an already-working state. Hey! great news!! :D |
I thought pgusinit was always required to setup something. But good to know this is not needed. Using the last sector of flash for mode selection and perhaps IO address setting would be great. I would even suggest to use multiple sectors as some kind of wear leveling. |
I have an update on https://github.com/jeroentaverne/pico_multi_firmware |
Yay! I also made other changes and proper code for the firmware mode change implementation in control register area. Here is the new uf2 (flash it as usual with pgusinit /f pg-multi.uf2 or via USB), and the new pgusinit.exe: New usage for this version:
Examples of use:
This way, there is no need to take care of SPI flash wear, because the permanent change would be done only a few times (maybe only one, depending on your preferences) I tested and it worked very well on my system. Please, test if you can and report :)
|
Great! What will pgusinit /m 0 do? |
Finally I created the fork and sent the pull request with the modified code. It's my first time with git/github, so I hope erverything is well done. I uploded the compiled release to my fork, too: Thanks to everyone here! and sorry for my newbie code! @jeroentaverne |
I just tested this on a v1.2 card, flashed with supplied pgusinit straight from DOS and I can confirm this is working. Switching modes on the fly working in games without reboot. |
I just tested this (the multifw-1.2.6) on a PicoGUS 2.0 (in an Amiga 2000 being used by the A2286 bridgeboard) and it worked great. I tried using modmxt playing some mod files in both Sound Blaster and GUS mode, I also tried Planet X3 using adlib sound on the sound blaster mode. Finally I tested that the mode survives reboot which worked like a charm. |
GUS could use an auto initialize after switching modes (and maybe others I haven't tested). That way it saves having to run pgusinit again to initialize or else it won't work. |
Nice! A few small comments: Delay between erase and programming is not needed. Erase will block anyway. Perhaps keep the indents in the code the same. The FLASH sector might also be used to contain IO addresses for all modes. Then complete auto config can be implemented. |
The |
Hi! I like your project! I noticed you have multiple firmware's which need to be reflashed to select the functionality. I have done some coding on the Pi Pico myself, and I made a tool to combine multiple firmware .bin files into one .uf2 file. A small "bootloader" will jump to the requested firmware. This way reprogramming to change functionality isn't needed anymore. If you are interested I can share some code parts with you.
The text was updated successfully, but these errors were encountered: