Adafruit_Floppy icon indicating copy to clipboard operation
Adafruit_Floppy copied to clipboard

Possible to update GW firmware to .27 or higher ?!

Open gilmod714 opened this issue 11 months ago • 20 comments

Hello,

would it be possible to update the greaseweazle FW to 0.27 or higher ? .. the current .22 is too old that the example is based on.. "greaseweazle.ino" .. the current GW fw is 1.6 i think ..

the reason being .. I'm trying to connect the floppy to WinUAE as amiga drive-bridge plugin , and it complains about the old GW fw.. (it works fine on my stm32 board fw1.6) -- but I have too many RP2040's I'd like to put to use ;)

New Bitmap Image

gilmod714 avatar Jan 01 '25 12:01 gilmod714

We'd be happy to see support for newer GW messages added, and when they are added we can bump the compatibility firmware version number.

jepler avatar Jan 23 '25 00:01 jepler

Jeff, I think gilmod714 is asking for the Feather Greaseweazle firmware to be updated, which isn't in this repo. Where would one go to help out?

montyleib avatar Jan 31 '25 04:01 montyleib

YES .. exactly .. Thanks Montyleib ..

It would also be nice (for completeness) to integrate the "Erase" function as well :)

gilmod714 avatar Jan 31 '25 08:01 gilmod714

The adafruit greaseweazle-compatible firmware is in this repo: https://github.com/adafruit/Adafruit_Floppy/blob/main/examples/greaseweazle/greaseweazle.ino

jepler avatar Feb 04 '25 22:02 jepler

Thanks, Jeff!

I had only found it in keirf's firmware repository, and assumed his is behind this one.

montyleib avatar Feb 05 '25 20:02 montyleib

This firmware .ino sketch still reporting GW under ver 0.27 though !

gilmod714 avatar Feb 05 '25 21:02 gilmod714

I see 21 (assuming .21) in the code. No one has kept up with keirf, although Jeff has sure been very involved due to his work on Apple floppy code.

I've tried to compare this with keirf's current firmware, and it's done little more than give me headaches. Assuming greaseweazle.ino is modelled after .21, I'll look backward in keirf's code and try to go from there.

(edit) keirf's .31 release is no more understandable to me than his current. I'll diff them to see what he's done.

No promises, though... :)

montyleib avatar Feb 05 '25 23:02 montyleib

Any efforts to bring up the current firmware above .27 would be very useful I think :) .. 21 is really-really old FW!

Thanks for your efforts in advance montyleib :)

gilmod714 avatar Feb 06 '25 00:02 gilmod714

@ladyada set the firmware version in greaseweazle.ino as 1.0 (lines 91 and 92), which is what the Greaseweazle host tools reports when "gw info" is run. Seems curious that WinUAE reports 'too old' and 'need .27 or greater'. I'm suspicious that the device model that is reported (Adafruit Floppy Generic) is the real issue.

I'm currently comparing the blue pill C code between versions, I still need to wrap my head around a) figuring out the translation C->Python and b) make the changes in Python to match the C from .22... it's making more sense daily. :)

@gilmod714 : are you certain that .22 is what WinUAE thinks greaseweazle.ino is? I have keirf's source from .22 to .31 (which became 1.0)

from keirf's Release Notes:

** v1.0 - 26 December 2021

  • Firmware is now released separately from the host tools
  • No firmware changes since v0.31 (apart from the version bump)

montyleib avatar Feb 08 '25 15:02 montyleib

@jepler ^ want to take a look in the next few weeks?

ladyada avatar Feb 09 '25 01:02 ladyada

@montyleib .. yes, I believe WINUAE thinks that "greaseweazle.ino" is .22 on my RP2040 (I forgot where I saw that exactly, but yeah almost certain that's what it reported, when I was tinkering with it - trying to make it work as a disk plugin)

Thank you for your hard work :) .. and also thank you @jepler & @ladyada

gilmod714 avatar Feb 09 '25 12:02 gilmod714

@gilmod714 .. ~~it just occurred to me that WINUAE is sending CMD_MAX and deciding whether the firmware is capable based on the returned report. If 16 is returned, for example, it knows that the firmware version is below when keirf added ERASE in 2020.~~ Nope, greaseweazle.ino reports CMD_MAX as 26, so I'm guessing that WINUAE is sending one of the missing commands and getting a BAD_CMD response. It may well be 11 SWITCH_FW_MODE, used to swap between update firmware and run modes, but could be 21 CMD_TEST_MODE or 22 CMD_NOCLICK_STEP.

The current version of the original Greaseweazle firmware has 23 commands available, where 10 was skipped and 18 thru 22 appear to be for testing. greaseweazle.ino has 21, where I'm working on 17 and Jeff has implemented 18 thru 20 while working on his Apple drive code, as well as adding 26 specifically to check the status of the track 0 pin. (@jepler may I suggest a slight rewrite to use GW_CMD_GETPIN TRK0_PIN instead, so that it follows whatever pin assignment is in use?)

Monty

montyleib avatar Apr 06 '25 17:04 montyleib

jepler's in retirement right now - if you have a recommended change please submit a PR!

ladyada avatar Apr 07 '25 12:04 ladyada

@ladyada - you let him retire? :) Has anyone stepped in to continue his Apple floppy interfacing work?

With that in mind, I'll continue work on catching up with keirf's code. I located my 2040 and floppy featherwing in the stack of boxes, just have to dig a little more to pull a 5.25 and 3.5 back out so I can test my code before submitting.

I knew I should have held off packing them... or at least made sure they were at the top of the stack... :)

montyleib avatar Apr 07 '25 14:04 montyleib

i can review/merge PRs and bug fixes, but im not actively working on it right now, no

ladyada avatar Apr 07 '25 14:04 ladyada

Jepler retired ?! .. I was looking forward to the apple drive completed code .. I'm glad I have switched my plans and converted my Apple drive into a 1541 instead

https://www.lemon64.com/forum/viewtopic.php?t=86143

@montyleib .. thank you for your hard work :)

gilmod714 avatar Apr 07 '25 17:04 gilmod714

@gilmod714 - I think I've managed to convert GW-ERASE, grab my greaseweazle.ino from /montyleib/Adafruit-Floppy if you're up for some testing.

@ladyada - I'm hesitant to write a PR without some testing, which I am unfortunately not in a position to do. My Feather goodies have been rescued from the pile of boxes, but my floppy drives are far too deep in the pile to dig out. If you would, or have someone who can, will you take a look at my fork? greaseweazle.ino in the examples tree contains the only changes that I've made. Or, if you'd prefer a PR to let my frankencode loose on the world, let me know. :)

montyleib avatar Aug 15 '25 17:08 montyleib

and then, he realizes he still hasn't dealt with the clock and divider values...

never mind, I need to pull data sheets for all of the mentioned boards and add #defines to each as appropriate.

montyleib avatar Aug 15 '25 17:08 montyleib

hiya PR's are welcome as long as you document what ya did manage to test. we'll be getting back to floppsy soon now that fruit jam is shipping

ladyada avatar Aug 15 '25 19:08 ladyada

@montyleib .. I'm away on a long trip at the moment-no way to test. Thx for your hard work :)

gilmod714 avatar Aug 15 '25 20:08 gilmod714