Read/Write to Nand Flash using Driver on AT91SAM9260EK

This forum is for users of Atmel's SAM Series and who are interested in using WinCE OS.

Moderator: nferre

Noufele
Posts: 4
Joined: Tue Oct 27, 2009 6:10 am

Read/Write to Nand Flash using Driver on AT91SAM9260EK

Fri Dec 04, 2009 12:38 pm

hello,
I have the following code:

HANDLE hFlash = NULL;
BOOL fResult;
SG_REQ sgReq;
DWORD dwDummy;
LPBYTE Outbuf;
Outbuf = (unsigned char*)malloc(512);


sgReq.sr_start = 1;
sgReq.sr_num_sec = 1;
sgReq.sr_num_sg = 1;
sgReq.sr_callback = NULL;
sgReq.sr_sglist[0].sb_buf = Outbuf;
sgReq.sr_sglist[0].sb_len = 512 * sgReq.sr_num_sec;



hFlash = CreateFile(_T("DSK1:"), 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);



fResult = DeviceIoControl(hFlash, IOCTL_DISK_USER_READ, &sgReq, sizeof( sgReq), NULL, 0, &dwDummy, NULL);

DeviceIoControl returns FALSE. What is wrong?

Please Help

Thanks

Noufele
guangyu.ren
Posts: 23
Joined: Tue Mar 31, 2009 7:22 am

Re: Read/Write to Nand Flash using Driver on AT91SAM9260EK

Mon Jan 18, 2010 5:05 am

Please understand in winCE, NandFlash driver is in form of a FMD (Flash Media Driver) component and is used by FAT File system.
So it is NOT allowed that a third party application go straight access the NandFlash driver. This is because this access will destroy the ondisk FAT file system.

Return to “WinCE”

Who is online

Users browsing this forum: No registered users and 2 guests