Jump to content

SCSI2SD Project - anyone interested ?


Recommended Posts

  • Replies 137
  • Created
  • Last Reply

Top Posters In This Topic

To program them, you pretty much need a miniprog3, which is about $90. It's only used once in the initial programming, since mmcmaster has the software update via usb working. He's made it so any jtag or swd programming device should work, but I haven't found any software other than the Cypress stuff that knows how to program these chips, and the device support for the Cypress stuff is limited. After fighting for a while to get my jlink2 device to program these things, I decided it was much more expedient to just get the miniprog3. Especially with being the first set of devices I assembled and not sure if it's my assembly or the software that was the problem.

If you buy PCBs in quantity of 10, I think it ran about $3/board shipped.

Then the rest of the parts come to about $30-$40 depending on quantity ordered, I think. The most expensive individual part is the processor, which is about $10 or so depending on where you get it and quantity. Unfortunately, it's also the most difficult to solder correctly by hand. I've messed up one or two, which is kind of a bummer but hey, that just means I could use the practice, right? :)

The good news is, after assembling a couple of these, the floppyemus seemed easy!

Link to post
Share on other sites

Yep - I bought mine for that price + shipping, fully assembled. Updated the firmware and configured it on my PC, went down to Coles and grabbed a cheapie microSD card, slapped it in, installed it in the Mac SEx (my souped up SE/30 upgraded SE), formatted it, works perfectly, no complaints here :)

Link to post
Share on other sites

It started out in life as a bog stock 800k SE, which it remained until I got my hands on it. (at which point the logic board was dead and rusted out, as was the chassis and floppy drive) So I got to work on it...new rust free SE/30 chassis, recapped SE/30 logic board, a full 128MB of RAM, NOS SuperDrive SCSI2SD with a 4GB microSD card, its a beast. :) All it needs now is a IIfx/IIsi ROM SIMM and an ethernet card :)

 

As for the name - I always thought it was hilarious that the SE/30 could have ended up being called that, had Apple stuck to their naming convention :lol:

Link to post
Share on other sites

I think there is documentation for how to bit bang program these chips available from Cypress, but I was too lazy to bother looking. I was expecting OpenOCD to be able to support it, but no such luck.

 

BTW, there are still problems with Apple HD SC Setup. Not a huge deal for me since Drive Setup works fine, but I've seen it fail to verify the formatting and I've also seen it succeed, but only format a card limited to 1 GB as about 19 MB. Not sure what's going on, but it could still be stuff that's stubbed out as doing nothing that confuses Apple HD SC Setup.

Link to post
Share on other sites

A quick update:

 

Unfortunately I've had to increase the price to $75 AUD per board as it takes quite a bit of time to make each board. Still a good deal compared to buying a Miniprog3 for $90 to program your own board :p I have no boards currently in stock, but I have a large order of 50 PCBs that should arrive within 2 weeks.

 

I haven't had much time over the past 4 weeks to spend on SCSI2SD, so progress has been limited. I have a holiday from work over the Christmas period, so I expect to deliver some firmware updates (Apple HD SC fixes, and performance improvements, and a few other fixes I've already implemented) before the end of the year.

 

I think there is documentation for how to bit bang program these chips available from Cypress, but I was too lazy to bother looking.

There is source code available from Cypress that could be ported to an Arduino or similar for easy/cheap programming. See http://www.cypress.com/?rID=57435.

Link to post
Share on other sites
bbraun mentioned that mmcmaster had pointed to the lack of MODE SELECT support being a potential problem, so I took a look. This patch to the code makes it work:

 

Thanks dougg3! I've integrated your code, and it works perfectly (albeit extremely slowly).

 

I've made a new firmware release incorporating this fix, and merged in few other reliability fixes. Compiled firmware is at http://www.codesrc.com/files/scsi2sd/v3.0.1/firmware/, for use with the original v3.0 bootloaderhost utility.

