ESP32-C3 Additional Flash Memory

wiravdr
Posts: 4
Joined: Fri May 24, 2024 1:47 am

ESP32-C3 Additional Flash Memory

Postby wiravdr » Fri May 24, 2024 3:34 am

Hi, I have a project that previously used ESP-32-S3(ESP-32-MINI-1U) for the MCU on the prototype. The project was to display animations at 30 FPS according to acceleration data. In the prototype version, we used a 4GB SD card to store the animations and communicated with the MCU via regular SPI. Now the project is entering the mass production phase, but we have realised that ESP-32-S3 is overkill for this project and we want to switch to ESP32-C3 (ESP32-C3FH4 in particular) and use flash memory instead of SD card. But I read the documentation here: https://docs.espressif.com/projects/esp ... html#flash it only supports up to 16MB flash. Can I add 1 more flash memory to specifically store the animations using other SPI lines that communicate with regular SPI?

Thanks in advance :D

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

Re: ESP32-C3 Additional Flash Memory

Postby ESP_Sprite » Fri May 24, 2024 6:46 am

Yes, you can; ESP-IDF has support for secondary flash used as storage.

wiravdr
Posts: 4
Joined: Fri May 24, 2024 1:47 am

Re: ESP32-C3 Additional Flash Memory

Postby wiravdr » Mon May 27, 2024 2:44 am

Hi, thanks for the reply.
Can the external flash memory exceed the limit of 16MB ? I am planning to use 32 MB flash to only store the animations.

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

Re: ESP32-C3 Additional Flash Memory

Postby ESP_Sprite » Mon May 27, 2024 6:57 am

Yes. From what I can tell, we support 32-bit addresses for external flash, meaning anything <= 4GiB should work.

wiravdr
Posts: 4
Joined: Fri May 24, 2024 1:47 am

Re: ESP32-C3 Additional Flash Memory

Postby wiravdr » Tue May 28, 2024 4:24 am

Alright, one thing I'm still wondering though how is the additional flash going to be programmed (filled with the animations). Must it be done externally using SPI programmer or can it be done via the MCU ?

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

Re: ESP32-C3 Additional Flash Memory

Postby ESP_Sprite » Tue May 28, 2024 7:48 am

You can program the chip from the ESP32C3. Esptool can program secondary chips, see here how. Additionally, you could also program your firmware to receive data e.g. over the usb-serial-jtag peripheral and drop the received data into external flash.

wiravdr
Posts: 4
Joined: Fri May 24, 2024 1:47 am

Re: ESP32-C3 Additional Flash Memory

Postby wiravdr » Wed Jul 03, 2024 6:52 am

Hi! I am prototyping this project with ESP32-C3 mini devkit and have connected W25Q256 (256Mb/32MB) Winbond Flash Memory to the SPI2 Lines. But when programming the flash with more than 16 MB of files, the address wouldn't go more than 16MB.

is anything wrong with the command that I used to flash ? or is this just a limitation of ESP32 C3?

here's the command that I used to program the flash

Code: Select all

