Skip to content

Commit 4a713cb

Browse files
committed
IDF 5_4_1 patch test
1 parent de1402e commit 4a713cb

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

.devcontainer/All/Dockerfile.All.SRC

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ $IDF_PATH/components/app_update:\
142142
/root/.espressif/tools/xtensa-esp-elf/$ESP_PATCH_VER/xtensa-esp-elf/bin:\
143143
/root/.espressif/tools/riscv32-esp-elf/$ESP_PATCH_VER/riscv32-esp-elf/bin
144144

145-
# FIXME: Work around for problem in IDF v5.4.1, must be removed for later releases when issue fixed
146-
ENV ESP_ROM_ELF_DIR=/root/.espressif/tools/esp-rom-elfs/20241011/
147-
148145
# Clean up downloaded files
149146
RUN apt-get autoremove -y \
150147
&& apt-get clean -y \

.devcontainer/ESP32/Dockerfile.ESP32.SRC

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ $IDF_PATH/components/app_update:\
7676
/root/.espressif/tools/xtensa-esp-elf/$ESP_PATCH_VER/xtensa-esp-elf/bin:\
7777
/root/.espressif/tools/riscv32-esp-elf/$ESP_PATCH_VER/riscv32-esp-elf/bin
7878

79-
# FIXME: Work around for problem in IDF v5.4.1, must be removed for later releases when issue fixed
80-
ENV ESP_ROM_ELF_DIR=/root/.espressif/tools/esp-rom-elfs/20241011/
81-
8279
# Clean up downloaded files
8380
RUN apt-get autoremove -y \
8481
&& apt-get clean -y \

CMake/binutils.ESP32.cmake

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,43 @@ macro(nf_fix_esp32c3_rom_file)
151151

152152
endmacro()
153153

154+
# Fixes an issue with IDF 5.4.1 where we get an error cause by ESP_ROM_ELF_DIR environment variable missing
155+
# This patch removes need for variable. Offical patch added after IDF5.4.1 release
156+
macro(nf_patch_idf5_4_1)
157+
file(READ
158+
${esp32_idf_SOURCE_DIR}/tools/cmake/gdbinit.cmake
159+
ESP32_GBBINIT_CONTENT)
160+
161+
string(FIND ${ESP32_GBBINIT_CONTENT} "# set(gdbinit_rom_in_path " GBD_INIT_PATCH_INDEX)
162+
message("-- Check IDF patch exists")
163+
if(GBD_INIT_PATCH_INDEX EQUAL -1)
164+
165+
message("-- Patching IDF 5.4.1 gdbinit.cmake")
166+
167+
string(REPLACE
168+
"set(gdbinit_rom_in_path "
169+
"# set(gdbinit_rom_in_path "
170+
ESP32_GBBINIT_NEW_CONTENT
171+
"${ESP32_GBBINIT_CONTENT}")
172+
173+
string(REPLACE
174+
"set(gdbinit_rom_path "
175+
"# set(gdbinit_rom_path "
176+
ESP32_GBBINIT_NEW_CONTENT
177+
"${ESP32_GBBINIT_NEW_CONTENT}")
178+
179+
string(REPLACE
180+
"file(TO_CMAKE_PATH "
181+
"# file(TO_CMAKE_PATH "
182+
ESP32_GBBINIT_NEW_CONTENT
183+
"${ESP32_GBBINIT_NEW_CONTENT}")
184+
185+
file(WRITE
186+
${esp32_idf_SOURCE_DIR}/tools/cmake/gdbinit.cmake
187+
"${ESP32_GBBINIT_NEW_CONTENT}")
188+
endif()
189+
endmacro()
190+
154191
# setting compile definitions for a target based on general build options
155192
# TARGET parameter to set the target that's setting them for
156193
# optional EXTRA_COMPILE_DEFINITIONS with compiler definitions to be added to the library
@@ -1025,6 +1062,9 @@ macro(nf_add_idf_as_library)
10251062

10261063
nf_fix_esp32c3_rom_file()
10271064

1065+
# FIXME patch IDF 5.4.1 problem
1066+
nf_patch_idf5_4_1()
1067+
10281068
# find out if there is support for BLE
10291069
string(FIND ${SDKCONFIG_DEFAULT_CONTENTS} "CONFIG_BT_ENABLED=y" CONFIG_BT_ENABLED_POS)
10301070

0 commit comments

Comments
 (0)