Skip to content

Commit

Permalink
bugfix: esp32: allows QIO and QOUT flash modes
Browse files Browse the repository at this point in the history
Changes to allow QIO and QOUT flash mode to work in:
- esp32s2
- esp32s3
- esp32c3
- esp32c6

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
  • Loading branch information
wmrsouza committed Oct 10, 2024
1 parent ef9d884 commit a3ed4dc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions zephyr/esp32c3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ if(CONFIG_SOC_SERIES_ESP32C3)
zephyr_compile_definitions_ifndef(CONFIG_MCUBOOT CONFIG_APP_BUILD_USE_FLASH_SECTIONS)
zephyr_compile_definitions_ifdef(CONFIG_MCUBOOT BOOTLOADER_BUILD)

if(CONFIG_ESP_SIMPLE_BOOT)
zephyr_compile_definitions_ifdef(CONFIG_ESPTOOLPY_FLASHMODE_QIO BOOTLOADER_BUILD)
zephyr_compile_definitions_ifdef(CONFIG_ESPTOOLPY_FLASHMODE_QOUT BOOTLOADER_BUILD)
endif()

zephyr_compile_definitions_ifndef(asm asm=__asm__)

if(CONFIG_MCUBOOT)
Expand Down
5 changes: 5 additions & 0 deletions zephyr/esp32c6/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ if(CONFIG_SOC_SERIES_ESP32C6)
zephyr_compile_definitions_ifndef(CONFIG_MCUBOOT CONFIG_APP_BUILD_USE_FLASH_SECTIONS)
zephyr_compile_definitions_ifndef(asm asm=__asm__)

if(CONFIG_ESP_SIMPLE_BOOT)
zephyr_compile_definitions_ifdef(CONFIG_ESPTOOLPY_FLASHMODE_QIO BOOTLOADER_BUILD)
zephyr_compile_definitions_ifdef(CONFIG_ESPTOOLPY_FLASHMODE_QOUT BOOTLOADER_BUILD)
endif()

if(CONFIG_MCUBOOT)
zephyr_compile_options(-fdump-rtl-expand)
endif()
Expand Down
6 changes: 6 additions & 0 deletions zephyr/esp32s2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ if(CONFIG_SOC_SERIES_ESP32S2)
zephyr_compile_definitions_ifndef(CONFIG_MCUBOOT CONFIG_APP_BUILD_USE_FLASH_SECTIONS)
zephyr_compile_definitions_ifdef(CONFIG_MCUBOOT BOOTLOADER_BUILD)

if(CONFIG_ESP_SIMPLE_BOOT)
zephyr_compile_definitions_ifdef(CONFIG_ESPTOOLPY_FLASHMODE_QIO BOOTLOADER_BUILD)
zephyr_compile_definitions_ifdef(CONFIG_ESPTOOLPY_FLASHMODE_QOUT BOOTLOADER_BUILD)
endif()

if(CONFIG_MCUBOOT)
zephyr_compile_options(-fdump-rtl-expand)
endif()
Expand Down Expand Up @@ -139,6 +144,7 @@ if(CONFIG_SOC_SERIES_ESP32S2)
../../components/spi_flash/spi_flash_chip_mxic_opi.c
../../components/spi_flash/spi_flash_chip_th.c
../../components/spi_flash/spi_flash_chip_winbond.c
../../components/spi_flash/spi_flash_wrap.c
)
endif()

Expand Down
7 changes: 6 additions & 1 deletion zephyr/esp32s3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ if(CONFIG_SOC_SERIES_ESP32S3)
zephyr_compile_definitions_ifndef(CONFIG_MCUBOOT CONFIG_APP_BUILD_USE_FLASH_SECTIONS)
zephyr_compile_definitions_ifdef(CONFIG_MCUBOOT BOOTLOADER_BUILD)

if(CONFIG_ESP_SIMPLE_BOOT)
zephyr_compile_definitions_ifdef(CONFIG_ESPTOOLPY_FLASHMODE_QIO BOOTLOADER_BUILD)
zephyr_compile_definitions_ifdef(CONFIG_ESPTOOLPY_FLASHMODE_QOUT BOOTLOADER_BUILD)
endif()

if(CONFIG_MCUBOOT)
zephyr_compile_options(-fdump-rtl-expand)
endif()
Expand Down Expand Up @@ -145,7 +150,7 @@ if(CONFIG_SOC_SERIES_ESP32S3)
../../components/spi_flash/spi_flash_hpm_enable.c
../../components/spi_flash/spi_flash_os_func_noos.c
../../components/spi_flash/spi_flash_os_func_app.c
# todo: ../../components/spi_flash/spi_flash_wrap.c
../../components/spi_flash/spi_flash_wrap.c
)
endif()

Expand Down

0 comments on commit a3ed4dc

Please sign in to comment.