Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to protect OS part on nand flash

0 views
Skip to first unread message

zhoumc

unread,
May 18, 2007, 8:00:27 PM5/18/07
to
I work on CE5 .
On nand flash , I have reserved several blocks for BOOT , TOC and MBR
separately ,and I partition a OS part and FAT part.
Through the debug message, I noticed that when I save a file to FAT part,
the filesystem always access to the MBA blocks or the OS part blocks, this
may destroy the OS part.

Can anyone explain why OS blocks were written while I wrote to the FAT part.


Steve Maillet (eMVP)

unread,
May 20, 2007, 4:44:43 PM5/20/07
to
I think you are misreading the debug output. If you can post the actual
debug output someone here might be able to help interpret it better. The
Filessytem will only touch the setors in a partition owned by that FS. So
FATFS won't alter any other partitions.

--
Steve Maillet
EmbeddedFusion
smai...@EmbeddedFusion.com


zhoumc

unread,
May 21, 2007, 10:30:44 AM5/21/07
to
In nand flash Block driver, I have following code to monitor the writting
operation:

BOOL FMD_WriteSector(SECTOR_ADDR startSectorAddr, LPBYTE pSectorBuff,
PSectorInfo pSectorInfoBuff,DWORD dwNumSectors)
{

DWORD blockID;

blockID = SECTOR_TO_BLOCK(startSectorAddr); //get the block number to
write


if ( (blockID >= MBR_BLOCK) && (blockID < IMAGE_START_BLOCK) ) //MBR blocks
{
RETAILMSG(1, (TEXT("FMD_WriteSector() ######## writting MBR blocks
%d!\r\n"), blockID ));
}
else if (blockID < (IMAGE_START_BLOCK + OS_IMAGE_BLOCKS)) //OS blocks
{
RETAILMSG(1, (TEXT("FMD_WriteSector() ######## writting OS blocks
%d!\r\n"), blockID));
}

.......

}

and I really saw messages above outputted when I stored files to FAT part.
Another evidence is that when I store a big file with Explorer ,the system
inform me that the space is not enough . If I choose to continue, the OS
part will be corruptted consequentially.

Silver

unread,
May 21, 2007, 1:53:33 PM5/21/07
to
And how did you reserve the blocks?

Jack

unread,
May 22, 2007, 2:19:12 AM5/22/07
to

zhoumc

unread,
May 22, 2007, 6:41:41 AM5/22/07
to
I set the RESERVERED and BAD flag for the blocks less than MBR blocks to
Reserve blocks
0 new messages