-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/{esp8266,esp32}: cleanup of SPI Flash configuration #18387
cpu/{esp8266,esp32}: cleanup of SPI Flash configuration #18387
Conversation
If Quad SPI modes qout or qio are set by variable FLASH_MODE, esptool.py has to be called with parameter `--flash_mode dio` so that the first stage bootloader is always using Dual SPI mode.
The former FLASH_MODE_{DOUT,DIO,QOUT,QIO} defines are replaced by the corresponding CONFIG_FLASHMODE_{DOUT,DIO,QOUT,QIO} and CONFIG_ESPTOOLPY_FLASHMODE_{DOUT,DIO,QOUT,QIO} as used by the ESP-IDF. This is also needed for the migration of defining flash mode in Kconfig.
@benpicco I found some inconsistencies in using |
Requeued in Murdock queue to give 2022.07 release backport #18354 precedence. |
d3ec4bc
to
a4869c1
Compare
The former FLASH_MODE_{DOUT,DIO,QOUT,QIO} defines are replaced by the corresponding CONFIG_FLASHMODE_{DOUT,DIO,QOUT,QIO} and CONFIG_ESPTOOLPY_FLASHMODE_{DOUT,DIO,QOUT,QIO} as used by the ESP-IDF. This is also needed for the migration of defining flash mode in Kconfig.
This commit includes the following changes: - the default flash mode in bootloader should be dio and not dout - the default flash configuration for ESP32 has to be exported to be also visible in cpu/esp32/bootloader/Makefile - the comments in cpu/esp8266/Makefile.include have to be removed so that the flash configuration do not contain trailing white spaces
CONFIG_ESPTOOL_FLASH_FREQ_* defines are used in ESP-IDF to select the right SPI clock speed for flash.
a4869c1
to
da39354
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
esp8266 also still works
@benpicco Thanks for reviewing and merging. |
Contribution description
This PR fixes some inconsistencies in the definition of the correct SPI flash parameters from the
FLASH_*
variables. In detail it contains the following changes:esptool.py
is has to be called with--flash_mode dio
when any Quad SPI modeqout
orqio
is used to let the first stage bootloader always start in Dual SPI mode. That is,dio
has to be set asFLASH_MODE
variable inmakefile/tools/esptool.py
if theFLASH_MODE
variable is set toqio
ordio
.FLASH_MODE_*
defines are replaced byCONFIG_FLASHMODE_*
andCONFIG_ESPTOOLPY_FLASHMODE_*
defines to be compatible with ESP-IDF. Furthermore, this will also needed for the migration of defining the flash mode in Kconfig. Defining themCFLAGS
in the makefile make them visible in whole make system.dio
instead ofdout
.FLASH_*
variables has to be exported for ESP32 to be also visible incpu/esp32/bootloader/Makefile
.FLASH_*
incpu/esp8266/Makefile.include
have to be removed so that theFLASH_*
variables do not contain trailing white spaces.Testing procedure
Use a
esp32-wroom-32
and compile and flash with following command.The output should be something like the following:
That is, DOUT is used for the first stage bootloader and the second stage bootloader as well.
Use a
esp32-wroom-32
and compile and flash with following command.The output should be something like the following:
That is, DIO is used for the first stage bootloader and QIO for the second stage bootloader.
Issues/PRs references