esp-idf/tools/cmake/openocd.cmake
Alexey Lapshin 48a49c8154 feat(debugging): move gdbinit generation to CMake
This feature is useful for 3rd-party software to run GDB with predefined
options that described in project_description.json file

allow to pass custom options to "idf.py gdb":

  --gdb-commands: command line arguments for gdb. (without changes)
  -ex: pass command to gdb.
  -x: pass gdbinit file to gdb. Alias for old --gdbinit command
2024-11-19 16:41:38 +07:00

15 lines
697 B
CMake

# __get_openocd_options
# Prepares openocd default options for the target.
function(__get_openocd_options openocd_option_var)
if(CONFIG_IDF_TARGET STREQUAL "esp32")
set(${openocd_option_var} "-f board/esp32-wrover-kit-3.3v.cfg" PARENT_SCOPE)
elseif(CONFIG_IDF_TARGET STREQUAL "esp32s2")
set(${openocd_option_var} "-f board/esp32s2-kaluga-1.cfg" PARENT_SCOPE)
elseif(CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED)
set(${openocd_option_var} "-f board/${CONFIG_IDF_TARGET}-builtin.cfg" PARENT_SCOPE)
else()
set(${openocd_option_var}
"-f interface/ftdi/esp32_devkitj_v1.cfg -f target/${CONFIG_IDF_TARGET}.cfg" PARENT_SCOPE)
endif()
endfunction()