From 237c519ac43060d766a611f30d9aa39dc277cd16 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 26 Apr 2016 01:36:32 +0300 Subject: [PATCH] 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). --- esp8266/scripts/flashbdev.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esp8266/scripts/flashbdev.py b/esp8266/scripts/flashbdev.py index 1427d9c427..07ed966020 100644 --- a/esp8266/scripts/flashbdev.py +++ b/esp8266/scripts/flashbdev.py @@ -60,7 +60,9 @@ if 22 >= size >= 18: machine.reset() while 1: time.sleep(1) -if esp.flash_size() < 1024*1024: +size = esp.flash_size() +if size < 1024*1024: bdev = None else: - bdev = FlashBdev() + # 16K at the flash end is reserved for SDK params storage + bdev = FlashBdev((size - 16384) // FlashBdev.SEC_SIZE - FlashBdev.START_SEC)