Forum Replies Created
-
AuthorPosts
-
September 27, 2025 at 09:53 in reply to: Espressif ESP-IDF v6.0 Intellisense error: invalid value gnu2b in -std=gnu2b #36922
gojimmypi
ParticipantThe gnu++2b was in my (~ 27th of) August commits of the ESP-IDF, here in
esp-idf/tools/cmake/build.cmake
.The most recent version exhibits a similar syntax highlighting problem, with a different root cause:
-std=gnu23
here.My fix above does still work, although clearly a bit of a hack, needing an additional replace:
string(REPLACE "-std=gnu2b" "-std=gnu23" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
I’ll try to take the 6.1 for a test drive soon. Thanks for the heads up.
gojimmypi
ParticipantLooking forward to v6.1!
In the meantime, I have this in a batch file to launch VS2022 for unreleased ESP-IDF v6 (latest via GitHub)
@echo off set IDF_COMPONENT_STORAGE_URL=file:///C:/SysGCC/esp32-master/registry;default set IDF_PYTHON_ENV_PATH=C:\SysGCC\esp32-master\python_env\ set IDF_TOOLS_PATH=C:\SysGCC\esp32-master set CONFIG_WOLFSSL_USE_MY_PRIVATE_CONFIG=1 set CONFIG_WOLFSSL_FORCE_V6_INTELLISENSE_FIX=1 rem Launch Visual Studio without making this console wait start "" "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe" %* exit /b
see also related Intellisense for ESP-IDF v6: https://sysprogs.com/w/forums/topic/espressif-esp-idf-v6-0-intellisense-error-invalid-value-gnu2b-in-stdgnu2b/
September 22, 2025 at 09:10 in reply to: Espressif ESP-IDF v6.0 Intellisense error: invalid value gnu2b in -std=gnu2b #36914gojimmypi
ParticipantHeads up the above solution only worked for my local project source code.
For other source code in my component being developed, as well as the entire ESP-IDF source, I added this to the main project cmake, just before the ending
project(projectname)
:if( "$ENV{CONFIG_WOLFSSL_FORCE_V6_INTELLISENSE_FIX}" STREQUAL "1" ) if(DEFINED IDF_VERSION_MAJOR AND IDF_VERSION_MAJOR GREATER_EQUAL 6) message(STATUS "-- Found CONFIG_WOLFSSL_FORCE_V6_INTELLISENSE_FIX, replacing -std=gnu2b with -std=gnu2x") if(CMAKE_C_COMPILER_ID MATCHES "Clang") string(REPLACE "-std=gnu2b" "-std=gnu2x" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") endif() else() message(STATUS "-- Visual Studio Intellisense Fix not needed for this ESP-IDF version=${IDF_VERSION_MAJOR}") endif() else() message(STATUS "-- Not replacing -std=gnu2b with -std=gnu2x for Viosual Studio Intellisense fix") message(STATUS "-- To enable, define environment variable: CONFIG_WOLFSSL_FORCE_V6_INTELLISENSE_FIX=1") endif() # Once the project is loaded, next check for ESP-IDF version 6 or greater. # Numerous "dangerous relocation: call8: call target out of range: memcpy" errors encountered # So we'll allow long calls with the
-mlongcalls
compiler option for all components. if(IDF_VERSION_MAJOR GREATER_EQUAL 6) if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET STREQUAL "esp32s3") message(STATUS "mlongcalls for all components") idf_build_set_property(COMPILE_OPTIONS "-mlongcalls" APPEND) endif() endif()Also added this to the local component in the project directory cmake, just after the
idf_component_register()
:if( "$ENV{CONFIG_WOLFSSL_FORCE_V6_INTELLISENSE_FIX}" STREQUAL "1" ) if(DEFINED IDF_VERSION_MAJOR AND IDF_VERSION_MAJOR GREATER_EQUAL 6) message(STATUS "-- Setting -std=gnu17 with target_compile_options $<$:-std=gnu17>") target_compile_options(${COMPONENT_LIB} PRIVATE $<$:-std=gnu17>) else() message(STATUS "-- Visual Studio Intellisense Fix not needed for this ESP-IDF version=${IDF_VERSION_MAJOR}") endif() else() message(STATUS "-- Not setting -std=gnu17 with target_compile_options for Visual Studio Intellisense Fix") message(STATUS "-- To enable, define environment variable: CONFIG_WOLFSSL_FORCE_V6_INTELLISENSE_FIX=1") endif()
Note that it is optional code, based on the environment variable:
CONFIG_WOLFSSL_FORCE_V6_INTELLISENSE_FIX=1
I’m note sure exactly which are needed, but in order for syntax highlighting to be reliably restored for me:
- Exit Visual Studio
- Delete
./build
directory - Delete .
/visualgdb
directory - Delete
./vs
directory - Restart Visual Studio
gojimmypi
Participantfwiw, still occurring with the latest update today (ESP32 3.3.1) See attached
VisualGDB 6.0R8 (build 5338)
Looks like of the 170+ problems, included is at least the ESP Matter Connected Home stuff. Undesired to just ignore.
Perhaps an alternative install location can be used?
There’s a Windows fix that I personally choose not to use, as I also test my own distributions for other things:
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
Attachments:
You must be logged in to view attached files.gojimmypi
ParticipantHeads up ESP-IDF v5.5 has been released.
https://github.com/espressif/esp-idf/releases/tag/v5.5
Beware: “Release v5.5 is mostly compatible with apps written for ESP-IDF v5.4.”
See the section: “breaking changes”
-
This reply was modified 2 months, 2 weeks ago by
gojimmypi.
gojimmypi
ParticipantHeads up the Espressif ESP-IDF v5.5 is now in beta:
https://github.com/espressif/esp-idf/releases/tag/v5.5-beta1
I was initially unable to get VisualGDB to use the new toolchain for the same cmake version issue described in my original message.
However, I found this topic from last year: “Problem on new ESP32 toolchain”:
https://sysprogs.com/w/forums/topic/problem-on-new-esp32-toolchain/
Specifically the link to “Troubleshooting”:
https://visualgdb.com/documentation/espidf/#troubleshooting
To resolve, I set my Tools – Options – VisualGDB – General – Python Directory (ESP-IDF) to
C:\Users\gojimmypi\AppData\Local\VisualGDB\Python-3.11.5
-
This reply was modified 3 months, 3 weeks ago by
gojimmypi.
May 29, 2024 at 13:21 in reply to: Espressif ESP32 Staging Components Preview: fails to find component #35681gojimmypi
ParticipantThat seemed like a reasonable approach, although I was left wondering why system-wide environment value would not be “seen” by cmake?
In any case, it didn’t work.
(see attached). I still see the error:
Requirement files:
- C:\SysGCC\esp32\esp-idf\v5.2\tools\requirements\requirements.core.txt
Python being checked: C:\SysGCC\esp32-master\python_env\\idf5.2_py3.8_env\Scripts\python.exe
Manifest files have changed, solving dependencies.
..-- Configuring incomplete, errors occurred!
CMake Error at C:/SysGCC/esp32/esp-idf/v5.2/tools/cmake/build.cmake:544 (message):
WARNING: Component "gojimmypi/mywolfssl" not found
ERROR: Because project depends on gojimmypi/mywolfssl (^5.7.1-preview2f1)
which doesn't match any versions, version solving failed.
Call Stack (most recent call first):
Here it is in WSL using the same toolchain; first, the error is expected since there’s no release called mywolfssl
$ idf.py add-dependency "gojimmypi/mywolfssl^5.7.1-preview2f1"
Executing action: add-dependency
ERROR: Component "gojimmypi/mywolfssl" not found
Here it is setting the staging site environment variable:
gojimmypi:/mnt/c/workspace/esp32-homekit-demo-gojimmypi-pr/examples/led
$ export IDF_COMPONENT_REGISTRY_URL=https://components-staging.espressif.com
gojimmypi:/mnt/c/workspace/esp32-homekit-demo-gojimmypi-pr/examples/led
$ idf.py add-dependency "gojimmypi/mywolfssl^5.7.1-preview2f1"
Executing action: add-dependency
Successfully added dependency "gojimmypi/mywolfssl^5.7.1-preview2f1" to component "main"
It then successfully builds using the staging instance of
gojimmypi/mywolfssl
.Also, after attempting to build and revisiting the
IDF_COMPONENT_REGISTRY_URL=https://components-staging.espressif.com
shown in the attached screen snip, when clicking on the newly createdIDF_COMPONENT_REGISTRY_URL
value, Visual Studio became unresponsive and restarted.Other than this anomaly, VisualGDB is working great.
Attachments:
You must be logged in to view attached files.gojimmypi
ParticipantAha! Great! Thanks for the update.
I should add this is also quite helpful for installing multiple versions of the ESP-IDF toolchain:
February 19, 2024 at 09:57 in reply to: What is the official/recommended method for installing the latest EPS toolchain #35358gojimmypi
ParticipantIn my
C:\SysGCC
I have manually installedC:\SysGCC\esp32-11.2
andC:\SysGCC\esp32-8.4
for the older toolchains, in addition to the default install ofC:\SysGCC\esp32
which has version 12.1 of the toolchain.Inside each of *those* directories, I have different versions of the ESP-IDF SDK, for instance:
In my
C:\SysGCC\esp32\esp-idf
, I performed “git clone [repo] [sdk name]” for these:esp-idf-v5.2-beta1
master
v5.0
v5.1That allows relatively each changing of SDK and toolchains. Be sure to delete the build directory and sdkconfig file when changing.
I’ve found that simply keeping different versions of the project file much easier than manually changing them to different SDK & toolchain versions, for example:
-
This reply was modified 1 year, 7 months ago by
gojimmypi.
gojimmypi
ParticipantHello,
I recently installed the 20231123 ESP32 Debug Methods update to VisualGDB.
The JTAG programming and debugging capabilities (ESP-IDF v5.1) seem to be working well for the ESP32-H2 now! Thank you.
There is however an oddity when pressing the “Debug – Test” button, indicating that the test failed:
Error: Error on socket 'GDB': WSAGetLastError==10054, message: An existing connection was forcibly closed by the remote host.
I’ve attached the full log for reference. So far, it seems the error can be ignored.
Also, note that unlike other devices when doing
idf.py erase-flash
, the ESP32-H2 is not in a happy state when freshly erased. Error “invalid header” scrolling endlessly. In this state I am unable to JTAG debug.Here’s an example of the console output after erase & JTAG will not work:
invalid header: 0xffffffff
invalid header: 0xfffff▒ESP-ROM:esp32h2-20221101
Build:Nov 1 2022
rst:0x7 (TG0_WDT_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x40011bdc
invalid header: 0xffffffff
invalid header: 0xffffffff
Upon flashing a clean, operational “hello world” (or any other app) – then the JTAG capabilities work fine.
Thank you again for this fix.
Cheers
Attachments:
You must be logged in to view attached files.gojimmypi
ParticipantThere’s a recording of the “Getting Started with wolfSSL on the Espressif ESP32” here:
gojimmypi
Participantawesome, thank you 🙂
gojimmypi
ParticipantESP-IDF 5.1 has been released: https://github.com/espressif/esp-idf/releases/tag/v5.1
gojimmypi
ParticipantI’ve setup wolfSSL as a managed component.
I’m hoping to use other components such as the esp-cryptoauthlib.
Components are added to a project like this:
idf.py add-dependency "espressif/esp-cryptoauthlib^3.5.1~1"
It appears the only thing that command does is to add/update the project
idf_component.yml
file.Subsequent calls with
idf.py build
appear to recognize that component file, download required files to themanaged_components
directory, and compile everything.However, from within the VisualGDB environment, nothing new seems to happen at compile time: The IDE does not seem to recognize the ESP Registry components in the
managed_components
directory.I wasn’t able to find any VisualGDB documentation on this. It this capability supported? I’m using EDP-IDF v5.
Thank you
gojimmypi
ParticipantHeads up for anyone else looking to manually enabled ESP32-C6 support before officially supported:
In addition to copy/paste (mentioned above) of a
ESP32C3
section in [SysGCC]\esp32\esp32-bsp\BSP.xmlNeed to also edit
C:\SysGCC\esp32\toolchain.xml
The
esp-2022r1-11.2.0\riscv32-esp-elf\bin
does not support the RISC-Vzifencei
extension, resulting in an error like:Running CMake: C:\Users\gojimmypi\AppData\Local\VisualGDB\CMake\bin\cmake.exe ../../.. -G "Ninja" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_MAKE_PROGRAM=C:/SysGCC/esp32/tools/ninja/1.10.2/ninja.exe -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 -DIDF_TARGET=esp32c6
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.39.1.windows.1")
-- Component directory C:/SysGCC/esp32/esp-idf/master/components/tinyusb does not contain a CMakeLists.txt file. No component will be added
-- 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:/SysGCC/esp32/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/SysGCC/esp32/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe
-- Check for working C compiler: C:/SysGCC/esp32/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe - broken
-- Configuring incomplete, errors occurred!
CMake Error at C:/Users/gojimmypi/AppData/Local/VisualGDB/CMake/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"C:/SysGCC/esp32/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/workspace/wolfssl-gojimmypi/IDE/Espressif/ESP-IDF/examples/wolfssl_test/build/VisualGDB/Debug/CMakeFiles/CMakeTmp
Run Build Command(s):C:/SysGCC/esp32/tools/ninja/1.10.2/ninja.exe cmTC_30b2a && [1/2] Building C object CMakeFiles/cmTC_30b2a.dir/testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_30b2a.dir/testCCompiler.c.obj
C:\SysGCC\esp32\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin\riscv32-esp-elf-gcc.exe -march=rv32imc_zicsr_zifencei -o CMakeFiles/cmTC_30b2a.dir/testCCompiler.c.obj -c testCCompiler.c
Assembler messages:
Fatal error: -march=rv32imc_zicsr_zifencei: Invalid or unknown z ISA extension: 'zifencei'
ninja: build stopped: subcommand failed.
To fix this, I copied the
esp-12.2.0_20230208
toolchain from the Espressif-installed (latest master branch) toolchain:C:\Users\gojimmypi\.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208
to:
C:\SysGCC\esp32\tools\riscv32-esp-elf\esp-12.2.0_20230208
and changed the
C:\SysGCC\esp32\toolchain.xml
setting:
tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin
(the old toolchain value was
esp-2022r1-11.2.0
)I also copied the
ESP32c3.xml
toESP32C6.xml
inC:\SysGCC\esp32\esp32-bsp\peripherals
and edited the
ESP32C6
contents.The GDB executable file was missing, so added
riscv32-esp-elf-gdb.exe
riscv32-esp-elf-gdb-add-index
from
C:\SysGCC\esp32\tools\riscv32-esp-elf\esp-2022r1-11.2.0\riscv32-esp-elf\bin
I copied the
esp32c3.cfg
toesp32c6.cfg
in this directory:C:\Users\gojimmypi\AppData\Local\VisualGDB\EmbeddedDebugPackages\com.sysprogs.esp32.core\share\openocd\scripts\target
and edited all of the “C3” to “C6” values in the new
esp32c6.cfg
file.I’m very close to having JTAG working, with this
Error: Unknown target type esp32c6
C:\Users\gojimmypi\AppData\Local\VisualGDB\EmbeddedDebugPackages\com.sysprogs.esp32.core\bin\openocd.exe -c "gdb_port 59108" -c "telnet_port 59106" -f interface/esp_usb_jtag_c6.cfg -c "adapter_khz 40000" -f target/esp32c6.cfg -c "echo VisualGDB_OpenOCD_Ready"
Open On-Chip Debugger 0.10.0 (2022-05-03)
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
adapter speed: 40000 kHz
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 40000 kHz
Warn : Transport "jtag" was already selected
target/esp32c6.cfg:96: Error: Unknown target type esp32c6, try one of arm7tdmi, arm9tdmi, arm920t, arm720t, arm966e, arm946e, arm926ejs, fa526, feroceon, dragonite, xscale, cortex_m, cortex_a, cortex_r4, arm11, ls1_sap, mips_m4k, avr, dsp563xx, dsp5680xx, testee, avr32_ap7k, hla_target, nds32_v2, nds32_v3, nds32_v3m, esp32, esp32s2, esp32s3, esp32c3, or1k, quark_x10xx, quark_d20xx, stm8, riscv, mem_ap, esirisc, arcv2, aarch64, or mips_mips64
in procedure 'script'
at file "embedded:startup.tcl", line 26
at file "target/esp32c6.cfg", line 96
Line 96 is the “else” here:
if { $_RTOS == "none" } {
target create $_TARGETNAME esp32c6 -chain-position $_TAPNAME
} else {
target create $_TARGETNAME esp32c6 -chain-position $_TAPNAME -rtos $_RTOS
}
So I’m able to compile and program via COM port in Visual Studio, but I don’t yet have GDB/JTAG working.
Any tips on resolving the
Error: Unknown target type esp32c6
attarget create $_TARGETNAME esp32c6
?My ESP32-C6 vgdbproj project file is here.
-
AuthorPosts