How to boot on HSPI

espary
Posts: 2
Joined: Fri Feb 14, 2025 8:51 am

How to boot on HSPI

Postby espary » Fri Feb 14, 2025 10:13 am

Hi all,

I developped a custom board based on NINA-W102 which embeds an ESP32-D0WQ6-V3. This board is connected through HSPI to an external Flash chip 16MB W25Q128 from Winbond.
When I flash a test code to the 2MB internal Flash, W25Q128 is well recognized with ID: EF 40 18, but SPI frequency needs to be reduced to 20MHz instead of 40MHz or 80 MHz (otherwise flash chip ID is wrong).

The final firmware will exceed the 2MB internal flash so I would like to use W25Q128 as main flash memory for firmware. I currently succeeded in flashing the board through HSPI but I can't find the way to boot from this external flash.

For flash, here is the command:

Code: Select all

python -m esptool  --no-stub --chip esp32 -b 460800 --before default_reset --after hard_reset write_flash -sc HSPI --flash_mode dout --flash_size detect --flash_freq 20m 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/hello_world.bin
The result of flash:
result_flash.png
result_flash.png (45.26 KiB) Viewed 567 times
As shown by the result, Auto-detected Flash Size: 16MB indicates that the flash is done in W25Q128.
However when I monitor the output, the board is booting from internal flash (boot:0x33 (SPI_FAST_FLASH_BOOT)) and resetting all the time since there is no firmware inside.
The result of monitor:
result_monitor.png
result_monitor.png (25.94 KiB) Viewed 567 times
Ideally if the boot is through HSPI, I should see boot:0xb (HSPI_FLASH_BOOT) at the beginning. Does anyone know how can I achieve that ?

espary
Posts: 2
Joined: Fri Feb 14, 2025 8:51 am

Re: How to boot on HSPI

Postby espary » Fri Feb 14, 2025 4:45 pm

In addition, I already saw this topic here: viewtopic.php?t=38350
So to be more precise, is there a way to boot on HSPI without using efuse which would modify permanently the board ?

Who is online

Users browsing this forum: No registered users and 125 guests