In fs_media_format() function (from FileX) why we can't define a sector size less than 512 bytes lets say 128 bytes. For my use case I want that the file granularity should be 128 bytes. Means I want to define size of 1 cluster = 1 sector where size of 1 sector should be 128 bytes only.
Below line is written in the FileX documentation:
"With reference to the specification, the bytes per sector may take on only the following values: 512, 1024, 2048 or 4096."
128 is a multiple of 32 so why we can't define a sector size to 128 bytes.
Hello @diego_charles
I understand that you have executed the filex_ram_disk example code with sector size of 128 bytes using RAM. But in my case, I am using NOR flash and my use case is covered in filex_levelx_mflash example and I am referring this example.
So, from this example in file filex_levelx_mflash.c I have just changed the below one thing:
By doing the above change now the fx_media_format() function is returning with error 0x90(FX_IO_ERROR).
Thanks for your detailed reply!
At quick glance, the error you are reporting seems to be a limitation within IO drivers implemented for the NOR Flash, rather than only the Filex APIs.
I can read from your picture that you are using our MIMX-RT1160 EVK, and no other changes to the example where done that the ones you reported. So, I will attempt to replicate the issue on my side.
Diegoh
As a quick reply,
If we can successfully setup the ram_disk demo with the desired media size ( with the requirement of sector size less than 512 bytes), this implies that there is a limitation related to fx_levelx_driver.c and/or lx_mflash_driver.c. ( IO drivers ) or in the memory itself.
For example when setting the LX_NOR_SECTOR_SIZE_BYTES to (320) we can below this error,
*RT1170 running the evkmimxrt1170_filex_levelx_mflash.
Theferefore, stepping down in to the IO drivers can help us debug the issue. More specifically in the _fx_levelx_driver() fuction.
Diego
Hoping to find you well.
I think the 512 bytes is a generic memory/media sector size, for example the sector size of an SD card, not the minimum sector size for the Filex's media format.
I succesfully ran the filex_ram_disk demo (from the RT1060 SDK) using a sector size of 128 bytes. Probably because RAM can be accessed with way more granularity than SD, or NOR, NAND devices.
Please let me know if you encounter any issues on your side.
Diego