espressif / esp-at

AT application for ESP32/ESP32-C2/ESP32-C3/ESP32-C6/ESP8266
Apache License 2.0
883 stars 794 forks source link

Unable to build esp-at for Classic Bluetooth with Serial Port Protocol (SPP) #878

Open chrisj7903 opened 3 days ago

chrisj7903 commented 3 days ago

Answers checklist

ESP-AT version

v3.4.0.0-46-g7b9487c2

Operating System used

Windows

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

CMD

What is the expected behavior?

By following the instructions at Compile ESP-AT Project Locally and How to Enable ESP-AT Classic Bluetooth I expect to successfully build esp-at firmware, with Classic Bluetooth enabled with SPP.

What is the actual behavior?

The build fails if both "AT bt command support" and "AT bt SPP command support" are enabled using the menuconfig utility as describned in the instructions. However, if I build without SPP selected and only "AT bt command support" selected, the build & flashing succeed and the hardware responds corectly to basic Classic Bluetooth commands.

Steps to reproduce

Following the instructions at Compile ESP-AT Project Locally

cd %userprofile%\esp git clone --recursive https://github.com/espressif/esp-at.git cd esp-at python build.py install choose 1. Platform_ESP32 choose 1. WROOM-32 choose 1: Yes (silence mode enabled, to reduce firmware size) python build.py menuconfig Component config AT -> AT bt command support (selected) -> AT bt SPP command support (selected) Quit with Save = Yes python build.py build

the build fails with a fatal error as shown in logs following and attached iun ZIP file build_logs.zip

Build or installation Logs

