ESP internal flash memory for user

eliott
Posts: 12
Joined: Sat Mar 28, 2020 11:57 am

ESP internal flash memory for user

Postby eliott » Sun Jan 10, 2021 7:30 pm

Hello,

I'm using ESP32-VROOM-32D dev board for testing purpose to replace ESP8266 used with AT commands and 8 bit MCU.

I saw in the memory flash partition table with two ota partition there is still around 1Mbit free un the flash.

First question:

I want to use this free memory for my program, in this case I don't have to add other flash memory.

I only want to know If it's okay to use the ESP free flash memory for my own program ? this won't annoy the ESP to work normally ?

Second question:

I didn't really find this usage for partition sub_type:

I need a eeprom like storage, I thinks nvs is a good choice, it's identifed as "WiFi data".
A free flash memory space to store a 80k web page, SPIFFS seems to be nice. Identified as "Unknown data"

Partition.csv:

Code: Select all

nvs,         data, nvs,     ,        0x4000,
otadata,     data, ota,     ,        0x2000,
phy_init,    data, phy,     ,        0x1000,
user_eeprom, data, nvs,     ,        0x1000,
user_data,   data, SPIFFS,  ,        0xD4000,
factory,     app,  factory, ,        1M,
ota_0,       app,  ota_0,   ,        1M,
ota_1,       app,  ota_1,   ,        1M,
Boot console:

Code: Select all

I (71) boot: Chip Revision: 1
I (72) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (41) boot: ESP-IDF v4.0-dirty 2nd stage bootloader
I (41) boot: compile time 19:49:56
I (41) boot: Enabling RNG early entropy source...
I (46) boot: SPI Speed      : 40MHz
I (50) boot: SPI Mode       : DIO
I (54) boot: SPI Flash Size : 4MB
I (59) boot: Partition Table:
I (62) boot: ## Label            Usage          Type ST Offset   Length
I (69) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (77) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (84) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (92) boot:  3 user_eeprom      WiFi data        01 02 00010000 00001000
I (99) boot:  4 user_data        Unknown data     01 82 00011000 000d4000
I (107) boot:  5 factory          factory app      00 00 000f0000 00100000
I (114) boot:  6 ota_0            OTA app          00 10 001f0000 00100000
I (122) boot:  7 ota_1            OTA app          00 11 002f0000 00100000
I (129) boot: End of partition table
I (134) boot: Defaulting to factory image
Everythings seem okay for you ?

thank you for helping.

Eliott

ESP_Minatel
Posts: 88
Joined: Mon Jan 04, 2021 2:06 pm

Re: ESP internal flash memory for user

Postby ESP_Minatel » Mon Jan 11, 2021 9:02 am

Hi,

If you're not going to use OTA, you can use the two OTA partitions to create a custom storage for your project.

See the Partition Table

eliott
Posts: 12
Joined: Sat Mar 28, 2020 11:57 am

Re: ESP internal flash memory for user

Postby eliott » Thu Jan 14, 2021 6:21 pm

Thank you for you answer

I'll use ota update so i'll keep my "user_data" SPIFFS partition at adress 0x11000.

The SPIFFS parition initialiser works and say 790ko remaining, it's inought to store my data.

I don't understand why ota require two partitions, the factory partition can't be erased and writen via ota ?

Today via usb and idf.py utility I noted that my binary is writen on the factory partition: 0xf0000 ESP_MCU.bin

If I start an ota update i'll write on ota_0 partition and boot on ota_0 parition. On the next ota update i'll do the same on ota_1 partion, then ota_0.

So my factory partion will not be used anymore and keep an orld version of my program ?

Reagrds,

Eliott.

chegewara
Posts: 1392
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP internal flash memory for user

Postby chegewara » Thu Jan 14, 2021 7:02 pm

eliott wrote:
Thu Jan 14, 2021 6:21 pm

I don't understand why ota require two partitions, the factory partition can't be erased and writen via ota ?

Today via usb and idf.py utility I noted that my binary is writen on the factory partition: 0xf0000 ESP_MCU.bin

If I start an ota update i'll write on ota_0 partition and boot on ota_0 parition. On the next ota update i'll do the same on ota_1 partion, then ota_0.

So my factory partion will not be used anymore and keep an orld version of my program ?

Reagrds,

Eliott.
Thats correct. That probably means you dont need factory partition and just leave only 2 ota partitions.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 44 guests