Difference between revisions of "STM32 W25Qxx LittleFS"

From Stm32World Wiki
Jump to navigation Jump to search
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:C]][[Category:STM32 Development]][[Category:STM32 HAL]][[Category:STM32CubeMX]][[Category:STM32CubeIde]][[Category:Embedded]][[Category:STM32]]{{metadesc|Running LittleFS on W25Qxx Serial Flash on STM32}}
 
[[Category:C]][[Category:STM32 Development]][[Category:STM32 HAL]][[Category:STM32CubeMX]][[Category:STM32CubeIde]][[Category:Embedded]][[Category:STM32]]{{metadesc|Running LittleFS on W25Qxx Serial Flash on STM32}}
 +
While working on [[STM32 W25Qxx]] I briefly experimented with getting FATFS up and running on the flash device.  I quickly realised that this is a really poor idea.  The problem is that [[W25Qxx]] flash devices has got a limited number of writes.  FATFS works on some fixed tables and these tables will be updated on each file write.  A typical [[W25Qxx]] got a number of guaranteed writes around 100000.  If you imagine a system that update a file every second, this could mean that sector will wear out in < 2 days.
 +
 +
A much better approach is to use a file system with built-in wear levelling and fortunately [https://github.com/littlefs-project/littlefs LittleFS] is just that.
 +
  
 
== Miscellaneous Links ==
 
== Miscellaneous Links ==
 
+
* [[STM32 W25Qxx|STM32 W25Qxx Library]]
 
* [https://github.com/lbthomsen/stm32-w25qxx-littlefs Source on Github]
 
* [https://github.com/lbthomsen/stm32-w25qxx-littlefs Source on Github]
 
* [https://github.com/littlefs-project/littlefs LittleFS on Github]
 
* [https://github.com/littlefs-project/littlefs LittleFS on Github]

Latest revision as of 14:41, 19 April 2022

While working on STM32 W25Qxx I briefly experimented with getting FATFS up and running on the flash device. I quickly realised that this is a really poor idea. The problem is that W25Qxx flash devices has got a limited number of writes. FATFS works on some fixed tables and these tables will be updated on each file write. A typical W25Qxx got a number of guaranteed writes around 100000. If you imagine a system that update a file every second, this could mean that sector will wear out in < 2 days.

A much better approach is to use a file system with built-in wear levelling and fortunately LittleFS is just that.


Miscellaneous Links