Why offer JTAG debugging when the IDF setting make using JTAG useless.
If you set compiler for Debug - most all the variables are optimized out.
If you set it for no-optimization - the variables are unavailable because no debugging info available.
There is NOT a compiler setting that works.
I've tried various methods to modify the compiler flags (just for my files) and nothing works.
What is needed is -g -O0 combination for debug with no optimization.
Please tell me how to compile just my files - with those flags.
Thanks.
IDF Compiler settings are TERRIBLE for JTAG debugging
-
MicroController
- Posts: 2661
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: IDF Compiler settings are TERRIBLE for JTAG debugging
Thanks for the reply.
THAT was one of the many I tried. I have compiler set for no optimization in the sdk config and added add_compile_options(-g) as the last line in my CMakeLists.txt in main.
No change in behavior.
Did I use the add_compile_options() improperly?
Thanks
THAT was one of the many I tried. I have compiler set for no optimization in the sdk config and added add_compile_options(-g) as the last line in my CMakeLists.txt in main.
No change in behavior.
Did I use the add_compile_options() improperly?
Thanks
-
MicroController
- Posts: 2661
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: IDF Compiler settings are TERRIBLE for JTAG debugging
You can check the exact compiler commands generated from your CMakeLists.txt in build/compile_commands.json.
Re: IDF Compiler settings are TERRIBLE for JTAG debugging
I tried adding add_compile_options() to the CMakeLists.txt in Main but the build process fails stating that the command in not-scriptable.
Added it to the CMakeLists.txt in the project folder -- see below
Every things compiles and links. Run the JTAG debugger and all variables are identified as "unavailable".
Here is a entry from compile_commands.json
You can see where the add_compile_options() were used -- look 9 lines from bottom and about 10 chars in.
Any thoughts as why still no debugging information available?
Added it to the CMakeLists.txt in the project folder -- see below
Code: Select all
# For more information about build system see
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
add_compile_options( -O0 -g )
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(FD_Remote)
Here is a entry from compile_commands.json
Code: Select all
{
"directory": "C:/CPP/ESP32 Projects/FD_Remote/build",
"command": "C:\\Users\\Joe\\.espressif\\tools\\xtensa-esp-elf\\esp-14.2.0_20241119\\xtensa-esp-elf\\bin\\xtensa-esp32-elf-gcc.exe -DESP_PLATFORM -DIDF_VER=\\\"v5.4-dirty\\\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I\"C:/CPP/ESP32 Projects/FD_Remote/build/config\" -I\"C:/CPP/ESP32 Projects/FD_Remote/main/include\" -I\"C:/CPP/ESP32 Projects/FD_Remote/main\" -IC:/Users/Joe/esp/v5.4/esp-idf/components/newlib/platform_include -IC:/Users/Joe/esp/v5.4/esp-idf/components/freertos/config/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/freertos/config/include/freertos -IC:/Users/Joe/esp/v5.4/esp-idf/components/freertos/config/xtensa/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/freertos/FreeRTOS-Kernel/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -IC:/Users/Joe/esp/v5.4/esp-idf/components/freertos/esp_additions/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_hw_support/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_hw_support/include/soc -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_hw_support/include/soc/esp32 -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_hw_support/dma/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_hw_support/ldo/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_hw_support/debug_probe/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_hw_support/port/esp32/. -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_hw_support/port/esp32/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/heap/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/heap/tlsf -IC:/Users/Joe/esp/v5.4/esp-idf/components/log/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/soc/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/soc/esp32 -IC:/Users/Joe/esp/v5.4/esp-idf/components/soc/esp32/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/soc/esp32/register -IC:/Users/Joe/esp/v5.4/esp-idf/components/hal/platform_port/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/hal/esp32/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/hal/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_rom/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_rom/esp32/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_rom/esp32/include/esp32 -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_rom/esp32 -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_common/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_system/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_system/port/soc -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_system/port/include/private -IC:/Users/Joe/esp/v5.4/esp-idf/components/xtensa/esp32/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/xtensa/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/xtensa/deprecated_include -IC:/Users/Joe/esp/v5.4/esp-idf/components/lwip/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/lwip/include/apps -IC:/Users/Joe/esp/v5.4/esp-idf/components/lwip/include/apps/sntp -IC:/Users/Joe/esp/v5.4/esp-idf/components/lwip/lwip/src/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/lwip/port/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/lwip/port/freertos/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/lwip/port/esp32xx/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/lwip/port/esp32xx/include/arch -IC:/Users/Joe/esp/v5.4/esp-idf/components/lwip/port/esp32xx/include/sys -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_wifi/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_wifi/include/local -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_wifi/wifi_apps/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_wifi/wifi_apps/nan_app/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_event/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_phy/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_phy/esp32/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_netif/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/nvs_flash/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_partition/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_driver_gpio/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_driver_uart/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_driver_spi/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_pm/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_driver_sdmmc/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/sdmmc/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_driver_sdspi/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/app_update/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/bootloader_support/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/bootloader_support/bootloader_flash/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_app_format/include -IC:/Users/Joe/esp/v5.4/esp-idf/components/esp_bootloader_format/include -mlongcalls -Wno-frame-address -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -fdiagnostics-color=always -O0 -g -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-error=extra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb \"-fmacro-prefix-map=C:/CPP/ESP32 Projects/FD_Remote=.\" -fmacro-prefix-map=C:/Users/Joe/esp/v5.4/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -std=gnu17 -Wno-old-style-declaration -o esp-idf\\main\\CMakeFiles\\__idf_main.dir\\H_EE.c.obj -c \"C:\\CPP\\ESP32 Projects\\FD_Remote\\main\\H_EE.c\"",
"file": "C:\\CPP\\ESP32 Projects\\FD_Remote\\main\\H_EE.c",
"output": "esp-idf\\main\\CMakeFiles\\__idf_main.dir\\H_EE.c.obj"
},
Any thoughts as why still no debugging information available?
-
MicroController
- Posts: 2661
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: IDF Compiler settings are TERRIBLE for JTAG debugging
Dunno. Maybe "-g" doesn't do anything with the xtensa-esp32-gcc and "-Og" is the best you'll get.
Who is online
Users browsing this forum: ChatGPT-User, meta-externalagent, Qwantbot, Semrush [Bot], YisouSpider and 5 guests