Platform name:ESP32     Module name:WROOM-32    Silence:1
submodules check completed for updates.
esp_tls_parse_ecc_key.patch does not need to be applied.
fatfs_generation.patch does not need to be applied.
support_ext_partition.patch does not need to be applied.
modify_bluedroid_conn_timeout.patch does not need to be applied.
C:\Users\CJ\esp\esp-at\module_config\module_esp32_default\patch\libbtdm_app.a does not need to be applied.
patches check completed for updates.
Ready to set up environment variables..
PATH is C:\Espressif\tools\xtensa-esp-elf-gdb\14.2_20240403\xtensa-esp-elf-gdb\bin;C:\Espressif\tools\riscv32-esp-elf-gdb\14.2_20240403\riscv32-esp-elf-gdb\bin;C:\Espressif\tools\xtensa-esp-elf\esp-13.2.0_20230928\xtensa-esp-elf\bin;C:\Espressif\tools\riscv32-esp-elf\esp-13.2.0_20230928\riscv32-esp-elf\bin;C:\Espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;C:\Espressif\tools\cmake\3.24.0\bin;C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20240318\openocd-esp32\bin;C:\Espressif\tools\ninja\1.11.1\;C:\Espressif\tools\idf-exe\1.0.3\;C:\Espressif\tools\ccache\4.8\ccache-4.8-windows-x86_64;C:\Espressif\tools\dfu-util\0.11\dfu-util-0.11-win64;C:\Espressif\frameworks\esp-idf-v5.2.2\tools;C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\;C:\Espressif\tools\idf-git\2.44.0\cmd\;C:\Espressif;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\MATLAB\R2024a\bin;C:\Program Files\MATLAB\R2023b\bin;C:\PROGRA~1\MATLAB\R2020b\bin;C:\Program Files (x86)\IVI Foundation\IVI\bin;C:\Program Files\IVI Foundation\IVI\bin;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Users\CJ\AppData\Local\Microsoft\WindowsApps;C:\Users\CJ\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;
IDF_PYTHON_ENV_PATH is C:\Espressif\python_env\idf5.2_py3.11_env
sys.platform is win32
Not using an unsupported version of tool xtensa-esp-elf-gdb found in PATH: 14.2_20240403. To use it, run 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\CJ\esp\esp-at\esp-idf\tools\idf_tools.py export --prefer-system'Not using an unsupported version of tool riscv32-esp-elf-gdb found in PATH: 14.2_20240403. To use it, run 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\CJ\esp\esp-at\esp-idf\tools\idf_tools.py export --prefer-system'
Not using an unsupported version of tool xtensa-esp32-elf found in PATH: esp-13.2.0_20230928-13.2.0. To use it, run 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\CJ\esp\esp-at\esp-idf\tools\idf_tools.py export --prefer-system'
Not using an unsupported version of tool xtensa-esp32s2-elf found in PATH: esp-13.2.0_20230928-13.2.0. To use it, run 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\CJ\esp\esp-at\esp-idf\tools\idf_tools.py export --prefer-system'
Not using an unsupported version of tool xtensa-esp32s3-elf found in PATH: esp-13.2.0_20230928-13.2.0. To use it, run 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\CJ\esp\esp-at\esp-idf\tools\idf_tools.py export --prefer-system'
Not using an unsupported version of tool riscv32-esp-elf found in PATH: esp-13.2.0_20230928-13.2.0. To use it, run 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\CJ\esp\esp-at\esp-idf\tools\idf_tools.py export --prefer-system'
Not using an unsupported version of tool openocd-esp32 found in PATH: v0.12.0-esp32-20240318. To use it, run 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\CJ\esp\esp-at\esp-idf\tools\idf_tools.py export --prefer-system'
Not using an unsupported version of tool ninja found in PATH: 1.11.1. To use it, run 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\CJ\esp\esp-at\esp-idf\tools\idf_tools.py export --prefer-system'
Not using an unsupported version of tool ccache found in PATH: 4.8. To use it, run 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\CJ\esp\esp-at\esp-idf\tools\idf_tools.py export --prefer-system'
Not using an unsupported version of tool dfu-util found in PATH: 0.11. To use it, run 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Users\CJ\esp\esp-at\esp-idf\tools\idf_tools.py export --prefer-system'
export str is OPENOCD_SCRIPTS=C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\share\openocd\scripts
ESP_ROM_ELF_DIR=C:\Espressif\tools\esp-rom-elfs\20220823\
ESP_IDF_VERSION=5.0
PATH=C:\Espressif\tools\xtensa-esp-elf-gdb\12.1_20231023\xtensa-esp-elf-gdb\bin;C:\Espressif\tools\riscv32-esp-elf-gdb\12.1_20231023\riscv32-esp-elf-gdb\bin;C:\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin;C:\Espressif\tools\xtensa-esp32s2-elf\esp-2022r1-11.2.0\xtensa-esp32s2-elf\bin;C:\Espressif\tools\xtensa-esp32s3-elf\esp-2022r1-11.2.0\xtensa-esp32s3-elf\bin;C:\Espressif\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin;C:\Espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;C:\Espressif\tools\cmake\3.24.0\bin;C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\bin;C:\Espressif\tools\ninja\1.10.2\;C:\Espressif\tools\idf-exe\1.0.3\;C:\Espressif\tools\ccache\4.6.2\ccache-4.6.2-windows-x86_64;C:\Espressif\tools\dfu-util\0.9\dfu-util-0.9-win64;C:\Users\CJ\esp\esp-at\esp-idf\tools;%PATH%
IDF_DEACTIVATE_FILE_PATH=C:\Users\CJ\AppData\Local\Temp\tmpvxh8synmidf_12492