-p
COM5
-b
921600
write_flash
--flash_mode
dio
--flash_size 32MB
0x0000000
"Downloads/Animation Convert 2/Idle Animation/Angry.bin"
0x0057000
"Downloads/Animation Convert 2/Trigger Animation/Anime Laugh.bin"
0x0081000
"Downloads/Animation Convert 2/Idle Animation/Blinking.bin"
0x008A000
"Downloads/Animation Convert 2/Idle Animation/Boost.bin"
0x0125000
"Downloads/Animation Convert 2/Idle Animation/Cool Glasses.bin"
0x0158000
"Downloads/Animation Convert 2/Idle Animation/Dissapointed.bin"
0x0191000
"Downloads/Animation Convert 2/Idle Animation/Driving a Car.bin"
0x01ED000
"Downloads/Animation Convert 2/Idle Grayscale/Eating Ramen.bin"
0x033D000
"Downloads/Animation Convert 2/Idle Animation/Eyes Falling Down.bin"
0x038A000
"Downloads/Animation Convert 2/Idle Animation/Falling Asleep.bin"
0x0446000
"Downloads/Animation Convert 2/Idle Grayscale/Glitch Error New.bin"
0x06C8000
"Downloads/Animation Convert 2/Idle Animation/Happy.bin"
0x06EE000
"Downloads/Animation Convert 2/Idle Animation/Happy Eyes 2.bin"
0x0714000
"Downloads/Animation Convert 2/Idle Animation/Heart Eyes.bin"
0x075B000
"Downloads/Animation Convert 2/Idle Animation/Looking Around 2.bin"
0x0791000
"Downloads/Animation Convert 2/Idle Animation/Looking Around Happy.bin"
0x07D8000
"Downloads/Animation Convert 2/Idle Animation/Looking Around Rizz 2.bin"
0x0806000
"Downloads/Animation Convert 2/Idle Animation/Looking Left.bin"
0x0816000
"Downloads/Animation Convert 2/Idle Animation/Looking Right.bin"
0x082A000
"Downloads/Animation Convert 2/Idle Grayscale/Raining.bin"
0x0941000
"Downloads/Animation Convert 2/Idle Grayscale/Reading Book.bin"
0x0AC6000
"Downloads/Animation Convert 2/Trigger Animation/Sadness.bin"
0x0B33000
"Downloads/Animation Convert 2/Idle Animation/Scared.bin"
0x0B71000
"Downloads/Animation Convert 2/Idle Grayscale/Sil80.bin"
0x0C18000
"Downloads/Animation Convert 2/Idle Grayscale/Wanted Supra.bin"
0x0CE7000
"Downloads/Animation Convert 2/Idle Animation/Suspicious.bin"
0x0D23000
"Downloads/Animation Convert 2/Trigger Animation/Suspicious 2.bin"
0x0D79000
"Downloads/Animation Convert 2/Idle Grayscale/Underground Garage.bin"
0x1087000
"Downloads/Animation Convert 2/Idle Animation/Vampire.bin"
0x1224000
"Downloads/Animation Convert 2/Trigger Grayscale/Slot Machine Casino 2.bin"
0x13C1000
"Downloads/Animation Convert 2/Trigger Grayscale/Slot Machine Casino 3.bin"
--spi-connection
6,2,7,4,10
and here's the output

Code: Select all

