Ports and Interfaces > USB

MSC Host: How do I clear UNIT ATTENTION?

(1/1)

MartinJK:
I am currently debugging my USB MSC host class implementation (on Blackfin development board) that connects to an SD Card reader. I am using TEST UNIT READY and this works fine for detecting media in the card reader, however if I remove the card and reinsert it the SENSE data always shows UNIT_ATTENTION with ASC = 28h (not ready to ready change) and never clears.
 
If, on startup of my application, no card is present all is OK: I can insert a card and send TEST UNIT READY a few times and the above UNIT_ATTENTION clears. However, once inserted, subsequent re-insertions fail to clear UNIT_ATTENTION.
 
Does anyone know of a way to clear the UNIT_ATTENTION and get the SENSE data back to Key=00h, ASC = 00h?

Thanks
Martin

Jan Axelson:
Because so many mass-storage devices don't comply with the spec but instead are designed just well enough to work with major OSes, a way to debug is to attach the device to a Windows host, use a protocol analyzer to record the traffic, and program your host to do whatever Windows does.

Jan

MartinJK:
Hi Jan

Thanks for the reply. The only thing I could see from the trace was a READ CAPACITY attempt after getting a NOT READY response: the device stalls - as it should - and the host clears - as it should. I tried this today and it worked....

Then I tried again without the READ CAPACITY and it also worked. A case of the Friday afternoon blues I think!!

Thanks
Martin

Navigation

[0] Message Index

Go to full version