ATA/ATAPI-5 Question

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I'm working with the Cirrus Logic EP9315, Arm920T Core, currently
working on my IDE interface routines.

I have the basic communication with the hard drive working, I can get
the identify information, read/write data, all seems to work fine.
Using PIO Mode 4, the drive is an older 6 gig drive so which does not
implement the Packet command set.

Here's the problem though...

When I send the writesectors command, and specify more than 1 sector,
sometimes the drive will stay busy indefinitely (currently not sure
about error status, I'll look into that next).

If I only use 1 sector, this never happens. The drive also sounds
differently.

When creating my file system, I can hear the heads move to the next
available block as it creates the block headers. When I write 2
sectors at once, this does not happen.

Either case however, there is no error!!!!

Anyone have any idea as to what could be wrong?

Thanks,

Stephan

Re: ATA/ATAPI-5 Question

Quoted text here. Click to load it

Nor will newer drives. Packet commands are for optical drives.

Quoted text here. Click to load it

Be sure the disk is not BSY and DRDY is set (read the Status register for
these to clear any pending INTRQ assertion), then program the sector count
register, start LBA (be sure the LBA mode and device select bits are set
correctly) and then issue the WRITE SECTOR command. Remember a count of
zero means the MTU of 256 sectors. Now wait for DRQ and then read until
DRQ is no more (cross check with a count of interface reads).

Quoted text here. Click to load it

Remember that in modes above PIO Mode 2 you must honor the IORDY handshake
signal. Also, try enabling the interrupt assertion in Device Control by
setting the NIEN bit to zero. Then poll for INTRQ assertion, read a
sector, poll for INTRQ assertion, read a sector, etc. The ATA spec. says
that a (working) drive must clear BSY within 31 seconds of command issue.
If this is not the case then the drive is broken.

--
- Mark ->
--

Re: ATA/ATAPI-5 Question
One other thing you might want to check is which register you are reading.
I worked with older drivers but... There were two registers, a primary
status register and an alternate status register.
The alternate register was there to allow you to poll driver status and
would not clear status bits. The primary register would clear various status
bits when ready..
If you polled the primary register, it was possible to confuse the state
machine by reading and clearing states it thought were set, making the
driver idle and busy, an illegal and undefined state.
If you used interrupts or DMA, you were safe.
Hope this helps,

Quoted text here. Click to load it



Re: ATA/ATAPI-5 Question

Quoted text here. Click to load it

Just the assertion of the INTRQ# signal line an the DF bit of the status
reg.

Quoted text here. Click to load it

I'm not sure I've ever seen this happen nor does the spec. describe this
possibility. However, polled mode, the Alternate Status register is the
correct register to read.

Top-posting sure destroys the thread, eh?

--
- Mark ->
--

Site Timeline