Where do I found filesystem/RAM basics?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
xboxplayer
Posts: 6
Joined: Fri Mar 25, 2022 10:14 am

Where do I found filesystem/RAM basics?

Post by xboxplayer » Fri Mar 25, 2022 10:34 am

Hi,

I'm new in Micropython and ESP8266 too. I could connect and flash official prebuilt ESP8266 bin (v1.18 (2022-01-17) .bin [.elf] [.map] [Release notes] (latest) from https://micropython.org/download/esp8266/) and it works well.

If I'm right my ESP-12F module has a 4MB flash built in. I installed 2MB+ bin file.

Where can I found how the flash is separated for parts? I'm interested in built in filesystems / available free space.
Now it is enough, but if I understand it well the current filessystem "/" size is only 3MB. There are any free space I could use/mount? or I have to connect external flash?

Code: Select all

>>> uos.statvfs("/")
(4096, 4096, 763, 740, 740, 0, 0, 0, 0, 255)
the code from viewtopic.php?f=2&t=11834&p=64410&hilit ... tem#p64410 sais:

Code: Select all

Littlefs v2 filesystem
0008  magic                            littlefs
0014  version                          0x20000
0018  block_size                       4096
001c  block_count                      763
0020  name_max                         255
0024  file_max                         2147483647
0028  attr_max                         1022
About SRAM:
as I see it has only 32KB available by default. Can I use external SRAM e.g. SPI 23LC1024 to expand RAM size?

Code: Select all

>>> import gc
>>> gc.mem_free()
33392
Thanks

xboxplayer
Posts: 6
Joined: Fri Mar 25, 2022 10:14 am

Re: Where do I found filesystem/RAM basics?

Post by xboxplayer » Fri Mar 25, 2022 10:59 am

Oh, f*** I was confused... sorry
3MB is good in 4MB flash... :-)

- But can you give me link about fs?
- And what about external SRAM?

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

Re: Where do I found filesystem/RAM basics?

Post by Roberthh » Fri Mar 25, 2022 11:13 am

The filesystem used is littlefs. Information about it can be found on the web. You can add more file system space using external flash devices of a Micro SD card using the SPI interface. But that will use a lot of the precious RAM. RAM cannot be expanded. You may be able to get a little bit more heap space by building your own firmware, but that would be just a few kByte. If you have the need for more RAM, you should use a different hardware, like an ESP32, which comes in many memory configurations, or Raspberry Pi Pico. For the latter there are also many different configurations available.

xboxplayer
Posts: 6
Joined: Fri Mar 25, 2022 10:14 am

Re: Where do I found filesystem/RAM basics?

Post by xboxplayer » Fri Mar 25, 2022 11:50 am

Ty,

I don't know why I thought 4MB flash as 4GB :-) however I always thought MB, i realized it is only 3mill bytes, where is the others, asked myself :-)

I found that Arduino has a solution about RAM expanding, I haven't inspected yet, maybe I misunderstand something again... :-)

Post Reply