Verifying 0x56a00 (354816) bytes @ 0x00000000 in flash against Downloads/Animation Convert 2/Idle Animation/Angry.bin...
-- verify OK (digest matched)
Verifying 0x29a00 (170496) bytes @ 0x00057000 in flash against Downloads/Animation Convert 2/Trigger Animation/Anime Laugh.bin...
-- verify OK (digest matched)
Verifying 0x9000 (36864) bytes @ 0x00081000 in flash against Downloads/Animation Convert 2/Idle Animation/Blinking.bin...
-- verify FAILED (digest mismatch)
Verifying 0x9a200 (631296) bytes @ 0x0008a000 in flash against Downloads/Animation Convert 2/Idle Animation/Boost.bin...
-- verify FAILED (digest mismatch)
Verifying 0x32a00 (207360) bytes @ 0x00125000 in flash against Downloads/Animation Convert 2/Idle Animation/Cool Glasses.bin...
-- verify OK (digest matched)
Verifying 0x38a00 (231936) bytes @ 0x00158000 in flash against Downloads/Animation Convert 2/Idle Animation/Dissapointed.bin...
-- verify OK (digest matched)
Verifying 0x5be00 (376320) bytes @ 0x00191000 in flash against Downloads/Animation Convert 2/Idle Animation/Driving a Car.bin...
-- verify OK (digest matched)
Verifying 0x150000 (1376256) bytes @ 0x001ed000 in flash against Downloads/Animation Convert 2/Idle Grayscale/Eating Ramen.bin...
-- verify FAILED (digest mismatch)
Verifying 0x4c200 (311808) bytes @ 0x0033d000 in flash against Downloads/Animation Convert 2/Idle Animation/Eyes Falling Down.bin...
-- verify FAILED (digest mismatch)
Verifying 0xbb800 (768000) bytes @ 0x0038a000 in flash against Downloads/Animation Convert 2/Idle Animation/Falling Asleep.bin...
-- verify FAILED (digest mismatch)
Verifying 0x282000 (2629632) bytes @ 0x00446000 in flash against Downloads/Animation Convert 2/Idle Grayscale/Glitch Error New.bin...
-- verify FAILED (digest mismatch)
Verifying 0x25e00 (155136) bytes @ 0x006c8000 in flash against Downloads/Animation Convert 2/Idle Animation/Happy.bin...
-- verify OK (digest matched)
Verifying 0x25e00 (155136) bytes @ 0x006ee000 in flash against Downloads/Animation Convert 2/Idle Animation/Happy Eyes 2.bin...
-- verify OK (digest matched)
Verifying 0x46e00 (290304) bytes @ 0x00714000 in flash against Downloads/Animation Convert 2/Idle Animation/Heart Eyes.bin...
-- verify OK (digest matched)
Verifying 0x36000 (221184) bytes @ 0x0075b000 in flash against Downloads/Animation Convert 2/Idle Animation/Looking Around 2.bin...
-- verify OK (digest matched)
Verifying 0x46800 (288768) bytes @ 0x00791000 in flash against Downloads/Animation Convert 2/Idle Animation/Looking Around Happy.bin...
-- verify OK (digest matched)
Verifying 0x2d600 (185856) bytes @ 0x007d8000 in flash against Downloads/Animation Convert 2/Idle Animation/Looking Around Rizz 2.bin...
-- verify OK (digest matched)
Verifying 0xf600 (62976) bytes @ 0x00806000 in flash against Downloads/Animation Convert 2/Idle Animation/Looking Left.bin...
-- verify OK (digest matched)
Verifying 0x13200 (78336) bytes @ 0x00816000 in flash against Downloads/Animation Convert 2/Idle Animation/Looking Right.bin...
-- verify OK (digest matched)
Verifying 0x117000 (1142784) bytes @ 0x0082a000 in flash against Downloads/Animation Convert 2/Idle Grayscale/Raining.bin...
-- verify OK (digest matched)
Verifying 0x184800 (1591296) bytes @ 0x00941000 in flash against Downloads/Animation Convert 2/Idle Grayscale/Reading Book.bin...
-- verify OK (digest matched)
Verifying 0x6cc00 (445440) bytes @ 0x00ac6000 in flash against Downloads/Animation Convert 2/Trigger Animation/Sadness.bin...
-- verify OK (digest matched)
Verifying 0x3d800 (251904) bytes @ 0x00b33000 in flash against Downloads/Animation Convert 2/Idle Animation/Scared.bin...
-- verify OK (digest matched)
Verifying 0xa6800 (681984) bytes @ 0x00b71000 in flash against Downloads/Animation Convert 2/Idle Grayscale/Sil80.bin...
-- verify OK (digest matched)
Verifying 0xcf000 (847872) bytes @ 0x00c18000 in flash against Downloads/Animation Convert 2/Idle Grayscale/Wanted Supra.bin...
-- verify OK (digest matched)
Verifying 0x3ba00 (244224) bytes @ 0x00ce7000 in flash against Downloads/Animation Convert 2/Idle Animation/Suspicious.bin...
-- verify OK (digest matched)
Verifying 0x55200 (348672) bytes @ 0x00d23000 in flash against Downloads/Animation Convert 2/Trigger Animation/Suspicious 2.bin...
-- verify OK (digest matched)
Verifying 0x171000 (1511424) bytes @ 0x00d79000 in flash against Downloads/Animation Convert 2/Idle Grayscale/Underground Garage.bin...
-- verify OK (digest matched)
Verifying 0x46800 (288768) bytes @ 0x01087000 in flash against Downloads/Animation Convert 2/Idle Animation/Vampire.bin...
-- verify OK (digest matched)
Verifying 0x19c800 (1689600) bytes @ 0x01224000 in flash against Downloads/Animation Convert 2/Trigger Grayscale/Slot Machine Casino 2.bin...
-- verify OK (digest matched)
Verifying 0x19c800 (1689600) bytes @ 0x013c1000 in flash against Downloads/Animation Convert 2/Trigger Grayscale/Slot Machine Casino 3.bin...
-- verify OK (digest matched)
Thank you very much

Who is online

Users browsing this forum: No registered users and 43 guests