Setting block size on littlefs #73967
-
Hi, I read the docs but it looks like there is no config for this parameter, and in littlefs.h the macro FS_LITTLEFS_DECLARE_CUSTOM_CONFIG has no parameter besides the ones that can be found in Kconfig. Browsing the sources it appears that a "const struct lfs_config" type is defined (in lfs.h) that holds a block_size field, and the readme.md shows an example where this field is used. I can't figure out where this gets its value of 0x2000, and how to eventually change it, so any help would be very appreciated. Processor is Atmel SAMV71Q21B, flash size 2MiB, RAM 384 KiB. Best regards |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I just read the datasheet for the SAMV71 and the FLASH can be erased only in blocks of 8192 bytes, that could be a good reason for the above. It would be interesting to know where this value is stored, it is not in the devicetree as far as I know. |
Beta Was this translation helpful? Give feedback.
-
Hi @davidemania, I don't think block size can be changed since it's a hardware characteristic of each Flash memory (@FRASTM can you confirm?). I believe it is stored in the Flash's parameter table. See https://www.macronix.com/Lists/ApplicationNote/Attachments/1870/AN114v1-SFDP%20Introduction.pdf |
Beta Was this translation helpful? Give feedback.
-
LittleFs complete set of devicetree parameters is in |
Beta Was this translation helpful? Give feedback.
Hi @davidemania, I don't think block size can be changed since it's a hardware characteristic of each Flash memory (@FRASTM can you confirm?). I believe it is stored in the Flash's parameter table. See https://www.macronix.com/Lists/ApplicationNote/Attachments/1870/AN114v1-SFDP%20Introduction.pdf