ESP32C3FN4 + 8MB external Flash (W25Q64JVXGIQ_TR)

fsbmaster
Posts: 2
Joined: Wed Jul 21, 2021 10:18 am

ESP32C3FN4 + 8MB external Flash (W25Q64JVXGIQ_TR)

Postby fsbmaster » Sun Mar 31, 2024 10:36 am

Hello everyone,

In addition to my ESP32C3FN4 chip with embedded 4 MB flash, I also installed an 8 MB external SPI flash from Winbond.
Admittedly - unfortunately - because 12 MB is not selectable, neither in the Arduino IDE nor in the IDF menuconfig. The attempts to manually write 12 MB to the sdkconfig failed because the entry is automatically corrected when flashing.

Is there a way to get the 12 MB to work? or is it just not supported?

Thank you

Code: Select all

Connecting...
Chip is ESP32-C3 (QFN32) (revision v0.4)
Features: WiFi, BLE, Embedded Flash 4MB (XMC)
Crystal is 40MHz
MAC: f4:12:fa:2c:ec:f4
Changing baud rate to 460800
Changed.
Enabling default SPI flash mode...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00010000 to 0x0003cfff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000d000 to 0x0000efff...
Erasing flash...
SHA digest in image updated
Took 0.43s to erase flash block
Writing at 0x00005400... (100 %)
Wrote 22528 bytes at 0x00000000 in 0.7 seconds (248.6 kbit/s)...
File  md5: db416f60dd927a13e6f1298d81889acb
Flash md5: 6d9d47a9a34be43ee3ccfd37242b6f18
MD5 of 0xFF is 50071fd3b50d795253dd99f7e6e77294

A fatal error occurred: MD5 of file does not match data in flash!

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32C3FN4 + 8MB external Flash (W25Q64JVXGIQ_TR)

Postby ESP_Sprite » Mon Apr 01, 2024 2:02 am

You cannot have both internal and external flash as your main memory; the two devices will interfere, as you noticed. If you just want to store some extra data in the 8MB chip, you can connect it to its own GPIOs and access it via a GSPI peripheral; ESP-IDF has support for running filesystems on that but I'm not aware if Arduino does.

lbernstone
Posts: 829
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32C3FN4 + 8MB external Flash (W25Q64JVXGIQ_TR)

Postby lbernstone » Mon Apr 01, 2024 2:15 am

The ESP-IDF example should essentially work. Use steps 1-3 from the example, then call LittleFS.begin with the partition name you gave to the external flash. You won't be able to do standard OTA on that space, but with some creativity you could load firmware from it.

fsbmaster
Posts: 2
Joined: Wed Jul 21, 2021 10:18 am

Re: ESP32C3FN4 + 8MB external Flash (W25Q64JVXGIQ_TR)

Postby fsbmaster » Mon Apr 01, 2024 9:51 am

Thank you for your responses.

I will simply replace the ESP32C3FN4 with a variant without embedded flash so that I can use the 8MB external flash as main flash. I think that will be the easiest.

The plan was to create two OTA partitions and a SPIFFS to transfer firmware via BLE, unpack chunks and load them alternately (with rollback option) onto the OTA partitions.

That should work then, right?

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32C3FN4 + 8MB external Flash (W25Q64JVXGIQ_TR)

Postby ESP_Sprite » Tue Apr 02, 2024 1:47 am

You can, but normally (in ESP-IDF) you'd transfer the OTA image directly from BTLE to the unused OTA partition. That saves you the space for the SPIFFS partition.

Who is online

Users browsing this forum: No registered users and 69 guests