Which mode to used for reading from SPI flash
SPI_FLASH_DIO or
SPI_FLASH_FASTRD?
And I have two functions in my code which are
Code: Select all
static const esp_partition_t *add_partition(esp_flash_t *flash, const char *partition_label)
{
ESP_LOGI(SYNC, "Adding external Flash as a partition, label=\"%s\", size=%d KB", partition_label, flash->size / 1024);
const esp_partition_t *littlefs_partition;
ESP_ERROR_CHECK(esp_partition_register_external(flash, 0, flash->size, partition_label, ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_SPIFFS, &littlefs_partition));
return littlefs_partition;
}
static void list_data_partitions(void)
{
ESP_LOGI(SYNC, "Listing data partitions:");
esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, NULL);
for (; it != NULL; it = esp_partition_next(it))
{
const esp_partition_t *part = esp_partition_get(it);
ESP_LOGI(SYNC, "- partition '%s', subtype %d, offset 0x%x, size %d kB",
part->label, part->subtype, part->address, part->size / 1024);
}
esp_partition_iterator_release(it);
}
And so what on every start-up I have to call this add_partition function? and it is okay?