8000 sflash_diskio_littlefs.c: Enable block level wear-leveling · pycom/pycom-micropython-sigfox@a66cdec · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit a66cdec

Browse files
robert-hhpeter-pycom
authored andcommitted
sflash_diskio_littlefs.c: Enable block level wear-leveling
Otherwise, superblocks will be overly used and wear out in cases, where a single file is rewritten again and again. See https://forum.pycom.io/topic/6734/external-flash-lose-files
1 parent 56dd0ed commit a66cdec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

esp32/littlefs/sflash_diskio_littlefs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct lfs_config lfscfg =
4545
.prog_size = SFLASH_BLOCK_SIZE,
4646
.block_size = SFLASH_BLOCK_SIZE,
4747
.block_count = 0, // To be initialized according to the flash size of the chip
48-
.block_cycles = 0, // No block-level wear-leveling
48+
.block_cycles = 1000, // Enable block-level wear-leveling
4949
/* Current implementation of littlefs_read/prog/erase/sync() functions only operates with
5050
* full blocks, always the starting address of the block is passed to the driver.
5151
* This helps on the Power-loss resilient behavior of LittleFS, with this approach the File System will not be corrupted by corruption of a single file/block

0 commit comments

Comments
 (0)
0