PATH is C:\Espressif\tools\xtensa-esp-elf-gdb\12.1_20231023\xtensa-esp-elf-gdb\bin;C:\Espressif\tools\riscv32-esp-elf-gdb\12.1_20231023\riscv32-esp-elf-gdb\bin;C:\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin;C:\Espressif\tools\xtensa-esp32s2-elf\esp-2022r1-11.2.0\xtensa-esp32s2-elf\bin;C:\Espressif\tools\xtensa-esp32s3-elf\esp-2022r1-11.2.0\xtensa-esp32s3-elf\bin;C:\Espressif\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin;C:\Espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;C:\Espressif\tools\cmake\3.24.0\bin;C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\bin;C:\Espressif\tools\ninja\1.10.2\;C:\Espressif\tools\idf-exe\1.0.3\;C:\Espressif\tools\ccache\4.6.2\ccache-4.6.2-windows-x86_64;C:\Espressif\tools\dfu-util\0.9\dfu-util-0.9-win64;C:\Users\CJ\esp\esp-at\esp-idf\tools;%PATH%;C:\Espressif\tools\xtensa-esp-elf-gdb\14.2_20240403\xtensa-esp-elf-gdb\bin;C:\Espressif\tools\riscv32-esp-elf-gdb\14.2_20240403\riscv32-esp-elf-gdb\bin;C:\Espressif\tools\xtensa-esp-elf\esp-13.2.0_20230928\xtensa-esp-elf\bin;C:\Espressif\tools\riscv32-esp-elf\esp-13.2.0_20230928\riscv32-esp-elf\bin;C:\Espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;C:\Espressif\tools\cmake\3.24.0\bin;C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20240318\openocd-esp32\bin;C:\Espressif\tools\ninja\1.11.1\;C:\Espressif\tools\idf-exe\1.0.3\;C:\Espressif\tools\ccache\4.8\ccache-4.8-windows-x86_64;C:\Espressif\tools\dfu-util\0.11\dfu-util-0.11-win64;C:\Espressif\frameworks\esp-idf-v5.2.2\tools;C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\;C:\Espressif\tools\idf-git\2.44.0\cmd\;C:\Espressif;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\MATLAB\R2024a\bin;C:\Program Files\MATLAB\R2023b\bin;C:\PROGRA~1\MATLAB\R2020b\bin;C:\Program Files (x86)\IVI Foundation\IVI\bin;C:\Program Files\IVI Foundation\IVI\bin;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Users\CJ\AppData\Local\Microsoft\WindowsApps;C:\Users\CJ\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;
IDF_PYTHON_ENV_PATH is C:\Espressif\python_env\idf5.2_py3.11_env
Executing action: all (aliases: build)
Running ninja in directory C:\Users\CJ\esp\esp-at\build
Executing "ninja all"...
[0/1] Re-running CMake...-- silence:1, sdkconfig:C:/Users/CJ/esp/esp-at/module_config/module_esp32_default/sdkconfig_silence.defaults
-- partition_table_dir: C:/Users/CJ/esp/esp-at
esp-at branch: master
esp-at docs version: latest
no extra component dirs
-- Component directory C:/Users/CJ/esp/esp-at/components/fs_image does not contain a CMakeLists.txt file. No component will be added
-- ccache will be used for faster recompilation
-- Building ESP-IDF components for target esp32
NOTICE: Skipping optional dependency: espressif/cmake_utilities
NOTICE: Skipping optional dependency: espressif/bootloader_support_plus
NOTICE: Skipping optional dependency: espressif/cmake_utilities
NOTICE: Skipping optional dependency: espressif/bootloader_support_plus
NOTICE: Skipping optional dependency: espressif/cmake_utilities
NOTICE: Skipping optional dependency: espressif/bootloader_support_plus
Processing 3 dependencies:
[3/3] idf (5.0.6)NOTICE: Skipping optional dependency: espressif/bootloader_support_plus
NOTICE: Skipping optional dependency: espressif/cmake_utilities
-- Project sdkconfig file C:/Users/CJ/esp/esp-at/sdkconfig
Loading defaults file C:/Users/CJ/esp/esp-at/module_config/module_esp32_default/sdkconfig_silence.defaults...
-- App "esp-at" version: v3.4.0.0-46-g7b9487c2
-- Adding linker script C:/Users/CJ/esp/esp-at/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_system/ld/esp32/sections.ld.in
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
silence:1, ld core:C:/Users/CJ/esp/esp-at/components/at/lib/libesp32_at_core_silence.a
-- Set custom partition table: C:/Users/CJ/esp/esp-at/module_config/module_esp32_default/at_customize.csv
Parsing CSV input...
Verifying table...
-- Components: app_trace app_update at bootloader bootloader_support bt cmock console customized_partitions cxx decoder driver efuse esp-tls esp_adc esp_app_format 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_netif esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump espressif__esp_websocket_client espressif__mdns 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 ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: C:/Users/CJ/esp/esp-at/esp-idf/components/app_trace C:/Users/CJ/esp/esp-at/esp-idf/components/app_update C:/Users/CJ/esp/esp-at/components/at C:/Users/CJ/esp/esp-at/esp-idf/components/bootloader C:/Users/CJ/esp/esp-at/esp-idf/components/bootloader_support C:/Users/CJ/esp/esp-at/esp-idf/components/bt C:/Users/CJ/esp/esp-at/esp-idf/components/cmock C:/Users/CJ/esp/esp-at/esp-idf/components/console C:/Users/CJ/esp/esp-at/components/customized_partitions C:/Users/CJ/esp/esp-at/esp-idf/components/cxx C:/Users/CJ/esp/esp-at/components/decoder C:/Users/CJ/esp/esp-at/esp-idf/components/driver C:/Users/CJ/esp/esp-at/esp-idf/components/efuse C:/Users/CJ/esp/esp-at/esp-idf/components/esp-tls C:/Users/CJ/esp/esp-at/esp-idf/components/esp_adc C:/Users/CJ/esp/esp-at/esp-idf/components/esp_app_format C:/Users/CJ/esp/esp-at/esp-idf/components/esp_common C:/Users/CJ/esp/esp-at/esp-idf/components/esp_eth C:/Users/CJ/esp/esp-at/esp-idf/components/esp_event C:/Users/CJ/esp/esp-at/esp-idf/components/esp_gdbstub C:/Users/CJ/esp/esp-at/esp-idf/components/esp_hid C:/Users/CJ/esp/esp-at/esp-idf/components/esp_http_client C:/Users/CJ/esp/esp-at/esp-idf/components/esp_http_server C:/Users/CJ/esp/esp-at/esp-idf/components/esp_https_ota C:/Users/CJ/esp/esp-at/esp-idf/components/esp_https_server C:/Users/CJ/esp/esp-at/esp-idf/components/esp_hw_support C:/Users/CJ/esp/esp-at/esp-idf/components/esp_lcd C:/Users/CJ/esp/esp-at/esp-idf/components/esp_local_ctrl C:/Users/CJ/esp/esp-at/esp-idf/components/esp_netif C:/Users/CJ/esp/esp-at/esp-idf/components/esp_partition C:/Users/CJ/esp/esp-at/esp-idf/components/esp_phy C:/Users/CJ/esp/esp-at/esp-idf/components/esp_pm C:/Users/CJ/esp/esp-at/esp-idf/components/esp_psram C:/Users/CJ/esp/esp-at/esp-idf/components/esp_ringbuf C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom C:/Users/CJ/esp/esp-at/esp-idf/components/esp_system C:/Users/CJ/esp/esp-at/esp-idf/components/esp_timer C:/Users/CJ/esp/esp-at/esp-idf/components/esp_wifi C:/Users/CJ/esp/esp-at/esp-idf/components/espcoredump C:/Users/CJ/esp/esp-at/managed_components/espressif__esp_websocket_client C:/Users/CJ/esp/esp-at/managed_components/espressif__mdns C:/Users/CJ/esp/esp-at/esp-idf/components/esptool_py C:/Users/CJ/esp/esp-at/esp-idf/components/fatfs C:/Users/CJ/esp/esp-at/esp-idf/components/freertos C:/Users/CJ/esp/esp-at/esp-idf/components/hal C:/Users/CJ/esp/esp-at/esp-idf/components/heap C:/Users/CJ/esp/esp-at/esp-idf/components/http_parser C:/Users/CJ/esp/esp-at/esp-idf/components/idf_test C:/Users/CJ/esp/esp-at/esp-idf/components/ieee802154 C:/Users/CJ/esp/esp-at/esp-idf/components/json C:/Users/CJ/esp/esp-at/esp-idf/components/log C:/Users/CJ/esp/esp-at/esp-idf/components/lwip C:/Users/CJ/esp/esp-at/main C:/Users/CJ/esp/esp-at/esp-idf/components/mbedtls C:/Users/CJ/esp/esp-at/esp-idf/components/mqtt C:/Users/CJ/esp/esp-at/esp-idf/components/newlib C:/Users/CJ/esp/esp-at/esp-idf/components/nvs_flash C:/Users/CJ/esp/esp-at/esp-idf/components/openthread C:/Users/CJ/esp/esp-at/esp-idf/components/partition_table C:/Users/CJ/esp/esp-at/esp-idf/components/perfmon C:/Users/CJ/esp/esp-at/esp-idf/components/protobuf-c C:/Users/CJ/esp/esp-at/esp-idf/components/protocomm C:/Users/CJ/esp/esp-at/esp-idf/components/pthread C:/Users/CJ/esp/esp-at/esp-idf/components/sdmmc C:/Users/CJ/esp/esp-at/esp-idf/components/soc C:/Users/CJ/esp/esp-at/esp-idf/components/spi_flash C:/Users/CJ/esp/esp-at/esp-idf/components/spiffs C:/Users/CJ/esp/esp-at/esp-idf/components/tcp_transport C:/Users/CJ/esp/esp-at/esp-idf/components/ulp C:/Users/CJ/esp/esp-at/esp-idf/components/unity C:/Users/CJ/esp/esp-at/esp-idf/components/usb C:/Users/CJ/esp/esp-at/esp-idf/components/vfs C:/Users/CJ/esp/esp-at/esp-idf/components/wear_levelling C:/Users/CJ/esp/esp-at/esp-idf/components/wifi_provisioning C:/Users/CJ/esp/esp-at/esp-idf/components/wpa_supplicant C:/Users/CJ/esp/esp-at/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/CJ/esp/esp-at/build
[29/1201] Running utility command for customized_bin
Creating NVS binary with version: V2 - Multipage Blob Support Enabled