Link to post
Share on other sites
BTW, there are still problems with Apple HD SC Setup. Not a huge deal for me since Drive Setup works fine, but I've seen it fail to verify the formatting and I've also seen it succeed, but only format a card limited to 1 GB as about 19 MB.

 

I'll run a 1GB format attempt overnight to see what happens. I suspect it will work properly now with the other fixes I've merged in.

Link to post
Share on other sites

I've noticed a bug where the SCSI2SD needs to be fully reset before the scsi2sd-config --blocks parameter takes effect (ie. all power sources, including the SCSI host, disk drive power connector, and USB cable are disconnected or turned off). Is it possible that you previously set a small 20Mb size limit, and then haven't reset it since ?

Link to post
Share on other sites

Yep, it was fully reset. Totally unplugged from everything after doing the scsi2sd-config command. I've never configured it for a size other than 8 MB, 1 GB, and unlimited anyway. I'll keep looking into what's going on with it...pretty weird! I wonder if limiting the size to 20 MB or 30 MB will result in the same problem...

Link to post
Share on other sites

Limiting to a 30 MB drive size also causes this same problem--I end up with an 18.6 MB formatted volume.

 

So then I kept it at 30 MB, put the SD card into my computer, and dd'ed all zeros to the first 50 MB of the SD card just to verify it's not getting confused by pre-existing data. Apple HD SC Setup still formats it as only 18.6 MB. Weird!

Link to post
Share on other sites
  • 3 weeks later...

