I have used external flash memory IC as winbond (W25Q32FV),i am using example of extenal_flash_file c file ,to run,i am facing some issues while i run program and i check the spi pins are configured,it all correct,when suppose to run the code
I (2702) example: Initializing external SPI Flash
I (2702) example: Pin assignments:
I (2702) example: MOSI: 11 MISO: 13 SCLK: 12 CS: 10
I (2702) example: DMA CHANNEL: 3
I (2712) spi_flash: detected chip: winbond
I (2712) spi_flash: flash io: dio
I (2722) example: Initialized external Flash, size=4096 KB, ID=0xef4016
I (2722) example: Adding external Flash as a partition, label="storage_fat", size=4096 KB
I (2732) example: Erasing partition range, offset=0 size=4096 KB
I (14572) example: Listing data partitions:
I (14572) example: - partition 'nvs', subtype 2, offset 0x13000, size 16 kB
I (14572) example: - partition 'otadata', subtype 0, offset 0x17000, size 8 kB
I (14582) example: - partition 'phy_init', subtype 1, offset 0x19000, size 4 kB
I (14592) example: - partition 'storage', subtype 2, offset 0xa20000, size 16 kB
I (14592) example: - partition 'storage_fat', subtype 129, offset 0x0, size 4096 kB
I (14602) example: Mounting FAT filesystem
W (15712) vfs_fat_spiflash: f_mount failed (13)
I (15712) vfs_fat_spiflash: Formatting FATFS partition, allocation unit size=4096
I (16362) vfs_fat_spiflash: Mounting again
I (16362) example: FAT FS: 4024 kB total, 4024 kB free
I (16362) example: Opening file
I (16812) example: File written
I (16812) example: Reading file
I (16812) example: Read from file: 'Written using ESP-IDF v5.0.3-dirty'
* This kind of warning comes when i run the application("W (15712) vfs_fat_spiflash: f_mount failed (13)"),how to overcome the issues, it this create any impact on program while using,
*other than that some error I have faced like this
("I (8561) example: Mounting FAT filesystem
E (8561) wl_flash: config(100): result = 0x00000102
E (8571) wear_levelling: wl_mount: config instance=0x00000000, result=0x102
E (8581) vfs_fat_spiflash: failed to mount wear levelling layer. result = 258
E (8581) example: Failed to mount FATFS (ESP_ERR_INVALID_ARG)")
but i have given partition label as new name ,default it is storage,i have change to flash_storage,then error get avoided
automatically partition table allocate the memory and it is fat,without adding manually on partition table
"I (14592) example: - partition 'storage_fat', subtype 129, offset 0x0, size 4096 kB"
Atlast,how to confirm fat file using external flash memory is working or not,need some giudelines or examples?
external flash using fat file system
Re: external flash using fat file system
Hello. I am sorry but I didn't fully understand if the example works for you or not?
As you can see here
there already is a partition named "storage", which is located on the internal flash. The partition label has to be unique, so the external partition has to have a different name - which seems like it has, since there is "storage_fat" partition as well.
Then the log follows:
There is "vfs_fat_spiflash: f_mount failed (13)" which should be fine (no filesystem present at the moment) as long the formatting succeeds. Not there should be FAT12 filesystem present on the external flash chip. The code then writes ESP-IDF version to a file and then reads it, which seems to be working.
In the example code there is function, which registers the partition on the external flash chip to the partition table under it's own partition label (which has to be different than "storage" because there already is a partition present in the internal flash with this name). Then later in the example the external chip partition is mounted via its unique partition label.
As you can see here
Code: Select all
I (14572) example: - partition 'nvs', subtype 2, offset 0x13000, size 16 kB
I (14572) example: - partition 'otadata', subtype 0, offset 0x17000, size 8 kB
I (14582) example: - partition 'phy_init', subtype 1, offset 0x19000, size 4 kB
I (14592) example: - partition 'storage', subtype 2, offset 0xa20000, size 16 kB
I (14592) example: - partition 'storage_fat', subtype 129, offset 0x0, size 4096 kBThen the log follows:
Code: Select all
I (14602) example: Mounting FAT filesystem
W (15712) vfs_fat_spiflash: f_mount failed (13)
I (15712) vfs_fat_spiflash: Formatting FATFS partition, allocation unit size=4096
I (16362) vfs_fat_spiflash: Mounting again
I (16362) example: FAT FS: 4024 kB total, 4024 kB free
I (16362) example: Opening file
I (16812) example: File written
I (16812) example: Reading file
I (16812) example: Read from file: 'Written using ESP-IDF v5.0.3-dirty'In the example code there is
Code: Select all
esp_partition_register_external(esp_flash_t *flash_chip, size_t offset, size_t size, const char *label, esp_partition_type_t type, esp_partition_subtype_t subtype, const esp_partition_t **out_partition)Who is online
Users browsing this forum: No registered users and 1 guest