Created NVS binary: ===> C:/Users/CJ/esp/esp-at/build/customized_partitions\mfg_nvs.bin
[47/1201] Generating ../../partition_table/partition-table.binPartition table binary generated. Contents:
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
phy_init,data,phy,0xf000,4K,
otadata,data,ota,0x10000,8K,
nvs,data,nvs,0x12000,56K,
at_customize,64,0,0x20000,896K,
ota_0,app,ota_0,0x100000,1536K,
ota_1,app,ota_1,0x280000,1536K,
*******************************************************************************
[657/1201] Performing configure step for 'bootloader'-- Found Git: C:/Espressif/tools/idf-git/2.44.0/cmd/git.exe (found version "2.44.0.windows.1")
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32
Dependencies lock doesn't exist, solving dependencies.
NOTICE: Skipping optional dependency: espressif/bootloader_support_plus
NOTICE: Updating lock file at C:\Users\CJ\esp\esp-at\esp-idf\components\bootloader\subproject\dependencies.lock
Processing 1 dependencies:
[1/1] idf (5.0.6)NOTICE: Skipping optional dependency: espressif/bootloader_support_plus
-- Project sdkconfig file C:/Users/CJ/esp/esp-at/sdkconfig
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of time_t
-- Check size of time_t - done
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
-- App "bootloader" version: v5.0.6-dirty
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/bootloader/subproject/main/ld/esp32/bootloader.ld
-- Adding linker script C:/Users/CJ/esp/esp-at/esp-idf/components/bootloader/subproject/main/ld/esp32/bootloader.rom.ld
-- Components: bootloader bootloader_support efuse esp_app_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa
-- Component paths: C:/Users/CJ/esp/esp-at/esp-idf/components/bootloader C:/Users/CJ/esp/esp-at/esp-idf/components/bootloader_support C:/Users/CJ/esp/esp-at/esp-idf/components/efuse C:/Users/CJ/esp/esp-at/esp-idf/components/esp_app_format C:/Users/CJ/esp/esp-at/esp-idf/components/esp_common C:/Users/CJ/esp/esp-at/esp-idf/components/esp_hw_support C:/Users/CJ/esp/esp-at/esp-idf/components/esp_rom C:/Users/CJ/esp/esp-at/esp-idf/components/esp_system C:/Users/CJ/esp/esp-at/esp-idf/components/esptool_py C:/Users/CJ/esp/esp-at/esp-idf/components/freertos C:/Users/CJ/esp/esp-at/esp-idf/components/hal C:/Users/CJ/esp/esp-at/esp-idf/components/log C:/Users/CJ/esp/esp-at/bootloader_components/main C:/Users/CJ/esp/esp-at/esp-idf/components/bootloader/subproject/components/micro-ecc C:/Users/CJ/esp/esp-at/esp-idf/components/newlib C:/Users/CJ/esp/esp-at/esp-idf/components/partition_table C:/Users/CJ/esp/esp-at/esp-idf/components/soc C:/Users/CJ/esp/esp-at/esp-idf/components/spi_flash C:/Users/CJ/esp/esp-at/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/CJ/esp/esp-at/build/bootloader
[101/102] Generating binary image from built executableesptool.py v4.7.0
Creating esp32 image...
Merged 1 ELF section
Successfully created esp32 image.
Generated C:/Users/CJ/esp/esp-at/build/bootloader/bootloader.bin
[102/102] cmd.exe /C "cd /D C:\Users\CJ\esp\esp-at\build\b...00 C:/Users/CJ/esp/esp-at/build/bootloader/bootloader.bin"Bootloader binary size 0x6330 bytes. 0xcd0 bytes (11%) free.
[1199/1201] Generating binary image from built executableesptool.py v4.7.0
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
Generated C:/Users/CJ/esp/esp-at/build/esp-at.bin
[1200/1201] cmd.exe /C "cd /D C:\Users\CJ\esp\esp-at\build...rtition-table.bin C:/Users/CJ/esp/esp-at/build/esp-at.bin"FAILED: esp-idf/esptool_py/CMakeFiles/app_check_size C:/Users/CJ/esp/esp-at/build/esp-idf/esptool_py/CMakeFiles/app_check_size
cmd.exe /C "cd /D C:\Users\CJ\esp\esp-at\build\esp-idf\esptool_py && C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:/Users/CJ/esp/esp-at/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app C:/Users/CJ/esp/esp-at/build/partition_table/partition-table.bin C:/Users/CJ/esp/esp-at/build/esp-at.bin"
Error: All app partitions are too small for binary esp-at.bin size 0x183a00:
  - Part 'ota_0' 0/16 @ 0x100000 size 0x180000 (overflow 0x3a00)
  - Part 'ota_1' 0/17 @ 0x280000 size 0x180000 (overflow 0x3a00)
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the C:\Users\CJ\esp\esp-at\build\log\idf_py_stderr_output_4600 and C:\Users\CJ\esp\esp-at\build\log\idf_py_stdout_output_4600
A fatal error occurred: idf.py build failed

