The error messages are in the terminal during the build in the ESP-IDF, not sure what you mean by Microsoft C/C++ extension.
Since I have reinstalled VSCode and the ESP-IDF extension from scratch with ESP IDF 5.1.2 stable.
I run with the c_cpp_properties.json unmodified after the install. Hard coding the compilerPath did not help.
Code: Select all
{
"configurations": [
{
"name": "ESP-IDF",
"compilerPath": "${config:idf.toolsPathWin}undefined",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": false
}
}
],
"version": 4
}
The C code used is now reduced to the bare minimum :
Code: Select all
#include <stdio.h>
void app_main(void)
{
}
I see the same problem where builds for Xtensa ESP32 modules work (using xtensa-esp32-elf-gcc.exe) while builds for RISC-V ESP32 modules fail (using riscv32-esp-elf-g++.exe) with the same errors.
Below the error messages for a build done with target set to ESP32H2:
Code: Select all
Successfully created esp32h2 image.
Generated C:/Users/Bruno/VSCode/Projects/Espressif/v5.1.2/Test/build/bootloader/bootloader.bin
[105/105] cmd.exe /C "cd /D C:\Users\Bruno\VSCode\Projects\Espressif\v5.1.2\Test\build\bootloader\esp-idf\esptool_py && C:\Users\Bruno\VSCode\ESP-IDF\v5.1.2\.espressif\python_env\idf5.1_py3.11_env\Scripts\python.exe C:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0
C:/Users/Bruno/VSCode/Projects/Espressif/v5.1.2/Test/build/bootloader/bootloader.bin"
Bootloader binary size 0x5240 bytes. 0x2dc0 bytes (36%) free.
[391/909] Building CXX object esp-idf/cxx/CMakeFiles/__idf_cxx.dir/cxx_guards.cpp.obj
FAILED: esp-idf/cxx/CMakeFiles/__idf_cxx.dir/cxx_guards.cpp.obj
C:\Users\Bruno\VSCode\ESP-IDF\v5.1.2\.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin\riscv32-esp-elf-g++.exe -DESP_PLATFORM -DIDF_VER=\"v5.1.2\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -IC:/Users/Bruno/VSCode/Projects/Espressif/v5.1.2/Test/build/config -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/newlib/platform_include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/freertos/FreeRTOS-Kernel/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/freertos/esp_additions/include/freertos -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/freertos/esp_additions/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/freertos/esp_additions/arch/riscv/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_hw_support/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_hw_support/include/soc -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_hw_support/include/soc/esp32h2 -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_hw_support/port/esp32h2/. -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_hw_support/port/esp32h2/private_include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/heap/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/log/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/soc/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/soc/esp32h2 -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/soc/esp32h2/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/hal/esp32h2/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/hal/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/hal/platform_port/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_rom/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_rom/include/esp32h2 -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_rom/esp32h2 -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_common/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_system/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_system/port/soc -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_system/port/include/riscv -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_system/port/include/private -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/riscv/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/include/apps -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/include/apps/sntp -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/lwip/src/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/port/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/port/freertos/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/port/esp32xx/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/port/esp32xx/include/arch -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/pthread/include -march=rv32imac_zicsr_zifencei -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 -nostartfiles -Og -fmacro-prefix-map=C:/Users/Bruno/VSCode/Projects/Espressif/v5.1.2/Test=. -fmacro-prefix-map=C:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -std=gnu++2b -fno-exceptions -fno-rtti -MD -MT esp-idf/cxx/CMakeFiles/__idf_cxx.dir/cxx_guards.cpp.obj -MF esp-idf\cxx\CMakeFiles\__idf_cxx.dir\cxx_guards.cpp.obj.d -o esp-idf/cxx/CMakeFiles/__idf_cxx.dir/cxx_guards.cpp.obj -c C:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/cxx/cxx_guards.cpp
In file included from c:\users\bruno\vscode\esp-idf\v5.1.2\.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\riscv32-esp-elf\include\c++\12.2.0\stdlib.h:36,
from C:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/cxx/cxx_guards.cpp:7:
c:\users\bruno\vscode\esp-idf\v5.1.2\.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\riscv32-esp-elf\include\c++\12.2.0\cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory
41 | #include <bits/c++config.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
[393/909] Building CXX object esp-idf/cxx/CMakeFiles/__idf_cxx.dir/cxx_exception_stubs.cpp.obj
FAILED: esp-idf/cxx/CMakeFiles/__idf_cxx.dir/cxx_exception_stubs.cpp.obj
C:\Users\Bruno\VSCode\ESP-IDF\v5.1.2\.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin\riscv32-esp-elf-g++.exe -DESP_PLATFORM -DIDF_VER=\"v5.1.2\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -IC:/Users/Bruno/VSCode/Projects/Espressif/v5.1.2/Test/build/config -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/newlib/platform_include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/freertos/FreeRTOS-Kernel/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/freertos/esp_additions/include/freertos -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/freertos/esp_additions/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/freertos/esp_additions/arch/riscv/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_hw_support/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_hw_support/include/soc -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_hw_support/include/soc/esp32h2 -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_hw_support/port/esp32h2/. -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_hw_support/port/esp32h2/private_include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/heap/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/log/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/soc/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/soc/esp32h2 -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/soc/esp32h2/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/hal/esp32h2/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/hal/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/hal/platform_port/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_rom/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_rom/include/esp32h2 -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_rom/esp32h2 -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_common/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_system/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_system/port/soc -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_system/port/include/riscv -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/esp_system/port/include/private -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/riscv/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/include/apps -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/include/apps/sntp -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/lwip/src/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/port/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/port/freertos/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/port/esp32xx/include -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/lwip/port/esp32xx/include/arch -IC:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/pthread/include -march=rv32imac_zicsr_zifencei -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 -nostartfiles -Og -fmacro-prefix-map=C:/Users/Bruno/VSCode/Projects/Espressif/v5.1.2/Test=. -fmacro-prefix-map=C:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -std=gnu++2b -fno-exceptions -fno-rtti -MD -MT esp-idf/cxx/CMakeFiles/__idf_cxx.dir/cxx_exception_stubs.cpp.obj -MF esp-idf\cxx\CMakeFiles\__idf_cxx.dir\cxx_exception_stubs.cpp.obj.d -o esp-idf/cxx/CMakeFiles/__idf_cxx.dir/cxx_exception_stubs.cpp.obj -c C:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/cxx/cxx_exception_stubs.cpp
In file included from C:/Users/Bruno/VSCode/ESP-IDF/v5.1.2/esp-idf/components/cxx/cxx_exception_stubs.cpp:6:
c:\users\bruno\vscode\esp-idf\v5.1.2\.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\riscv32-esp-elf\include\c++\12.2.0\cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory
41 | #include <bits/c++config.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
[396/909] Building C object esp-idf/newlib/CMakeFiles/__idf_newlib.dir/time.c.obj
ninja: build stopped: subcommand failed.
There is no file c++config.h in the ...\include\c++\12.2.0\bits in the directories but the compile_commands.json file always contains build commands for cxx_guards.cpp and cxx_exception_stubs.cpp for both ESP32 architectures.
As expected I guess the includes change depending in the ESP32 type.
Of course the problem may be somewhere in my W10 (I get the same error on 2 PCs) or in my setup but it is rather strange that this would make build fail just for the RISC-V modules.
Is there debug options I could use ?