I also get the 18.6Mb partition :( It seems HD SC Setup is using an internal database to lookup the size of the Seagate ST225N drive (20MB) and using that value instead of the drive's reported size.

 

I've made a new firmware release (3.1) which doubles read/write speeds to above 900kb/sec, and fixes a few minor errors.

Link to post
Share on other sites

Cool on the speed doubling! Very nice.

 

Yeah, after you mentioned that, I can see the internal drive size database. Darn :( I tried changing to other drive models that are bigger (some even have a size of 0 blocks in the internal database, which might mean "trust what the drive says"), and they are definitely recognized as valid by HD SC Setup, but they fail to initialize.

 

At some point I may try to figure out what is causing it to fail on those other drive models. Perhaps when it thinks it's talking to these other drive models, it sends other SCSI commands that are not yet supported. I'll try to figure out a good way to debug and see what SCSI commands are being sent.

Link to post
Share on other sites
  • 3 weeks later...

Well, I've been messing around with disassembling Apple HD SC Setup and trying to figure out how to make SCSI2SD fully compatible with it. I'm making progress, but it's not working yet.

 

The very last entry in the internal drive database is manufacturer "x" (followed by 7 spaces) and a drive name filled with spaces. As far as I can tell it's a placeholder entry used in certain cases like when you have the patched version that works with any drive. It seems like a good "dummy" entry to try to match because it doesn't specify a drive size. So I gave the SCSI2SD that manufacturer and name, and it was recognized as a valid drive.

 

Unfortunately, right before formatting, Apple HD SC Setup does a MODE SENSE(6) command for page 0x01's default values. That page is the Read/Write Error Recovery page, which is not yet supported. I added code to SCSI2SD so it replies to requests for that page, but for some reason the mode sense command still ends up with an error, so I may be doing something wrong in my implementation of it.

 

If I patch Apple HD SC Setup to always act like that mode sense command was successful (so I'm pretending that I got past that first hurdle), it gets to the point where it says it's verifying the formatting, and then it fails again, which I believe is because it's sending a command (haven't determined which one yet) that SCSI2SD doesn't know how to handle yet. Haven't gotten that far yet, first I just want to make it work correctly with the read/write error recovery page. Once it's passing that, I'll figure out what is causing the verify to fail.

 

I'm pretty sure that even the patched version of Apple HD SC Setup won't work until I figure out why these commands are failing. The reason it works when pretending it's a ST225N is because there are other flags in the drive table that tell Apple HD SC Setup to change its behavior for each drive, and apparently the flags for the ST225N don't cause any of these extra commands to get sent.

Link to post
Share on other sites

OK, nightly update. I figured out what's going on with the read-write error recovery page.

 

It looks like to make it work with Drive Setup, there was a hack to make it assume the DBD bit is always set (disable block descriptors) during mode sense requests, so the replies never return a block descriptor. The reason was so the allocation length would be big enough to contain the format device page, and the standard doesn't require you to return a block descriptor. I read about that in the comments--makes sense, still follows the SCSI standard.

 

Well, it turns out that Apple HD SC Setup assumes the drive always includes a block descriptor in mode sense replies. Technically this is against the SCSI standard because drives are not required to include a block descriptor in mode sense replies, but in practice it looks like real drives tend to always include a block descriptor. With the length it was asking for when requesting the read-write error recovery page, it was going past the end of the actual page length and causing an error. Anyway, if I change it so that drives always include a block descriptor when the DBD bit is 0, everything works OK and I get past that first problem.

 

It also appears that drives tend to include as much data as they can when the allocation length is too short rather than error out. So to (hopefully) make it work, I've changed the code so if the allocation length is too short, it simply truncates the response to the allocation length instead of returning an error. This should fix the case described in the comments about Drive Setup not providing a big enough allocation length. I've also verified this is how a real SCSI hard drive would respond.

 

Now I'm past that page problem and I'm at the point where Apple HD SC Setup is sending a command that SCSI2SD doesn't yet know how to handle. I'll fix that shortly, but first some very good news:

 

During my disassembly of Apple HD SC Setup, I noticed that the code pays attention to whether the command key is pressed when you click Initialize. Sure enough, if the command key is pressed, it completely skips the low level part of the formatting which means it formats really quickly. This also makes it skip the unknown command, so it actually works! It definitely gives the full usable drive space too. I just formatted a 2 GB SD card and it came out to 1,883.7 MB available.

 

This is true for Apple HD SC Setup 7.3.5. Unfortunately older versions such as 7.0.1 don't have the command key trick, but they also seem to not try the bad command that causes an error. Sadly this means they will format slowly though. (The older versions also assume that the special drive name is a small 20 MB drive. Grrrrrrr....)

 

So in conclusion: I'll make it completely work soon if someone's crazy enough to want to do a low level format without holding down the command key, but with the changes I described (add the read-write error recovery page, fix the block descriptor thing, set manufacturer to "x" followed by seven spaces, set drive model to all spaces), it works as long as you hold down the command key when you click Initialize and you have a new enough version of Apple HD SC Setup. I'll get some patches ready soon. I'll also verify it still works with Drive Setup.

 

Edit: Oh, wow. So even though it defaults to 18.6 MB when you have the Seagate drive model, that's just a default partition size. You can click Partition and then click Custom, and that will let you delete the partition and create a new one that fills the entire drive. In other words, I didn't need to do any of this work in the first place...it works with the SEAGATE ST225N drive name, just kind of in a confusing way. The internal drive size database is used, but it's only for determining a default partition size. It's not blocking you from using the rest of the drive. Oh well...all the things I found will still probably help reliability.

Link to post
Share on other sites

And one last reply about this. The unsupported command it was failing on was the VERIFY command. It does a verify where it only wants the drive to verify the medium without comparing it against data. Basically just making sure the drive is OK. So I made it return success. There's also a way for it to send data to verify against, but I was too lazy to implement that command (and Apple HD SC Setup doesn't use it anyway).

 

Anyway, with that final change in place, everything works fine now.

 

In conclusion:

 

When configured with the SEAGATE ST225N drive name, it works fine but defaults to a small partition because it assumes the drive is 20 MB. You can click Partition and then go to Custom to fix that after the fact though.

If you pick other drive types, it may fail with various errors, but that's because of unimplemented commands (which I implemented, and it works great now).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...