summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-26 01:36:32 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-26 01:36:32 +0300
commit237c519ac43060d766a611f30d9aa39dc277cd16 (patch)
treed6ea096d11cdf3e7a5ad301e737ecc95732cb69f /esp8266
parent650df97c063a7af47c2d70a2b0c1fe7da3da5a0e (diff)
downloadmicropython-237c519ac43060d766a611f30d9aa39dc277cd16.tar.gz
micropython-237c519ac43060d766a611f30d9aa39dc277cd16.zip
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).
Diffstat (limited to 'esp8266')
-rw-r--r--esp8266/scripts/flashbdev.py6
1 files 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)