Re: Block device:: NAND

Tech-Archive recommends: Speed Up your PC by fixing your registry



During boot this
wrapper dll should fetch the NAND tables, be ready for the application to use

Does this mean in bootloader?

If all the application data handling is not done in the bootloader,
then why not just use the regular API's to create/read/write files,
why implement what has already been implemented for you?

If you want to load the information during the bootloader phase then
what I wrote on my last post regarding the FMD_OEMIoControl is what
you are looking for. Just implement IOCTL_OEM_FMD_READ which will call
FMD_Read and return the data you want.

Make sure that you don't report the blocks/sectors you are using to
the FAL, so the FAL won't manage them and delete them randomly (Will
be an interesting BUG to find).

As for the registry - just use the regular registry API's to store and
read to/from the registry, no other choice here.

Shai

On Nov 19, 9:15 am, Steeve <vikra...@xxxxxxxxxxx> wrote:
Thanks a lot,
Few application wants to store the h/winfo and registry information into
NAND(address is maintained in terms of table in NAND). During boot this
wrapper dll should fetch the NAND tables, be ready for the application to use
the data. As i have FMD Nand driver i want to make use of block API to write
to sector and read to sector. As NAND is partitioned to hold seperate block
for different applications.
i want just to write and read the indexes and tables(headers). which is
maintained after the sectors(except bootloader+nk.bin) areas.

"shai" wrote:
What are you trying to do?
If you are working with the FAL in a regular image (not the
BootLoader) then you can't access the physical sector using
DISK_IOCTL_READ.
You can, however, implement your own FMD_OEMIoctl which will be passed
directly to the FMD driver, and there you can do whatever you like
(like calling FMD_Read directly with the physical sector).
Take a look in FMD.h for the usage of IOCTL_DISK_USER, and add your
own IOCTL. These will be forwarded to your FMD driver, in particular
to FMD_OEMIoControl.

If this is not what you were meaning to do, you will have to explain
your intentions better.

Shai

On Nov 19, 8:28 am, Steeve <vikra...@xxxxxxxxxxx> wrote:
i need to Read data from NAND flash @ address-0x04000000.(64 MB)

        startSector = address /pDiskInfo.di_bytes_per_sect;
        // build sg request buffer -- single sg buffer
        sgReq.sr_start = startSector;
        sgReq.sr_num_sec = 1;
        sgReq.sr_num_sg = 1;
        sgReq.sr_callback = NULL; // no callback under CE
        sgReq.sr_sglist[0].sb_len = 1  * pDiskInfo.di_bytes_per_sect;
        sgReq.sr_sglist[0].sb_buf = pBufOut;
        fRet = DeviceIoControl(hNAND, DISK_IOCTL_READ, &sgReq, sizeof(sgReq), NULL,
0, &cBytes, NULL);

i do not get to read the contents at 64MB offset at the NAND FLASH.
Do i need to provide the logical sector number here. if how do i get to know
about the mapping?
Is the calling of the IOCTL right here..

"shai" wrote:
I didn't understand the situation you are describing, what exactly is
your problem?
As for the breakpoing in FMD_GetInfo not hitting when you call
DISK_IOCTL_GETINFO, if I remember correctly the FAL returns the cached
information it read when booting, and that is why the call is not
forwarded to the FMD, but you can check for yourself in the FAL source
code (that is if your version of OS is CE 6.0), you can look in
%WINCEROOT%\PRIVATE\WINCEOS\DRIVERS\MSFLASH\SRC and in %WINCEROOT%
\PUBLIC\COMMON\OAK\DRIVERS\BLOCK\MSFLASHFMD\HOOK\FLSNAND, you can put
a break point in the latter and see what is being forwarded to your
FMD.

Hope I understood correctly.
Shai

On Nov 7, 11:01 am, Steeve <vikra...@xxxxxxxxxxx> wrote:
I have two API calls, FMD _ReadSector and
DeviceIoControl(hNAND, DISK_IOCTL_READ, ...
To read from sector 0. of NAND flash

FMD_ReadSector
code i have added in FMD_GetBlockStatus at the end of driver loading
i print for NAND data bytes for testing.

FMD_ReadSector(0, (LPBYTE)&NandBfr, &SI, 1)
RETAILMSG(1,(L" After Driver loAd read SEctor 0 for testing \n"));
for(i=0;i<30;i++)
RETAILMSG(1,(L" Data [%d] : 0x%x",i,*(NandBfr+i)));

This one in my Win32 application
sgReq.sr_start = 0;//sector number
sgReq.sr_num_sec = 1;
sgReq.sr_num_sg = 1;
sgReq.sr_callback = NULL; // no callback under CE
sgReq.sr_sglist[0].sb_len = 1  * DEFAULT_SECTOR_SIZE ;
sgReq.sr_sglist[0].sb_buf = pBufOut;
fRet = DeviceIoControl(hNAND, DISK_IOCTL_READ, &sgReq, sizeof(sgReq), NULL,
0, &cBytes, NULL);

Both the values are different,
The second application doesn't hit the breakpoint in nandfmd driver code.
Does NAND block driver doesn't get invoked? but i see the DISK_IOCTL_GETINFO
gets the right values and CreateFile(DSK1)passes i get the handle .

Please help me, what do i do next to figure out the problem.

Thanks in advance

.



Relevant Pages

  • Re: Block device:: NAND
    ... i get to see "Uncorrectable ECC error found during read" from the driver. ... wrapper dll should fetch the NAND tables, be ready for the application to use ... As i have FMD Nand driver i want to make use of block API to write ... to sector and read to sector. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Block device:: NAND
    ... i get to see "Uncorrectable ECC error found during read" from the driver. ... wrapper dll should fetch the NAND tables, be ready for the application to use ... As i have FMD Nand driver i want to make use of block API to write ... to sector and read to sector. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: 4Gbit NAND flash driver question
    ... bootloader boot up and i can use bootloade command from hyperterminal is ... format nand flash disk. ... bootloader call nandflash driver to format. ... that the Bootloader is reading to and writing from NAND flash ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Block device:: NAND
    ... EdbgOutputDebugString("Err Unable 2erase NAND flash block %x", ... Once NAND FMD driver initialised, next one of the application DLL reads ... i get to see "Uncorrectable ECC error found during read" from the driver. ... to sector and read to sector. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Block device:: NAND
    ... and again 128KB file with 48few bytes indicating header is flashed on NAND ... Once NAND FMD driver initialised, next one of the application DLL reads ... i get to see "Uncorrectable ECC error found during read" from the driver. ... to sector and read to sector. ...
    (microsoft.public.windowsce.platbuilder)