ESP32-S3 with 64MB external flash

digitalLumberjack
Posts: 4
Joined: Mon Jul 08, 2024 3:01 pm

ESP32-S3 with 64MB external flash

Postby digitalLumberjack » Mon Jul 08, 2024 4:12 pm

Hello, I made a PCB with ESP32-S3 and a 512Mb external SPI flash (F35SQA512M-WWT - 512Mb - up to 133Mhz)

I already did several other esp design with external flash but it seems I missed something on this one:
- I have GPIO 45 pulled down so the VDDSPI = 3.3V
- the SPI flash is connected to the ESP32-S3 like this:
Screenshot from 2024-07-08 17-04-28.png
Screenshot from 2024-07-08 17-04-28.png (406.5 KiB) Viewed 2204 times
- when i try to upload the stub in order to flash the bootloader, I have this (same error with any flash mode or freq)

Code: Select all

esptool.py --chip esp32s3 -p /dev/ttyACM0 --before=default_reset --after=hard_reset write_flash --flash_mode qio --flash_freq 80m --flash_size 64MB 0x0 bootloader/bootloader.bin

esptool.py v4.7.0
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 30:30:f9:2f:2e:08
Uploading stub...
Running stub...
Stub running...

A fatal error occurred: Unable to verify flash chip connection (No serial data received.).
- when i try to read flash status I have that :

Code: Select all

esptool.py --no-stub -p /dev/ttyACM0 read_flash_status --bytes 3

esptool.py v4.7.0
Serial port /dev/ttyACM0
Connecting...
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 30:30:f9:2f:2e:08
Enabling default SPI flash mode...
Status value: 0x3f3f3f
Hard resetting via RTS pin...
- and of course i cannot change any status bit:

Code: Select all

esptool.py --no-stub -p /dev/ttyACM0 write_flash_status --bytes 3 0x3e3f3f
esptool.py v4.7.0
Serial port /dev/ttyACM0
Connecting...
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 30:30:f9:2f:2e:08
Enabling default SPI flash mode...
Initial flash status: 0x3f3f3f
Setting flash status: 0x3e3f3f
After flash status:   0x3f3f3f
Hard resetting via RTS pin...
0x3f3f3f seems a little bit redondant... I'm ready for an answer like "the flash is not compatible" but I really wonder why it would not be ?

Thank you for your time :)

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

Re: ESP32-S3 with 64MB external flash

Postby ESP_Sprite » Tue Jul 09, 2024 12:49 am

It's NAND flash; the S3 cannot boot from that. You want NOR flash; chips like that tend to start with '25' rather than '35'.

digitalLumberjack
Posts: 4
Joined: Mon Jul 08, 2024 3:01 pm

Re: ESP32-S3 with 64MB external flash

Postby digitalLumberjack » Tue Jul 09, 2024 6:55 am

Thanks for the information.

Is GD25B512MEYIGR fully supported ?

Is there a source code I can refer about fully supported chips ?

digitalLumberjack
Posts: 4
Joined: Mon Jul 08, 2024 3:01 pm

Re: ESP32-S3 with 64MB external flash

Postby digitalLumberjack » Fri Jul 12, 2024 11:27 am

Hello again :)

So I changed the chip with a GD25B512MEYIGR that is detected by the esp32s3:

Code: Select all

esptool.py --port /dev/ttyACM0 flash_id 

esptool.py v4.8.dev4
Serial port /dev/ttyACM0
Connecting...
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 30:30:f9:2f:2e:08
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 471a
Detected flash size: 64MB
Flash type set in eFuse: quad (4 data lines)
Flash voltage set by a strapping pin to 3.3V
Hard resetting via RTS pin...
I can flash the chip, with simple projects like hello world.

Then on boot, it seems like the first stage bootloader cannot read flash.

Code: Select all

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2810,len:0x1790
ets_loader.c 78 
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x400454d5
0x400454d5: ets_loader_map_range in ROM
I tested on multiple IDF versions, multiple projects (including the simple hello world example).

I must be missing something. Is there a fuse to burn for a 64MB 4 datalines SPI DIO or QIO flash ?
Could I have missed another specificity on the GD25B512MEYIGR ?
Screenshot from 2024-07-12 13-26-29.png
Screenshot from 2024-07-12 13-26-29.png (523.16 KiB) Viewed 1930 times
Thank you very much for your time.

digitalLumberjack
Posts: 4
Joined: Mon Jul 08, 2024 3:01 pm

Re: ESP32-S3 with 64MB external flash

Postby digitalLumberjack » Sat Jul 13, 2024 10:24 am

So I can now write and read data on the GD25B512MEYIGR chip with the idf.py flash commands, and esptool read_flash and write_flash.

Code: Select all

esptool.py --port /dev/ttyACM0 read_flash --flash_size 64MB 0x0 0x10000 test
esptool.py v4.8.dev4
Serial port /dev/ttyACM0
Connecting....
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 30:30:f9:2f:2e:08
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
65536 (100 %)
65536 (100 %)
Read 65536 bytes at 0x00000000 in 5.8 seconds (91.1 kbit/s)...
Hard resetting via RTS pin...
I just can't execute code on it:

Code: Select all

SPIWP:0xee
mode:DIO, clock div:4
load:0x3fce2820,len:0x2894
ets_loader.c 78 
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x400454d5
0x400454d5: ets_loader_map_range in ROM
I set the BOOTLOADER_FLASH_NEEDS_32BIT_ADDR_QUAD_FLASH.

Here are my questions :
- Can I have more logs from rom bootloader ?

- Is it possible for me to add the support of the chip in drivers ?
I saw that with CONFIG_SPI_FLASH_ROM_IMPL=n and CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y it's possible to patch the rom bootloader flash implementation ?
Not sure how it works, and where I should look first. Should I patch the https://github.com/espressif/esp-idf/bl ... _chip_gd.c ?

- Do you think it's possible to make it run, or is it just impossible to get it to work with the GD25B512MEYIGR specifications.

Who is online

Users browsing this forum: No registered users and 100 guests