Storing file in ESP32 file system

eaglehack
Posts: 3
Joined: Tue Jun 13, 2017 7:30 am

Storing file in ESP32 file system

Postby eaglehack » Tue Jun 13, 2017 7:36 am

Hi,
I have a requirement to do in ESP32,
I want to split 4MB of flash into 2MB+2MB, for code section and file system.
In file system, I want to download files from cloud(internet) and store it. And need to read/write during esp32 running and able send the file to internet when ever required.
Guide me how to implement this in ESP32.
I am using eclipse with tool chain linked with ESP-IDF.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Storing file in ESP32 file system

Postby Ritesh » Tue Jun 13, 2017 8:55 am

eaglehack wrote:Hi,
I have a requirement to do in ESP32,
I want to split 4MB of flash into 2MB+2MB, for code section and file system.
In file system, I want to download files from cloud(internet) and store it. And need to read/write during esp32 running and able send the file to internet when ever required.
Guide me how to implement this in ESP32.
I am using eclipse with tool chain linked with ESP-IDF.
Hi,

First of all, you need to use custom partition for SPI Flash Partition in which you can define your partitions for your application and file system whatever you want to use.

So, execute "make menuconfig" command and select "Partition Table ---> Partition Table (Factory app, two OTA definitions) ---> ( ) Custom partition table CSV" and provide name of csv file whatever you want to create as per your requirement.

This way you can split 4MB SPI Flash into 2MB+2MB in which first 2 MB (Not exactly as some of KBytes are used for Boot Loader and other configurations) is for your application image while next 2 MB is for you file system which you want.

There are some variant to use File System for ESP32 but i prefer to use SPIFFS file which is same as Linux File System created using Virtual File System and SPIFFS.

So, Please have look below Repository in which SPIFFS file system has been used and well tested till now.

https://github.com/loboris/ESP32_TFT_library

Let me know if you need any other help regarding partition and SPIFFS.
Regards,
Ritesh Prajapati

eaglehack
Posts: 3
Joined: Tue Jun 13, 2017 7:30 am

Re: Storing file in ESP32 file system

Postby eaglehack » Tue Jun 13, 2017 9:36 am

Thank you, I will try sample code referred and update.

eaglehack
Posts: 3
Joined: Tue Jun 13, 2017 7:30 am

Re: Storing file in ESP32 file system

Postby eaglehack » Tue Jun 13, 2017 12:45 pm

Thank you Ritesh, I will run referred code by you and update

Who is online

Users browsing this forum: No registered users and 157 guests