Skip to content

Commit 237c519

Browse files
committed
esp8266/scripts/flashbdev: Use all available Flash for filesystem.
All Flash sans firmware at the beginning and 16K SDK param block at the end is used for filesystem (and that's calculated depending on the Flash size).
1 parent 650df97 commit 237c519

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

esp8266/scripts/flashbdev.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ def set_bl_flash_size(real_size):
6060
machine.reset()
6161
while 1: time.sleep(1)
6262

63-
if esp.flash_size() < 1024*1024:
63+
size = esp.flash_size()
64+
if size < 1024*1024:
6465
bdev = None
6566
else:
66-
bdev = FlashBdev()
67+
# 16K at the flash end is reserved for SDK params storage
68+
bdev = FlashBdev((size - 16384) // FlashBdev.SEC_SIZE - FlashBdev.START_SEC)

0 commit comments

Comments
 (0)