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

Commit f4864b5

Browse files
author
Craig Wm. Versek
committed
used the esp8266's method for sizing the flash file system
1 parent 4df414b commit f4864b5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

esp32/modules/flashbdev.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
class FlashBdev:
44

55
SEC_SIZE = 4096
6-
START_SEC = esp.flash_user_start() // SEC_SIZE
6+
RESERVED_SECS = 16
7+
START_SEC = esp.flash_user_start() // SEC_SIZE + RESERVED_SECS
8+
NUM_BLK = 0x6b - RESERVED_SECS
79

8-
def __init__(self, blocks):
10+
def __init__(self, blocks=NUM_BLK):
911
self.blocks = blocks
1012

1113
def readblocks(self, n, buf):
@@ -30,5 +32,5 @@ def ioctl(self, op, arg):
3032
# flash too small for a filesystem
3133
bdev = None
3234
else:
33-
# for now we use a fixed size for the filesystem
34-
bdev = FlashBdev(256 * 1024 // FlashBdev.SEC_SIZE)
35+
# 20K at the flash end is reserved for SDK params storage
36+
bdev = FlashBdev((size - 20480) // FlashBdev.SEC_SIZE - FlashBdev.START_SEC)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy