Skip to content
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

Cannot build bootloader on IDFv5.1 for ESP32S3 + 32MB OSPI flash due to bootloader API missing (IDFGH-11748) #12850

Closed
3 tasks done
huming2207 opened this issue Dec 21, 2023 · 4 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@huming2207
Copy link
Contributor

huming2207 commented Dec 21, 2023

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.1.2-472-gb38ee33b6d

Operating System used.

macOS

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

What is the expected behavior?

Build successfully

What is the actual behavior?

Got build error like this, as long as the Kconfig's CONFIG_ESPTOOLPY_OCT_FLASH=y and CONFIG_SPI_FLASH_32BIT_ADDRESS=y (i.e. build any firmware for ESP32-S3-WROOM-2-N32R8V modules with octal SPI enabled):

/Users/hu/esp/esp-idf/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c: In function 'bootloader_init_spi_flash':
/Users/hu/esp/esp-idf/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c:276:48: error: implicit declaration of function 'bootloader_flash_get_spi_mode'; did you mean 'bootloader_flash_set_dummy_out'? [-Werror=implicit-function-declaration]
  276 |     bootloader_flash_32bits_address_map_enable(bootloader_flash_get_spi_mode());
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                bootloader_flash_set_dummy_out
cc1: some warnings being treated as errors

Steps to reproduce.

  1. Clone the latest ESP-IDF v5.1 by git clone https://github.com/espressif/esp-idf --recursive -b release/v5.1
  2. Run install.sh
  3. Run export.sh
  4. Grab a hello_world project from the examples
  5. Run idf.py set-target esp32s3
  6. Run idf.py menuconfig, enable CONFIG_ESPTOOLPY_OCT_FLASH=y and CONFIG_SPI_FLASH_32BIT_ADDRESS=y by going to "Serial flasher config" and tick "Enable Octal Flash", and select "Flash size" to 32MB:
image
  1. Then compile by idf.py build, you will see the error.

Build or installation Logs.

hu@hu-mac  ~/Projects/hello_world  idf.py build
Executing action: all (aliases: build)
Running ninja in directory /Users/hu/Projects/hello_world/build
Executing "ninja all"...
[0/1] Re-running CMake...-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s3
-- Project sdkconfig file /Users/hu/Projects/hello_world/sdkconfig
Compiler supported targets: xtensa-esp32s3-elf

