Reading from Nand Flash in TWRK70F120M

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reading from Nand Flash in TWRK70F120M

1,419 Views
snehahegde
Contributor I

Hi Team,

I have a set of below parameters which I am saving into the respective blocks:

Parameter1 : Block 0

Parameter 2: Block 1 to Block 6

Parameter 3: Block 111

Parameter 4: Block 156 into Block 161

The problem I am facing here is that only when I save the parameters starting from the 4th to 1st, I am able to read them correctly on start up, else it fails to read the parameters. Please suggest the probable reason and the way this problem could be solved.

Thanks and Regards,

Sneha Hegde

0 Kudos
Reply
2 Replies

1,267 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Do you refer Freescale provides NFC demo for TWR-K70F120M board? The demo could be found at below link:

KINETIS_120MHZ_SC  : Kinetis 120MHz bare metal sample code

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=TWR-K70F120M&fpsp=1&tab=Design_Tools_...

If it is available, could you post your NFC related code here?  I could do a test on my site.


Wish it helps.
best regards
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,266 Views
snehahegde
Contributor I

Hi,

Thanks for your reply. I implemented my code using the sample code given. PFB the code which I have used to open the Nand Flash.

OOL CFlashMemory::OpenFlashMemory(void)

{

intinstall_unexpected_isr();

BOOL bStatus=FALSE;

char_ptr name="nandflash:";

mpFlashPtr=NULL;

mpFlashPtr=fopen(name,NULL);

if(mpFlashPtr!=NULL)

{

//Erasing the chip before writing

//if(MQX_OK == ioctl(mpFlashPtr, NANDFLASH_IOCTL_ERASE_CHIP,NULL))

//return;

bStatus=TRUE;

m_dwBlockSize=GetBlockSize();

m_dwVirtPageSize=GetVirtPageSize();

m_dwNumOfVirtPagesPerBlock=m_dwBlockSize/m_dwVirtPageSize;

}

return bStatus;

Please let me know if I am missing out on anything. Also I would like to know if I should call the install driver function before opening the Nand Flash.

Thanks and Regards,

Sneha

0 Kudos
Reply