Fixes and improvements (#642)

This commit is contained in:
Shadowtrance
2026-08-31 07:10:52 +10:00
committed by GitHub
parent 7a81b525ed
commit d3656bcd3d
14 changed files with 344 additions and 73 deletions
+18 -4
View File
@@ -58,10 +58,9 @@ if (DEFINED ENV{ESP_IDF_VERSION})
set(EXCLUDE_COMPONENTS "Simulator")
# Panic handler wrapping is only available on Xtensa architecture
if (CONFIG_IDF_TARGET_ARCH_XTENSA)
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=esp_panic_handler" APPEND)
endif ()
# panic_info_t is architecture-independent (esp_private/panic_internal.h) so this wrap applies
# to every target; PanicHandler.cpp branches internally per architecture.
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=esp_panic_handler" APPEND)
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=read" APPEND)
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=write" APPEND)
@@ -90,6 +89,21 @@ endif ()
project(Tactility)
if (DEFINED ENV{ESP_IDF_VERSION})
# PanicHandler.cpp's RISC-V callstack walker requires s0 to stay a frame pointer, which GCC
# does not guarantee without this flag. CONFIG_ESP_SYSTEM_USE_FRAME_POINTER does not add it
# (it only selects which ESP-IDF backtrace-printing function gets compiled), and can't be used
# instead: the bootloader shares this project's sdkconfig with no per-subproject override, and
# enabling it there overflows the bootloader's fixed partition budget. Setting the flag here via
# idf_build_set_property() only affects this project's own configure, not the bootloader's
# separate one, so it's naturally excluded. Gated to RISC-V since Xtensa never reads s0 this way.
# Must run after project(Tactility) above - project() initializes default build specifications
# that would otherwise overwrite this.
if(CONFIG_IDF_TARGET_ARCH_RISCV)
idf_build_set_property(COMPILE_OPTIONS "-fno-omit-frame-pointer" APPEND)
endif()
endif ()
# Defined as regular project for PC and component for ESP
if (NOT DEFINED ENV{ESP_IDF_VERSION})
add_subdirectory(Tactility)