All Forums
 Microsoft Windows CE
 CE Flash, CF and PCMCIA
 PCMCIA Read Problem
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

Susan

123 Posts

Posted - 02 May 2003 :  12:08:47  Show Profile  Email Poster
I’m having a problem retrieving file names from a card in the PCMCIA slot. Under a separate email to Drew, I have forwarded a small application which will hopefully demonstrate this problem. Debug messages are generated using RETAILMSG.

The application’s main screen has a button, which when pressed, brings up a file review screen on which a list of all the directories on the card are listed. This review screen has a timer attached which verifies the continued existence of a FlashCard. If the code detects that a card no longer exists, a message is generated to the user. In addition, the review screen is refreshed (with the end result being that no files are listed on the screen, since no card is in the slot).

The timer constantly checks for the existence of a card, so when a card is put back into the slot, the process detects a card-state-change (from CARD_MISSING to CARD_INSERTED). Since a card is now inserted, the process reads the card to refresh the screen with a current list of directories.

This is where the problem occurs. Instead of finding files/directories on the card, the FindFirstFile() function returns INVALID_HANDLE_VALUE. GetLastError() returns 0x5, or ERROR_ACCESS_DENIED. When this error occurs, the calling function is informed and attempts to read the card again (after sleeping for five seconds), under the premise that maybe it takes a few seconds for the card to be recognized. The second call to the function also fails. (The sleep-for-five seconds is merely for testing purposes. Our applications would not be able to come to a grinding halt in such a manner.)

If I remove the card again, wait for the message to appear that a card is missing, acknowledge that message, then reinsert the card, the process works correctly.

I am also seeing a problem getting a directory list through the desktop. The ‘Storage Card’ is recognized (there is an icon), but nothing appears in a file list (yes, the card has files on it). The card was inserted for at least ten seconds before I attempted to get a listing.

This is on a BitsyPlus, ROM 1.77, Image 4.12, CE.NET

madav

15 Posts

Posted - 21 May 2003 :  13:45:14  Show Profile  Email Poster
I am having problems too with reading / writing to the PCMCIA storage acard on a Bitsy setup + CE.Net (4.13)

I tried running many applications and the following is the behavior for a simple program that creates a file in the storage card, writes in a character array, reads it back and deletes the file.

* When I create a file and use the same handle for both the write & the read functions, the read fails. (the ReadFile() function returns succes, but the number of bytes read is zero)

* When I create a file and use the handle to perform the write operation, close the file. Reopen the file and pass the new handle to my read function, both read & write work fine

* Sometimes when I create & delete files, the explorer window on the device gets refreshed automatically , and other times the device recoganizes the storage card but does not show the file listing

Further, the problems that susan has mentioned also exist. In one word, the image is still 'flaky' with respect to the PCMCIA access.

Plz. suggest methods of making the PCMCIA read/write operations stable.

Thanks
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000