More Information

I suspect some years back this was possible (to add Classic Bluetooth with SPP to ESP32 firmware). For example see this description (circa 2021)

However after many weeks of research I fear it may no longer possible as building with SPP always results in an oversized image/firmware size problem, no matter how many tweaks I tried (after studying Minimizing Binary Size)

There are just too many options and tweaks I don't understand, so I'm hoping either for guidance on the correct tweaks, or if necessary, an update to the esp-at menuconfig utiulity with new build options to support BT+SPP+A2DP as was originally intended.

In my perfect world view: there would be a menuconfig option to build a completely Classic Bluetooth focussed, stripped down firmware (e.g no BLE, no WiFi at all). Hopefully this can could be done within the actual firmware size limits and constraints.

chrisj7903 commented 3 days ago

Supporting information - the sequence and output from idf.py size:

cd C:\Espressif\frameworks\esp-idf-v5.2.2\ install cd %userprofile%\esp\esp-at idf.py size Executing action: size Running ninja in directory C:\Users...\esp\esp-at\build Executing "ninja all"... [1/1] cmd.exe /C "cd /D C:\Users...\esp\esp-at\build\bootloader\esp-idf\es... bootloader 0x1000 C:/Users/.../esp/esp-at/build/bootloader/bootloader.bin" Bootloader binary size 0x6330 bytes. 0xcd0 bytes (11%) free. [3/5] Running utility command for customized_bin