-- App "hello_world" version: 1
-- Adding linker script /Users/hu/Projects/hello_world/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /Users/hu/esp/esp-idf/components/esp_system/ld/esp32s3/sections.ld.in
-- Adding linker script /Users/hu/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.ld
-- Adding linker script /Users/hu/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld
-- Adding linker script /Users/hu/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld
-- Adding linker script /Users/hu/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld
-- Adding linker script /Users/hu/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.version.ld
-- Adding linker script /Users/hu/esp/esp-idf/components/soc/esp32s3/ld/esp32s3.peripherals.ld
-- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport touch_element ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: /Users/hu/esp/esp-idf/components/app_trace /Users/hu/esp/esp-idf/components/app_update /Users/hu/esp/esp-idf/components/bootloader /Users/hu/esp/esp-idf/components/bootloader_support /Users/hu/esp/esp-idf/components/bt /Users/hu/esp/esp-idf/components/cmock /Users/hu/esp/esp-idf/components/console /Users/hu/esp/esp-idf/components/cxx /Users/hu/esp/esp-idf/components/driver /Users/hu/esp/esp-idf/components/efuse /Users/hu/esp/esp-idf/components/esp-tls /Users/hu/esp/esp-idf/components/esp_adc /Users/hu/esp/esp-idf/components/esp_app_format /Users/hu/esp/esp-idf/components/esp_coex /Users/hu/esp/esp-idf/components/esp_common /Users/hu/esp/esp-idf/components/esp_eth /Users/hu/esp/esp-idf/components/esp_event /Users/hu/esp/esp-idf/components/esp_gdbstub /Users/hu/esp/esp-idf/components/esp_hid /Users/hu/esp/esp-idf/components/esp_http_client /Users/hu/esp/esp-idf/components/esp_http_server /Users/hu/esp/esp-idf/components/esp_https_ota /Users/hu/esp/esp-idf/components/esp_https_server /Users/hu/esp/esp-idf/components/esp_hw_support /Users/hu/esp/esp-idf/components/esp_lcd /Users/hu/esp/esp-idf/components/esp_local_ctrl /Users/hu/esp/esp-idf/components/esp_mm /Users/hu/esp/esp-idf/components/esp_netif /Users/hu/esp/esp-idf/components/esp_netif_stack /Users/hu/esp/esp-idf/components/esp_partition /Users/hu/esp/esp-idf/components/esp_phy /Users/hu/esp/esp-idf/components/esp_pm /Users/hu/esp/esp-idf/components/esp_psram /Users/hu/esp/esp-idf/components/esp_ringbuf /Users/hu/esp/esp-idf/components/esp_rom /Users/hu/esp/esp-idf/components/esp_system /Users/hu/esp/esp-idf/components/esp_timer /Users/hu/esp/esp-idf/components/esp_wifi /Users/hu/esp/esp-idf/components/espcoredump /Users/hu/esp/esp-idf/components/esptool_py /Users/hu/esp/esp-idf/components/fatfs /Users/hu/esp/esp-idf/components/freertos /Users/hu/esp/esp-idf/components/hal /Users/hu/esp/esp-idf/components/heap /Users/hu/esp/esp-idf/components/http_parser /Users/hu/esp/esp-idf/components/idf_test /Users/hu/esp/esp-idf/components/ieee802154 /Users/hu/esp/esp-idf/components/json /Users/hu/esp/esp-idf/components/log /Users/hu/esp/esp-idf/components/lwip /Users/hu/Projects/hello_world/main /Users/hu/esp/esp-idf/components/mbedtls /Users/hu/esp/esp-idf/components/mqtt /Users/hu/esp/esp-idf/components/newlib /Users/hu/esp/esp-idf/components/nvs_flash /Users/hu/esp/esp-idf/components/openthread /Users/hu/esp/esp-idf/components/partition_table /Users/hu/esp/esp-idf/components/perfmon /Users/hu/esp/esp-idf/components/protobuf-c /Users/hu/esp/esp-idf/components/protocomm /Users/hu/esp/esp-idf/components/pthread /Users/hu/esp/esp-idf/components/sdmmc /Users/hu/esp/esp-idf/components/soc /Users/hu/esp/esp-idf/components/spi_flash /Users/hu/esp/esp-idf/components/spiffs /Users/hu/esp/esp-idf/components/tcp_transport /Users/hu/esp/esp-idf/components/touch_element /Users/hu/esp/esp-idf/components/ulp /Users/hu/esp/esp-idf/components/unity /Users/hu/esp/esp-idf/components/usb /Users/hu/esp/esp-idf/components/vfs /Users/hu/esp/esp-idf/components/wear_levelling /Users/hu/esp/esp-idf/components/wifi_provisioning /Users/hu/esp/esp-idf/components/wpa_supplicant /Users/hu/esp/esp-idf/components/xtensa
-- Configuring done (1.8s)
-- Generating done (0.2s)
-- Build files have been written to: /Users/hu/Projects/hello_world/build
[9/945] Generating ../../partition_table/partition-table.binPartition table binary generated. Contents:
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,24K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,1M,
*******************************************************************************
[149/945] Building C object esp-idf/bootloader_support/CMakeFil....dir/bootloader_flash/src/bootloader_flash_config_esp32s3.c.objFAILED: esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/bootloader_flash_config_esp32s3.c.obj
/Users/hu/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc -DESP_PLATFORM -DIDF_VER=\"v5.1.2-472-gb38ee33b6d\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/Users/hu/Projects/hello_world/build/config -I/Users/hu/esp/esp-idf/components/bootloader_support/include -I/Users/hu/esp/esp-idf/components/bootloader_support/bootloader_flash/include -I/Users/hu/esp/esp-idf/components/bootloader_support/private_include -I/Users/hu/esp/esp-idf/components/newlib/platform_include -I/Users/hu/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/Users/hu/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/Users/hu/esp/esp-idf/components/freertos/esp_additions/include/freertos -I/Users/hu/esp/esp-idf/components/freertos/esp_additions/include -I/Users/hu/esp/esp-idf/components/freertos/esp_additions/arch/xtensa/include -I/Users/hu/esp/esp-idf/components/esp_hw_support/include -I/Users/hu/esp/esp-idf/components/esp_hw_support/include/soc -I/Users/hu/esp/esp-idf/components/esp_hw_support/include/soc/esp32s3 -I/Users/hu/esp/esp-idf/components/esp_hw_support/port/esp32s3/. -I/Users/hu/esp/esp-idf/components/esp_hw_support/port/esp32s3/private_include -I/Users/hu/esp/esp-idf/components/heap/include -I/Users/hu/esp/esp-idf/components/log/include -I/Users/hu/esp/esp-idf/components/soc/include -I/Users/hu/esp/esp-idf/components/soc/esp32s3 -I/Users/hu/esp/esp-idf/components/soc/esp32s3/include -I/Users/hu/esp/esp-idf/components/hal/esp32s3/include -I/Users/hu/esp/esp-idf/components/hal/include -I/Users/hu/esp/esp-idf/components/hal/platform_port/include -I/Users/hu/esp/esp-idf/components/esp_rom/include -I/Users/hu/esp/esp-idf/components/esp_rom/include/esp32s3 -I/Users/hu/esp/esp-idf/components/esp_rom/esp32s3 -I/Users/hu/esp/esp-idf/components/esp_common/include -I/Users/hu/esp/esp-idf/components/esp_system/include -I/Users/hu/esp/esp-idf/components/esp_system/port/soc -I/Users/hu/esp/esp-idf/components/esp_system/port/include/private -I/Users/hu/esp/esp-idf/components/xtensa/include -I/Users/hu/esp/esp-idf/components/xtensa/esp32s3/include -I/Users/hu/esp/esp-idf/components/lwip/include -I/Users/hu/esp/esp-idf/components/lwip/include/apps -I/Users/hu/esp/esp-idf/components/lwip/include/apps/sntp -I/Users/hu/esp/esp-idf/components/lwip/lwip/src/include -I/Users/hu/esp/esp-idf/components/lwip/port/include -I/Users/hu/esp/esp-idf/components/lwip/port/freertos/include -I/Users/hu/esp/esp-idf/components/lwip/port/esp32xx/include -I/Users/hu/esp/esp-idf/components/lwip/port/esp32xx/include/arch -I/Users/hu/esp/esp-idf/components/spi_flash/include -I/Users/hu/esp/esp-idf/components/mbedtls/port/include -I/Users/hu/esp/esp-idf/components/mbedtls/mbedtls/include -I/Users/hu/esp/esp-idf/components/mbedtls/mbedtls/library -I/Users/hu/esp/esp-idf/components/mbedtls/esp_crt_bundle/include -I/Users/hu/esp/esp-idf/components/mbedtls/mbedtls/3rdparty/everest/include -I/Users/hu/esp/esp-idf/components/mbedtls/mbedtls/3rdparty/p256-m -I/Users/hu/esp/esp-idf/components/mbedtls/mbedtls/3rdparty/p256-m/p256-m -I/Users/hu/esp/esp-idf/components/efuse/include -I/Users/hu/esp/esp-idf/components/efuse/esp32s3/include -I/Users/hu/esp/esp-idf/components/esp_app_format/include -mlongcalls  -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -Og -fmacro-prefix-map=/Users/hu/Projects/hello_world=. -fmacro-prefix-map=/Users/hu/esp/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -std=gnu17 -Wno-old-style-declaration -MD -MT esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/bootloader_flash_config_esp32s3.c.obj -MF esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/bootloader_flash_config_esp32s3.c.obj.d -o esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/bootloader_flash_config_esp32s3.c.obj -c /Users/hu/esp/esp-idf/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c
/Users/hu/esp/esp-idf/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c: In function 'bootloader_init_spi_flash':
/Users/hu/esp/esp-idf/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c:276:48: error: implicit declaration of function 'bootloader_flash_get_spi_mode'; did you mean 'bootloader_flash_set_dummy_out'? [-Werror=implicit-function-declaration]
  276 |     bootloader_flash_32bits_address_map_enable(bootloader_flash_get_spi_mode());
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                bootloader_flash_set_dummy_out
cc1: some warnings being treated as errors
[158/945] Building C object esp-idf/app_update/CMakeFiles/__idf_app_update.dir/esp_ota_ops.c.objninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /Users/hu/Projects/hello_world/build/log/idf_py_stderr_output_17111 and /Users/hu/Projects/hello_world/build/log/idf_py_stdout_output_17111

