Fix Xtensa ESP32/S3 standalone build (configMAX redefinition, lx7 mapping, missing ESP-IDF stubs)#69
Fix Xtensa ESP32/S3 standalone build (configMAX redefinition, lx7 mapping, missing ESP-IDF stubs)#69Copilot wants to merge 3 commits into
Conversation
…a_esp32 arch config Agent-Logs-Url: https://github.com/choco-technologies/dmosi-freertos/sessions/076eca15-9c10-4500-83e6-83fb87360bd3 Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
|
@copilot nie naprawiłeś problemu. Wciąż są błędy kompilacji. Proszę Cię, abyś sklonował repozytorium |
…sp_idf_version.h stubs Agent-Logs-Url: https://github.com/choco-technologies/dmosi-freertos/sessions/965b0de9-31ff-413a-8eb4-775e03614167 Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Three root causes were found and fixed (commit
|
The GCC_XTENSA_ESP32 FreeRTOS port fails to build when used outside the ESP-IDF build system (e.g. with
dmod-boottargeting ESP32-S3). Three root causes were identified and fixed.Changes
1.
config/arch/xtensa_esp32/FreeRTOSConfigArch.h— preventconfigMAX_SYSCALL_INTERRUPT_PRIORITYredefinitionFreeRTOSConfig.hsetsconfigMAX_SYSCALL_INTERRUPT_PRIORITYto0before the port's ownFreeRTOSConfig_arch.hunconditionally redefines it toXCHAL_EXCM_LEVEL, producing a redefinition warning. Pre-defining it here causes the port's subsequent definition to be a no-op (identical replacement text).2.
cmake/arch_mapping.cmake— addlx7(andlx6) →GCC_XTENSA_ESP32mappingdmod-bootsetsDMOSI_ARCH_FAMILY=lx7for ESP32-S3 (Xtensa LX7 core), but the mapping table had no entry for it, causing aFATAL_ERRORduring CMake configuration. Bothlx7andlx6are now mapped toGCC_XTENSA_ESP32/xtensa_esp32.3.
config/arch/xtensa_esp32/sdkconfig.h(new) — minimal stub for standalone buildsThe port's
FreeRTOSConfig_arch.hunconditionally#include "sdkconfig.h", which is auto-generated by ESP-IDF's Kconfig system and not present in standalone builds. The stub provides the two required symbols:CONFIG_FREERTOS_CORETIMER_0 1— selects the FreeRTOS tick timerCONFIG_FREERTOS_ISR_STACKSIZE 1792— ISR stack size (ESP-IDF default, 16-byte aligned)4.
config/arch/xtensa_esp32/esp_idf_version.h(new) — minimal stub declaring IDF 4.1.0The port's assembly and C files include
esp_idf_version.hand branch onESP_IDF_VERSION >= 4.2.0. Without this header bothESP_IDF_VERSIONandESP_IDF_VERSION_VALresolve to0in preprocessor#ifexpressions, making0 >= 0evaluate to true. This activates code paths that referenceXT_STK_TMP0/1/2— Espressif-specific stack-frame offsets that exist only in ESP-IDF's xtensa component headers, not in the bare Xtensa toolchain sysroot — producing the "invalid symbolic operand" assembler errors atxtensa_context.Slines 194–196 and 256–258.Declaring version
4.1.0 (< 4.2.0)causes the preprocessor to skip those code paths. For call0-ABI builds (ESP32-S3 with-mabi=call0), the register-window code in the< 4.2.0branch is also bypassed via#ifndef __XTENSA_CALL0_ABI__, so context save/restore is correct.In a real ESP-IDF build (via
idf.py), the generatedsdkconfig.handesp_idf_version.hare found earlier in the include path and shadow these stubs automatically.