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).
This commit is contained in:
Paul Sokolovsky 2016-04-26 01:36:32 +03:00
parent 650df97c06
commit 237c519ac4
1 changed files with 4 additions and 2 deletions

View File

@ -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)