Sector size to be created less than 512 bytes

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

Sector size to be created less than 512 bytes

636 Views
bhatnagarashish1998
Contributor I

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.

0 Kudos
4 Replies

603 Views
bhatnagarashish1998
Contributor I

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:

  • Change LX_NOR_SECTOR_SIZE_BYTES to LX_NOR_SECTOR_SIZE       // To make it 128 because the value of LX_NOR_SECTOR_SIZE is 128

By doing the above change now the fx_media_format() function is returning with error 0x90(FX_IO_ERROR).

ashishbhatnagar_0-1681306551013.jpeg

 

0 Kudos

598 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @bhatnagarashish1998 

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

 

0 Kudos

586 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @bhatnagarashish1998 

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,

diego_charles_0-1681416649663.png

*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

 

 

 

 

0 Kudos

616 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @bhatnagarashish1998 

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. 

diego_charles_0-1681244688951.png

Please let me know if you encounter any issues on your side.

Diego

0 Kudos