Using Micron MT29F8G08ABABWP with FFS

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Using Micron MT29F8G08ABABWP with FFS

跳至解决方案
3,955 次查看
randalljordan
Contributor III

Currently I’m using I’m are using MQX 4.2 and a K20FX512VLQ12 connected to a Spansion S34ML08G2 NAND flash memory chip. Everything is works well using the Spansion flash.

 Our board house would like us to replace the Spansion flash with a Micron MT29F8G08ABABWP because of the long lead time for the Spansion flash.

I’ve placed the Micron flash chip on one of our boards to test, update init_nandflash.c with the parameters from the Micron data sheet:

#define MT29F8G08_PHYSICAL_PAGE_SIZE     4096

#define MT29F8G08_SPARE_AREA_SIZE         224

#define MT29F8G08_BLOCK_SIZE             524288 /* 512kB */

#define MT29F8G08_NUM_BLOCKS             2048

#define MT29F8G08_WIDTH                   8

 

NANDFLASH_INFO_STRUCT _MT29F8G08_organization_8bit[] = {

  MT29F8G08_PHYSICAL_PAGE_SIZE,

  MT29F8G08_SPARE_AREA_SIZE,

  MT29F8G08_BLOCK_SIZE,

  MT29F8G08_NUM_BLOCKS,

  MT29F8G08_WIDTH

};

 

I also updated the assert(entry_count < 257) in PageOrderMap::init to allow entry count of 1024, this is the count passed into the function.

When I try to open the flash device it never returns with a device handle. Stepping through the code, the call to Mapper::scanAndBuildPhyMap never returns.

Has anyone used the Micron flash, I'm not sure what I've missed setting up the Micron MT29F8G08ABABWP for use with MQX and FFS? 

Thanks for your time, any help is appreciated.

Update:

I'm marking Soledad's answer as correct.  After updating to uint16 entries correctly in PageOrderMap, changing BSP_VIRTUAL_PAGE_SIZE to 2048 worked.  The device handle is now returned and MFS installs.

标签 (1)
0 项奖励
回复
1 解答
3,502 次查看
soledad
NXP Employee
NXP Employee

Hi,

Please try changing the below macro in the file twrk21f120m.h

#define BSP_VIRTUAL_PAGE_SIZE               (512)

to

            #define BSP_VIRTUAL_PAGE_SIZE               (2048) //(512)

 

This file is located at the path: C:\Freescale\Freescale_MQX_4_2\mqx\source\bsp\twrk21f120m

 

Please let me know if this helps.


Have a great day,
Soledad

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

在原帖中查看解决方案

0 项奖励
回复
4 回复数
3,502 次查看
randalljordan
Contributor III

Thank you for your reply.  Changing the value did not make a difference.

What I did find was that the assertion (EntryCount < 256)

in PageOrderMap::init(unsigned entryCount, unsigned maxEntryValue) in page_order_map.cpp is failing.

The entry count for the MT29F8G08 is 1024.  I increased the count to 1025 and now a device handle is returned and MFS can be installed.

My current problem is that each time power is cycled none of the files created using MFS can be found. I can create files and write to them.  The proper byte count is returned after each write, I'm not sure what setting I've missed that would allow the files to be found after a power cycle.

thank you for your time.

Randy

0 项奖励
回复
3,502 次查看
thomasbattko
Contributor I

Hello,

I have experienced a situation like yours.  If you do not gracefully close the wear leveling layer the system does not save fat table updates and thus when your system reboots it has no knowledge of the file system changes that were made.  The only way around this issue that I am aware of is to force the wear leveling system to close and then reopen after modifications to the fat tables.  

Placing the following after any modifications to the fat table:

mfs_nandflash_wl_close(); // close all to force a flush and save of fat table

Of course to continue using your nand you will have to follow this by reopening:

mfs_nandflash_wl_open();

I hope this helps you.

Tom

3,502 次查看
randalljordan
Contributor III

Thanks Tom,

I tried the change but it did not make a difference. I’ve narrowed down the issue to NANDFLASHERR_ECC_FAILED in nfc_wl_cpp when trying to open MFS. I’m sure there is a setting I’m missing, I just don’t know which setting.

Thanks for your help I appreciate it.

Randy

0 项奖励
回复
3,503 次查看
soledad
NXP Employee
NXP Employee

Hi,

Please try changing the below macro in the file twrk21f120m.h

#define BSP_VIRTUAL_PAGE_SIZE               (512)

to

            #define BSP_VIRTUAL_PAGE_SIZE               (2048) //(512)

 

This file is located at the path: C:\Freescale\Freescale_MQX_4_2\mqx\source\bsp\twrk21f120m

 

Please let me know if this helps.


Have a great day,
Soledad

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

0 项奖励
回复