Author Topic: CF Card corruption on power loss  (Read 987 times)

0 Members and 1 Guest are viewing this topic.

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
CF Card corruption on power loss
« on: February 16, 2018, 11:17:52 am »
Hi,

I have a DIY single-board computer (extensively discussed elsewhere in this forum) which runs CP/M from a CompactFlash card connected via an 8-bit IDE interface.

All works fine with the original 64MB CF card and a newer one I have for testing.  I also have a 128MB CF card that I'm using to test a BIOS that provides CP/M with more drives.

Everything works fine and dandy with the 128MB CF card, until I turn the SBC off (or, more accurately, pull the USB serial connection from the PC.)  When I next power up the computer, it won't load CP/M and I have to re-install (write CP/M and BIOS to sector 0 of the CF card).

A check of the code in memory shows that the last two pages (FE00-FFFF) are corrupt.  The monitor ROM loads Sector 0 from CE00-FFFF, and it seems the last part of Sector 0 is getting corrupted every time the SBC loses power.  This is 100% reproducible every time with the 128MB CF card (the others are fine, by the way.)

So, I guess what I'm asking is this:  what failure mode would cause this behaviour in the CF card?
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16607
  • Country: us
  • DavidH
Re: CF Card corruption on power loss
« Reply #1 on: February 16, 2018, 06:54:05 pm »
Is there a reset or active pin on the IDE interface?  If it is being held in the wrong state when power is lost, then I could see the Compact Flash card interpreting the corrupted bus signals as a write command.

Usually the thing to do is implement a power loss signal which asynchronously activates all of the various reset signals before power is lost.
 

Offline nockieboyTopic starter

  • Super Contributor
  • ***
  • Posts: 1812
  • Country: england
Re: CF Card corruption on power loss
« Reply #2 on: February 16, 2018, 09:37:12 pm »
Hmm, well the CF interface is wired identically to this schematic below:



The reset circuit differs in that I have an MMU reset connected to it as well, but I'm not convinced it's a hardware design issue at the moment as I have two other CF cards that work absolutely fine with the existing setup.  I'm wondering if the CF card has a fault - is there any way I can test it for integrity?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf