I have successfully used the MFS nandflash filesystem on the Vybrid tower kit, but I am having no luck in getting it to work on our custom hardware.
Hardware have been verified using low level nand driver ()
I am using the msf_nandflash example code for testing.
First I got an assert in PageOrderMap::Init
entryCount was 512, and the comments in the code suggested that I needed to change to 16bit entries. I modified the code accordigly.
Second I get an error when trying to initialize the filesystem.
Traced it to nfc_wl.cpp, nfc_read_page_with_metadata:
/* ECC Fix FAILED */
result = NANDFLASHERR_ECC_FAILED;
I can't get past this error, have tried Changing the ECC_SIZE to 0, 4, 8
Always same result.
Nand device: MT29F16G16ADACAH4_IT
Device setup:
/* MT29F16G16ADACAH4_IT organization */
#define MT29F16G16_PHYSICAL_PAGE_SIZE 4096
#define MT29F16G16_SPARE_AREA_SIZE 224
#define MT29F16G16_BLOCK_SIZE 262144 /* 256kB */
#define MT29F16G16_NUM_BLOCKS 8192
#define MT29F16G16_WIDTH 16
Bsp nand setup:
const NANDFLASH_INIT_STRUCT _bsp_nandflash_init =
{
/* NAME */ "nandflash:",
#if BSPCFG_NANDFLASH_USE_DMA
/* Low level driver */ &_nandflash_nfc_dma_devif,
#else
/* Low level driver */ &_nandflash_nfc_devif,
#endif
/* NANDFLASH_INFO_PTR */ _MT29F16G16_organization_16bit,
/* VIRTUAL_PAGE_SIZE */ 540,
/* NUM_VIRTUAL_PAGES */ 1048576,
/* PHY_PAGE_SIZE_TO_VIRTUAL_PAGE_SIZE_RATIO */ 8,
/* ECC_SIZE */ 0,
/* WRITE_VERIFY */ 0,
/* DEVICE_SPECIFIC_DATA */ 0
};
Using MQX 4.1.2
/Jon
Solved! Go to Solution.
Finally got a working solution!
Bsp nand setup:
const NANDFLASH_INIT_STRUCT _bsp_nandflash_init =
{
/* NAME */ "nandflash:",
#if BSPCFG_NANDFLASH_USE_DMA
/* Low level driver */ &_nandflash_nfc_dma_devif,
#else
/* Low level driver */ &_nandflash_nfc_devif,
#endif
/* NANDFLASH_INFO_PTR */ _MT29F16G16_organization_16bit,
/* VIRTUAL_PAGE_SIZE */ 0,
/* NUM_VIRTUAL_PAGES */ 0,
/* PHY_PAGE_SIZE_TO_VIRTUAL_PAGE_SIZE_RATIO */ 0,
/* ECC_SIZE */ 0,
/* WRITE_VERIFY */ 0,
/* DEVICE_SPECIFIC_DATA */ 0
};
in platform bsp header file:
#define BSP_VIRTUAL_PAGE_SIZE 512
#define BSP_ECC_SIZE 4
This works, but not if I set BSP_ECC_SIZE to 8 !
With 8 I get the ECC_FAILURE mentioned before.
NXP suggests ECC_SIZE 8, device datasheet suggests 8, Vybrid RM and drivers support 8.
I think it is not good enough with ECC_SIZE 4, but at least it works.
Jon
After getting a working solution and testing it several times, I now have the same error again.
The solution I found is not working anymore, and I can only guess at what sequence of events led to a working solution before.
I don't think this is related to MFS, so I created a new thread here:
Any help is greatly appreciated
Jon
Finally got a working solution!
Bsp nand setup:
const NANDFLASH_INIT_STRUCT _bsp_nandflash_init =
{
/* NAME */ "nandflash:",
#if BSPCFG_NANDFLASH_USE_DMA
/* Low level driver */ &_nandflash_nfc_dma_devif,
#else
/* Low level driver */ &_nandflash_nfc_devif,
#endif
/* NANDFLASH_INFO_PTR */ _MT29F16G16_organization_16bit,
/* VIRTUAL_PAGE_SIZE */ 0,
/* NUM_VIRTUAL_PAGES */ 0,
/* PHY_PAGE_SIZE_TO_VIRTUAL_PAGE_SIZE_RATIO */ 0,
/* ECC_SIZE */ 0,
/* WRITE_VERIFY */ 0,
/* DEVICE_SPECIFIC_DATA */ 0
};
in platform bsp header file:
#define BSP_VIRTUAL_PAGE_SIZE 512
#define BSP_ECC_SIZE 4
This works, but not if I set BSP_ECC_SIZE to 8 !
With 8 I get the ECC_FAILURE mentioned before.
NXP suggests ECC_SIZE 8, device datasheet suggests 8, Vybrid RM and drivers support 8.
I think it is not good enough with ECC_SIZE 4, but at least it works.
Jon
Hello Jon,
Sorry for the delay, could you please try with the following configuration:
Nand device: MT29F16G16ADACAH4_IT
Device setup:
/* MT29F16G16ADACAH4_IT organization */
#define MT29F16G16_PHYSICAL_PAGE_SIZE 4096
#define MT29F16G16_SPARE_AREA_SIZE 224
#define MT29F16G16_BLOCK_SIZE 262144 /* 256kB */
#define MT29F16G16_NUM_BLOCKS 8192
#define MT29F16G16_WIDTH 16
Bsp nand setup:
const NANDFLASH_INIT_STRUCT _bsp_nandflash_init =
{
/* NAME */ "nandflash:",
#if BSPCFG_NANDFLASH_USE_DMA
/* Low level driver */ &_nandflash_nfc_dma_devif,
#else
/* Low level driver */ &_nandflash_nfc_devif,
#endif
/* NANDFLASH_INFO_PTR */ _MT29F16G16_organization_16bit,
/* VIRTUAL_PAGE_SIZE */ 540,
/* NUM_VIRTUAL_PAGES */ 0,
/* PHY_PAGE_SIZE_TO_VIRTUAL_PAGE_SIZE_RATIO */ 0,
/* ECC_SIZE */ 8,
/* WRITE_VERIFY */ 0,
/* DEVICE_SPECIFIC_DATA */ 0
};
Please let me know if this helps,
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I upgraded to MQX 4.2.0.2
Still having the same issue, some help would be appreciated.
Apparently the settings for VIRTUAL_PAGE_SIZE and ECC_SIZE gets overridden by two defines in the platform bsp header file: BSP_VIRTUAL_PAGE_SIZE and BSP_ECC_SIZE
Tried changing these parameters .
At one point I had the filesystem up and running, but after erasing the flash, it failed again.
Jon
I tried your suggestion, but get the exact same error as before.
What could be the cause for such an error?
Please provide further information / suggestions for resolving this issue.
Jon
Thank you.
I will not be able to test until thursday, will post back with my results.
Jon