-
1ESP32 Partition Mapping, Create a new Partition CSV-File
First change Partition Tables in Arduino:
Folder: C:\Users\XXXXX\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\tools\partitions
Create a New File, as Example "Storage.csv":
# Name,Type,SubType,Offset,Size,Flags nvs,data,nvs,0x9000,0x5000, otadata,data,ota,0xe000,0x2000, app0,app,ota_0,0x10000,0x140000, eeprom,data,0x99,0x150000,0x1000, storage,data,0x99,0x151000,0x200000, spiffs,data,spiffs,0x351000,0xaf000,
-
2Changes in board.txt
Change board.txt for your Board:
Folder: C:\Users\XXXXX\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\
lolin32.menu.PartitionScheme.default=Default lolin32.menu.PartitionScheme.default.build.partitions=default lolin32.menu.PartitionScheme.no_ota=No OTA (Large APP) lolin32.menu.PartitionScheme.no_ota.build.partitions=no_ota lolin32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 lolin32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA) lolin32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs lolin32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -->lolin32.menu.PartitionScheme.custom=Custom Storage -->lolin32.menu.PartitionScheme.custom.build.partitions=storage -->lolin32.menu.PartitionScheme.custom.upload.maximum_size=1966080
-
3Choose in Board-Menu your Board and Partition Options "Storage"
Now you can upload a Binary Image with esp32 Flash Tool from here:
-
4Example Sketch
const esp_partition_t* part; spi_flash_mmap_handle_t handle; void* data; esp_err_t err; void setup() { part = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, "storage"); esp_partition_find(ESP_PARTITION_TYPE_DATA,ESP_PARTITION_SUBTYPE_ANY, "storage"); err = esp_partition_mmap(part, 0, part->size, SPI_FLASH_MMAP_DATA, (const void**)&data, &handle); if (err != ESP_OK) { printf("esp_partition_mmap failed. (%d)\n", err); //delay(10000); abort(); } //Example for Display data without overhead: vspi->beginTransaction(SPISettings(spiClk, MSBFIRST, SPI_MODE0)); digitalWrite(5, LOW); //pull SS slow to prep other end for transfer unsigned long offset=0; //Access Partition on StartByte 0, sending Bytes directly to SPI Display vspi->writeBytes((uint8_t*)data + offset, width*height * 3); digitalWrite(5, HIGH); //pull ss high } } void loop(){ }
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.