This article includes the basic NAND driver porting as well as the key problem developer usually face during development.
The article is explain in the following points:
1. What is NAND Flash driver.
Flash memory is non-volatile, which means that no power is needed to maintain the information stored in the chip. In addition, flash memory offers fast read access times (although not as fast as volatile DRAM memory used for main memory in PCs) and better kinetic shock resistance than hard disks. In devices, it is used as boot as well storage devices like SD Card. We flash the step loader image in NAND and while booting, the processor start boot time; we configure the processor to boot from NAND. Later processor boot from NAND and we see the image up. Also in the image we can see the NAND Flash folder which can be used as storage space. The storage space will be space left after flashing step loader.
2. Overview knowledge before devlopment start
The flash driver is devided in two parts in WinCE 6.0.
1. Stream driver which is under public or private. It is provided by microsoft and we have to plug in the our code with it.
2. This is called PDD which implement the platform depending on our NAND flash controller and NAND flash.
The upper layer is called FAL, Flash Abstraction layer and this is implemented by MS. Hence we need to implement just the funtion required by the FAL. This is a normal disk storage stream driver.
3. Porting function required
- FMD_Deinit
- FMD_EraseBlock
- FMD_GetBlockStatus
- FMD_GetInfo
- FMD_Init
- FMD_OEMIoControl
- FMD_PowerDown
- FMD_PowerUp
- FMD_ReadSector
- FMD_SetBlockStatus
- FMD_WriteSector
4. Registry setting and it’s significance.
When we write NAND Flash driver, our aim is that our NAND device should work as booting device as well as persistent storage device.
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\NANDFLASH\FATFS]
"Flags"=dword:14 ;
"FormatExfat"=dword:1 ; to format the NAND with exFat file system
"CheckForFormat"=dword:1 ; it is used to tell the OS that format or not it if it is a clean boot or normal one.
"EnableWriteBack"=dword:1 ; This is cache properties whether to enable write through cache or write back.
Similarly you can set properties for cache filter.
5. Refering question and solution in one page
Refereces:
www.e-consystems.com/ images/fmd%20blockdig.jpg
Thank you very much
~~Mike