Unable to Read from Nand Flash in TWRK70f120M

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Read from Nand Flash in TWRK70f120M

163 Views
snehahegde
Contributor I

Hi Team,

PFB the code for Reading some of the parameters from Flash:

CWasherFormula *pPumpAMount=NULL;

//for(BYTE byWasherId=0; byWasherId<MAX_WASHERS;byWasherId++)

{

//Location=0;

//byBlockNum=(MAX_WASHERS*2)MAX_PUMPS1+byWasherId;

pPumpAMount=m_argpDataMgr->GetWasherFormulaPtr(0);

if(NULL!=pPumpAMount)

{

Location=(m_dwNumOfVirtPagesPerBlock*(76));

fseek(mpFlashPtr, Location, IO_SEEK_SET);

if(sizeof(CWasherFormula)==read(mpFlashPtr,pPumpAMount,sizeof(CWasherFormula)))

{

m_argpDataMgr->SetWasherFormulaConfig(0,pPumpAMount);

printf("Check ");

}

}

}

I have written the parameters into 76th block of Flash and reading it from the same block. But I find that the control doesn't get into the if block, which is why I am unable to set the data that is read. Kindly let me know how the issue can be resolved.

Thanks and Regards,

Sneha Hegde

0 Kudos
1 Reply

55 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Sneha,

please find attached an example.

Regards,

Carlos

0 Kudos