ESP32-IDF external NOR flash max size (IDFGH-6367)

tuanhd2
Posts: 5
Joined: Mon Dec 06, 2021 9:19 am

ESP32-IDF external NOR flash max size (IDFGH-6367)

Postby tuanhd2 » Mon Dec 06, 2021 9:29 am

Hi, I have tried ESP32 Wroom with example external flash fatfs in folder "storage" with W25Q01JV (1Gb) but the size of the flash return is 0 KB

Code: Select all

I (428) exterl_flash: Initializing external SPI Flash
I (438) exterl_flash: Pin assignments:
I (438) exterl_flash: MOSI: 13   MISO: 12   SCLK: 14   CS: 15
I (448) spi_flash: detected chip: generic
I (448) spi_flash: flash io: dio
I (458) exterl_flash: test size = 2 KB
I (458) exterl_flash: Initialized external Flash, size=0 KB, ID=0xef4021
I (468) exterl_flash: Adding external Flash as a partition, label="storage", size=0 KB
I (478) exterl_flash: Listing data partitions:
I (478) exterl_flash: - partition 'nvs', subtype 2, offset 0x9000, size 24 kB
I (488) exterl_flash: - partition 'phy_init', subtype 1, offset 0xf000, size 4 kB
I (498) exterl_flash: - partition 'storage', subtype 129, offset 0x0, size 0 kB
I (508) exterl_flash: Mounting FAT filesystem
E (508) wl_flash: config(108): result = 0x00000102
E (518) wear_levelling: wl_mount: config instance=0x00000000, result=0x102
E (528) vfs_fat_spiflash: failed to mount wear levelling layer. result = 258
E (528) exterl_flash: Failed to mount FATFS (ESP_ERR_INVALID_ARG)
When I change to a new one flash (4 MB) external flash W25Q32 same external flash for example so it works well.
My question is: How do I work with W25Q01JV and what is the max size of external flash esp32 can support?
Thank you

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP32-IDF external NOR flash max size

Postby ESP_igrr » Mon Dec 06, 2021 9:38 pm

Hi tuanhd2,

Which ESP-IDF version are you using?

In all versions of ESP-IDF, SPI flash driver supports 24-bit addressing (hence 16 MB max flash size) for most flash chips.

Starting with ESP-IDF 4.4, 32-bit addressing was added for a few specific flash models (W25Q256, GD25Q256, and one MXIC part).
It looks like your flash chip has similar command set to W25Q256, so it might work with the same driver.

tuanhd2
Posts: 5
Joined: Mon Dec 06, 2021 9:19 am

Re: ESP32-IDF external NOR flash max size

Postby tuanhd2 » Tue Dec 07, 2021 3:00 am

Thank you for your response.
My module is ESP32­WROOM­32D with 8MB internal flash, and I need 1Gb external flash for only saving data ( no need to download code and store system file).

tuanhd2
Posts: 5
Joined: Mon Dec 06, 2021 9:19 am

Re: ESP32-IDF external NOR flash max size

Postby tuanhd2 » Tue Dec 07, 2021 3:36 am

Hi, I just try with esp32-idf version 4.4 so it still have error same above

Code: Select all

I (474) exterl_flash: Initialized external Flash, size=0 KB, ID=0xef4021
I (484) exterl_flash: Adding external Flash as a partition, label="storage", size=0 KB
I (494) exterl_flash: Listing data partitions:
I (494) exterl_flash: - partition 'nvs', subtype 2, offset 0x9000, size 24 kB
I (504) exterl_flash: - partition 'phy_init', subtype 1, offset 0xf000, size 4 kB
I (514) exterl_flash: - partition 'storage', subtype 129, offset 0x0, size 0 kB
I (524) exterl_flash: Mounting FAT filesystem

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP32-IDF external NOR flash max size

Postby ESP_igrr » Tue Dec 07, 2021 2:49 pm

Thanks for trying this! I guess this means that we need to add support for this specific flash part to the spi_flash driver. I'll create a task internally so that we can plan working on this.

tuanhd2
Posts: 5
Joined: Mon Dec 06, 2021 9:19 am

Re: ESP32-IDF external NOR flash max size (IDFGH-6367)

Postby tuanhd2 » Tue Dec 07, 2021 3:49 pm

Thank you, maybe I need to change use the SD card for saving my data :))), waiting for your new update version, :D :D :D

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP32-IDF external NOR flash max size (IDFGH-6367)

Postby ESP_igrr » Tue Dec 07, 2021 4:08 pm

At this point SD or eSD or eMMC could indeed be the best solution if you need to save lots of data. What are you planning to use as the filesystem, FAT or something custom?

tuanhd2
Posts: 5
Joined: Mon Dec 06, 2021 9:19 am

Re: ESP32-IDF external NOR flash max size (IDFGH-6367)

Postby tuanhd2 » Tue Dec 07, 2021 4:18 pm

I will use FATFs, because I need an SD card (old solution in external nor flash) for reading and saving audio file.

Who is online

Users browsing this forum: No registered users and 158 guests