More Information.

This was working fine in previous IDF 5.1 codebase (at least definitely working fine in less than 20 days ago). Somehow it's broken due to some latest changes on ESP-IDF 5.1 branch.

@huming2207 huming2207 added the Type: Bug bugs in IDF label Dec 21, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 21, 2023
@github-actions github-actions bot changed the title Cannot build bootloader on IDFv5.1 for ESP32S3 + 32MB OSPI flash due to bootloader API missing Cannot build bootloader on IDFv5.1 for ESP32S3 + 32MB OSPI flash due to bootloader API missing (IDFGH-11748) Dec 21, 2023
@huming2207
Copy link
Contributor Author

huming2207 commented Dec 21, 2023

I can confirm this issue doesn't exist on IDF 5.1.2 release, i.e. 482a8fb

At least the hello_world project builds normally.

@huming2207
Copy link
Contributor Author

huming2207 commented Dec 21, 2023

I had a quick look and I think this issue is a regression from this commit: bb7544e

Related to this issue: #11903

cc @igrr @mythbuster5 @ginkgm

@mythbuster5
Copy link
Collaborator

Thanks for the reporting, fixing..

mikee47 pushed a commit to mikee47/esp-idf that referenced this issue Jan 11, 2024
…/v4.4

* origin/release/v4.4: (765 commits)
  ci: add sbom validation using pre-commit's post-commit stage
  change(uart): improved the internal logic of uart_read_bytes
  fix(bt/bluedroid): Fix ble app unregister no event
  fix(bt/bluedroid): Disabled Sniff Subrating temporarily as it did not work well
  fix(bt/bluedroid): Changed the default air mode to invalid value
  fix(bt/bluedroid): Removed redundant operation of SCO clean up
  fix(bt/bluedroid): Corrected the definitions of HF Client callback events
  fix(bt/bluedroid): Avoided crash of LoadProhibited during HFP AG deinitialization
  fix(bt/bluedroid): Added dynamic memory allocation for HFP control blocks
  bugfix(spi_flash): Fix build error when octal flash is enabled, Closes espressif#12850
  fix(bt/controller): Fixed establish two sco connections failed
  ci: Fix environment variable IDF_CI_BUILD is not set
  fix(spi): correct some signals and dummy bits docs
  fix(spi): Correct REG_SPI_BASE(i) macro for all targets
  fix(phy): Fix ble tx ifs time for ESP32
  fix(bt/bluedroid): fixed btc_config_lock error
  fix(ble/controller): Fixed BLE recorrect enable bug and fixed BLE bb isr enable by default
  fix(freertos): Fixed a failing scheduler suspension unit test
  fix: do sbom manifest validation in post-commit
  fix(bt/bluedroid): Fix prepare write for BLE example
  ...
@Alvin1Zhang
Copy link
Collaborator

Thanks for reporting and sharing the updates, the fix is available, feel free to reopen.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new labels Mar 7, 2024
hathach pushed a commit to adafruit/esp-idf that referenced this issue Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants