external flash using fat file system
Posted: Tue Apr 01, 2025 11:25 am
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?
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?