free file space on esp-32 wroom

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
devnull
Posts: 53
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall

free file space on esp-32 wroom

Postby devnull » Wed Mar 15, 2017 11:08 am

I thought that I had this cracked, based on the calcs in this thread: viewtopic.php?t=2778

But the value of 0.046875 MB free space just can't be correct ??

Code: Select all

def dfree():
   bits = statvfs('/flash')
   print(bits)
   blksize = bits[0] # 4096
   blkfree = bits[3] # 12
   freesize = blksize * blkfree # 49152
   mbcalc = 1024*1024 # 1048576
   mbfree = freesize / mbcalc # 0.046875
   print(mbfree)


>>> dfree()
(4096, 4096, 58, 12, 12, 0, 0, 0, 0, 255)
0.046875



What am I doing wrong ??

User avatar
Roberthh
Posts: 529
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: free file space on esp-32 wroom

Postby Roberthh » Wed Mar 15, 2017 11:22 am

The calculation looks consistent. 12 Blocks of 4 kBytes each are 48 kbytes ~ 0.04688 MBytes. The actual esp32 port has a flash filesystem size of 256 kBytes (64 blocks). You can increase that in micropython-esp32/esp32/modules/flashbdev.py
, last line.


Return to “Other Boards”

Who is online

Users browsing this forum: No registered users and 1 guest