Creating NVS binary with version: V2 - Multipage Blob Support Enabled

Created NVS binary: ===> C:/Users/.../esp/esp-at/build/customized_partitions\mfg_nvs.bin
[4/5] cmd.exe /C "cd /D C:\Users\...\esp\esp-at\build\esp-idf\esptool_py &&...rtition_table/partition-table.bin C:/Users/.../esp/esp-at/build/esp-at.bin"
FAILED: esp-idf/esptool_py/CMakeFiles/app_check_size C:/Users/.../esp/esp-at/build/esp-idf/esptool_py/CMakeFiles/app_check_size
cmd.exe /C "cd /D C:\Users\...\esp\esp-at\build\esp-idf\esptool_py && C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:/Users/.../esp/esp-at/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app C:/Users/.../esp/esp-at/build/partition_table/partition-table.bin C:/Users/.../esp/esp-at/build/esp-at.bin"
Error: All app partitions are too small for binary esp-at.bin size 0x183a00:
  - Part 'ota_0' 0/16 @ 0x100000 size 0x180000 (overflow 0x3a00)
  - Part 'ota_1' 0/17 @ 0x280000 size 0x180000 (overflow 0x3a00)
ninja: build stopped: subcommand failed.
Running ninja in directory C:\Users\...\esp\esp-at\build
Executing "ninja size"...
[1/1] cmd.exe /C "cd /D C:\Users\...\esp\esp-at\build && C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:/Users/.../esp/esp-at/esp-idf/tools/idf_size.py C:/Users/.../esp/esp-at/build/esp-at.map"
Total sizes:
Used static DRAM:   56848 bytes (  67732 remain, 45.6% used)
      .data size:   20832 bytes
      .bss  size:   36016 bytes
Used static IRAM:  130490 bytes (    582 remain, 99.6% used)
      .text size:  129463 bytes
   .vectors size:    1027 bytes
Used Flash size : 1436155 bytes
      .text     : 1325311 bytes
      .rodata   :  110588 bytes

