alexthecat123 / ArduinoFile

An Arduino-based device for testing and emulating ProFile hard drives.
13 stars 2 forks source link

R/W errors in MacWorks and error 1070 in LisaOS #2

Open RolandJuno opened 11 months ago

RolandJuno commented 11 months ago

Background: I have a Lisa 2/5 system that consists of a original CPU and SunRem 2MB cards as well as reproduction motherboard and I/O cards. I'm also using EPROMs as emulated PROMs on the CPU and I/O cards as well as a COP emulator on the I/O card.

Reads from the ArduinoFile seem solid. I've not encountered issues there. The issue seems to be with writes to the device. The symptoms while using the ArduinoFile are:

First I tried the following:

I then found this issue thread which seemed to offer some hope! I tried the following:

None of these so far has resolved the issue in MacWorks. I'm hoping that someone has some ideas of what might be the issue?

Update: I enabled many of the serial debug statements in the code and watched the stream. It seems the Mac will write data and then read it back to verify. I got a new error this time.

PS Alex, I know you're very busy so reply only if time allows! Your university studies should be your top priority! =-)

IMG_9254

Originally posted by @RolandJuno in https://github.com/alexthecat123/ArduinoFile/issues/1#issuecomment-1777440929

RolandJuno commented 11 months ago

I'm using the fork located at https://github.com/alexthecat123/ArduinoFile/tree/2/10-Testing

The CPU card is an original. Unfortunately, I don't have access to any other I/O cards. I'm using H ROMs on the CPU card.

The quartz clock on the CPU card are original. The ones on the I/O board are to spec.

