Page 1 of 1

ATAPI BadPhaseError After FirstRead[Reading Too Much/Solved]

Posted: Tue Oct 06, 2009 1:51 am
by pguy
Hi -

What do I need to do after a read in order to read the next sector, because after I read one sector if I try to read another one right after the first, I receive the bad phase error. I am not currently checking for irqs, all polling for BSY bit to clear. I am receiving the data, the disk is spinning, everything you would expect is working well, up until I try to read another sector.

Steps I take in my read function to send packet and retrieve data --

01. Select device
02. wait for BSY to clear
03. write PKT CMD
04. wait for BSY to clear
05. send packet (read sector)
06. wait BSY to clear
07. read in data

-- thank you

Re: ATAPI BadPhaseError After FirstRead[Reading Too Much/Solved]

Posted: Tue Oct 06, 2009 2:26 pm
by pguy
Well, I suppose it might be due to my expecting too much data in. I don't check to see how much the device has really got to give so when I force it to send more it puts the device in a bad state. I suppose I should not expect anything and just go with what it has available. So, I think I got it, but if anyone has anything interesting to add, please do so.