Total image size: 1587477 bytes (.bin may be padded larger)

Luxin812 commented 2 days ago

"Error: All app partitions are too small for binary esp-at.bin size 0x183a00:"----> From this, it can be seen that the size of the esp-at.bin you compiled exceeds the current app partition. You can disable the AT wifi and mqtt functions that you do not use in menuconfig and try compiling again.

chrisj7903 commented 2 days ago

That makes sense, but can you please specify exactly which options I need to de-select in menuconfig to disable AT wifi & mqtt ? I have tried this idea before but I have no expertise in menuconfig and there are many choices. So nothing I tried fixed my issue.

Luxin812 commented 2 days ago

Find the relevant configuration in menuconfig according to the following path and disable it.

Component config -> AT -> AT wifi command support Component config -> AT -> AT smartconfig command support Component config -> AT -> AT WPS command support Component config -> AT -> AT MQTT command support

chrisj7903 commented 9 hours ago

Two steps forward, one step back ... with WPS, smartconfig, WiFi & MQTT deselected, and with "bt command support" + "bt SPP command support" selected, I successfully completed the build, and then flashed to my ESP32-WROOM-32E.

However it continually loops, starting up briefly then aborts and reboots every couple of seconds. I have attached the looping output below, with abort and backtrace information. If I repeat all the above but leave "bt SPP command support" de-selected I can build and flash OK, and it runs correctly (e.g. responds to AT+BTINIT? )

So the bt SPP capability remains ellusive, and I have no idea what to try next ... help!

============================================= Rebooting... ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:5916 ho 0 tail 12 room 4 load:0x40078000,len:15844 load:0x40080400,len:3548 entry 0x40080600 I (29) boot: ESP-IDF v5.0.6-dirty 2nd stage bootloader I (29) boot: compile time 20:04:18 W (29) boot: Unicore bootloader I (32) boot: chip revision: v3.0 I (36) boot.esp32: SPI Speed : 40MHz I (41) boot.esp32: SPI Mode : DIO I (45) boot.esp32: SPI Flash Size : 4MB I (50) boot: Enabling RNG early entropy source... I (55) boot: Partition Table: I (59) boot: ## Label Usage Type ST Offset Length I (66) boot: 0 phy_init RF data 01 01 0000f000 00001000 I (74) boot: 1 otadata OTA data 01 00 00010000 00002000 I (81) boot: 2 nvs WiFi data 01 02 00012000 0000e000 I (89) boot: 3 at_customize unknown 40 00 00020000 000e0000 I (96) boot: 4 ota_0 OTA app 00 10 00100000 00180000 I (104) boot: 5 ota_1 OTA app 00 11 00280000 00180000 I (111) boot: End of partition table I (115) esp_image: segment 0: paddr=00100020 vaddr=3f400020 size=185f4h ( 99828) map I (160) esp_image: segment 1: paddr=0011861c vaddr=3ff80063 size=00008h ( 8) load I (160) esp_image: segment 2: paddr=0011862c vaddr=3ffbdb60 size=04ce0h ( 19680) load I (174) esp_image: segment 3: paddr=0011d314 vaddr=40080000 size=02d04h ( 11524) load I (179) esp_image: segment 4: paddr=00120020 vaddr=400d0020 size=10b778h (1095544) map I (579) esp_image: segment 5: paddr=0022b7a0 vaddr=40082d04 size=19238h (102968) load I (621) esp_image: segment 6: paddr=002449e0 vaddr=400c0000 size=00064h ( 100) load I (636) boot: Loaded app from partition at offset 0x100000 I (636) boot: Disabling RNG early entropy source... no external 32k oscillator, disable it now.

at param mode: 1

AT cmd port:uart1 tx:17 rx:16 cts:15 rts:14 baudrate:115200

module_name: WROOM-32

v3.4.0.0

abort() was called at PC 0x4016d696 on core 0

Backtrace: 0x40081626:0x3ffd30c0 0x4009373d:0x3ffd30e0 0x40097516:0x3ffd3100 0x4016d696:0x3ffd3170 0x4017d4b9:0x3ffd31a0 0x4017d542:0x3ffd31c0 0x4016d371:0x3ffd3210 0x400e88a6:0x3ffd3230 0x400ea957:0x3ffd3250 0x400eedf7:0x3ffd3280 0x401d8845:0x3ffd32b0

ELF file SHA256: 496f2f7abc0bca19