I have been curious about the 6522 as being suspect. I have some extras I can try plus the modern WDC W65C22N6TPG (which I couldn't get to work originally but are supposedly drop-in replacements for the original 6522). Will give this a try.

I've tried three different class 10 SD cards (SanDisk, Samsung and PNY).

Also, as before, I increased the timeout value to 15000 this time and both errors in the serial debug stream went away but the error on MW II+ still persist (but definitely seem to be related to reading back what was just written).

Is there a way to write to the debug stream the actual data in HEX that is being read and written? That could help me pinpoint if it's an actual verify error or a timing error.

RolandJuno commented 11 months ago

I just tried three different 6522 chips in U5C. A SY6522A, MOS6522, and a new W65C22N6TPG. All three produce errors from the ArduinoFile.

`Timeout: Write Command Second Handshake Part 2 Phase 1: Host didn't respond with a 55! Maybe the drive was reset?

Timeout: Read Command Confirmation Phase 1: Host didn't respond with a 55! Maybe the drive was reset?

Timeout: Write Command Confirmation Phase 1: Host didn't respond with a 55! Maybe the drive was reset? `

Does this seem to show that we're missing a signal (or never get one)?

RolandJuno commented 11 months ago

I connected my logic analyzer to the pins pictured in the screenshot (6 control lines and 2 data lines). I attempted to copy a large application in MW II+. It produced a write error on the Mac side. The last few lines of the debug from the ArduinoFile are:

.. 010034F7030A 010034FC030A 010034F1030A 010034F6030A 010034FB030A 01003500030A 01003505030A 0100350A030A 0100350F030A 01003504030A 01003509030A Timeout: Write Command Confirmation Phase 1: Host didn't respond with a 55! Maybe the drive was reset?

The logic analyzer was stopped shortly thereafter with this near the end of the capture. Screen Shot 2023-10-24 at Oct 24, 2023  2 47 33 PM

Zooming in: Screen Shot 2023-10-24 at Oct 24, 2023  2 50 08 PM

Hopefully this helps? Let me know if you want the raw data or more screenshots or measurements.

mg-man commented 11 months ago

I'm using H ROMs on the CPU card.

Can you use H ROMs on a 2/5 I/O board? I thought H ROMs were for the 2/10?

RolandJuno commented 11 months ago

Yes, H it works with a 2/5 system. H/A8 is the combination I have.

Common/Recommended combinations:

H/A8 - Typical for a Lisa 2 or 2/5

Source: https://lisafaq.sunder.net/lisafaq-hw-rom_versions.html

mg-man commented 11 months ago

Fair enough, I knew there was a diff between the 2/5 & 2/10... but that's the A8 vs 88 - mine's [2/10] the latter.

RolandJuno commented 11 months ago

I get further in the MW II+ copy by changing timeout in ArduinoFile to uint32_t and increasing it x10 to 100000. It seems to fail at the end with a "disk error" now rather than a write error.

I decided to run Disk First Aid and it reports it's not an HFS disk. ArduinoFile produces an error:

0000FFE1030A Error: Requested block is out of range! 0000018C030A

Maybe that's expected behavior? @mg-man Can you successfully use Disk First Aid with your ArduinoFile?

mg-man commented 11 months ago

I'm the one who started the Issue #1 thread, and tried over-clocking my Mega and also the Port F mod. I was never able to get my ArduinoFile to fully boot as my Lisa is a 2/10. I've not had a chance to try these latest mods, but am excited to do so. Will have to wait, though, on vacation with family atm.

RolandJuno commented 11 months ago

Your detailed posts and tenacity are what drove me to dive deeper into this issue I'm having-- thank you for that! Enjoy your holiday!

mg-man commented 11 months ago

Thx. I'm pretty excited to try @i-to-z's compile flag as soon as I can find some time. I'm also restoring a 2/5 which I want one of these for as well!

mg-man commented 11 months ago

Out of curiosity, have you tried another LS280?

RolandJuno commented 11 months ago

Lots of progress just made. I noticed that when I gave it a really long timeout, the second error "Phase 1: Host didn't respond with a 55! Maybe the drive was reset?" didn't appear anymore. Additionally, the system wouldn't boot properly into the drive selector mode for aphid/cameo (it just hung and the green light never came on).

I decided to keep timeout at 10x (100,000). I created a secondary timeout for all those loops called phaseTimeout and set it to the original (10,000).

uint16_t phaseTimeout = 10000; //around 18ms uint32_t timeout = 100000; ... if(currentTime >= phaseTimeout){ sei(); delay(10); Serial.println(F("Phase 1: Host didn't respond with a 55! Maybe the drive was reset?")); delay(10); cli(); return; }

I also decided to start from scratch. I created a new 32MB harddrive image and booted from a MW II+ floppy. I chose the internal Profile in the installer and clicked install. It began by formatting the drive. The ArduinoFile began reporting sequential block writes as expected. I also noticed this took a lot longer than it did in previous attempts (I wasn't monitoring the serial debug stream previously however so it very well could have had an error there).

Curiously, when it got to block 8000, it began reporting "Error: Request block out of range!"

...
01007FF2030A
01007FF7030A
01007FFC030A
01007FF1030A
01007FF6030A
01007FFB030A
01008000030A
Error: Requested block is out of range!
01008005030A
Error: Requested block is out of range!
0100800A030A
Error: Requested block is out of range!
0100800F030A
Error: Requested block is out of range!
01008004030A
...

Despite this I let it roll. It eventually successfully installed everything. First real test was to copy a System Folder over to it, which worked the first time. I rebooted and proceeded to install System 6.0.8 which worked without issue. I rebooted and copied over Photoshop 1.0 which also worked!

So far, that may have solved the issue! I'll continue testing to be sure and will report here.

i-to-z commented 11 months ago

RolandJuno, I haven't tried running MacWorks+ on a Lisa. I want to try it too. Which of the many versions listed here are you using? https://www.macintoshrepository.org/apple-lisa/software_search.php?s=macworks

Also: have you tried less-demanding operating systems on your Lisa, like MacWorksXL3.0 ? Since it works well for most of us, it may be a good validation for you that your hardware is solid.

Regarding the "Error: Requested block is out of range!" error: Perhaps you should try installing MW+ on a larger blank image file? My rough calculations are: 01008000030A means "write to sector 008000 in HEX" = 128x256x532/(1024*1024) = about 16.6MB. So give it a blank image file with a size above this, maybe try 20MB. Note: I am unsure why the installation software decided that the disc is so large. The Widget HDD is just 10MB, the ProFile is just 5 MB.

RolandJuno commented 11 months ago

Thanks for the reply! I chose a disk image size of 32MB which I believe is supported with MacWorks. I hope that the installer was able to read the size of the disk before attempting to format it.

In any case, the ArduinoFile now has been working flawlessly all night. I've been installing a lot of software and docs on it without a single disk read/write error. It's amazing that AppleTalk works with it too-- I'm able to connect to my RaspberryPi running MacIPGW via a EtherTalk to LocalTalk adapter.

Tomorrow I hope to try the LisaOS again to see if it clears up the 10707 error I was getting.

DosFox1 commented 11 months ago

@RolandJuno That's brilliant! Do you think that fix would work with a stock ArduinoFile without the PORTF mod?

Also any chance you could share the complete .ino file? Thanks!