Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't build! (IDFGH-14674) #15418

Open
3 tasks done
AMAZONGSANG opened this issue Feb 18, 2025 · 11 comments
Open
3 tasks done

I can't build! (IDFGH-14674) #15418

AMAZONGSANG opened this issue Feb 18, 2025 · 11 comments
Labels
Status: Opened Issue is new Type: Bug bugs in IDF

Comments

@AMAZONGSANG
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

ESP-IDF v5.3.2-dirty

Operating System used.

Windows

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

PowerShell

What is the expected behavior?

I want to build my project

What is the actual behavior?

Compilation failure.
However, after the compilation fails, restart the computer and compile again to compile successfully
After the compilation fails, delete the "build" folder and restart the computer to compile again

Steps to reproduce.

I'm sorry, I don't know.And then one day it was compiled and it was like this

Build or installation Logs.

PS F:\ZZJ\zw\Firmware\zw-host> idf.py build
Executing action: all (aliases: build)
Running ninja in directory F:\ZZJ\zw\Firmware\zw-host\build
Executing "ninja all"...
[1/1] C:\WINDOWS\system32\cmd.exe /C "cd /D F:\ZZJ\zw\Firm...:/ZZJ/zw/Firmware/zw-host/build/bootloader/bootloader.bin"
Bootloader binary size 0x5a90 bytes. 0x2570 bytes (29%) free.
[4/8] Generating ld/sections.ld
FAILED: esp-idf/esp_system/ld/sections.ld F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_system/ld/sections.ld
esp-idf\esp_system\CMakeFiles\sections.ld-d65dc84.bat 40d683c3f21cac5e
Traceback (most recent call last):
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\core.py", line 850, in _parseNoCache
    loc, tokens = self.parseImpl(instring, pre_loc, do_actions)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\core.py", line 2470, in parseImpl
    if instring[loc] == self.firstMatchChar and instring.startswith(
       ~~~~~~~~^^^^^
IndexError: string index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 124, in add_sections_info
    results = parser.parseString(first_line, parseAll=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\util.py", line 376, in _inner
    return fn(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\core.py", line 1216, in parse_string
    raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected 'In archive'  (at char 0), (line:1, col:1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen.py", line 176, in <module>
    main()
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen.py", line 133, in main
    sections_infos.add_sections_info(dump)
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 126, in add_sections_info
    raise ParseException('Parsing sections info for library ' + sections_info_dump.name + ' failed. ' + p.msg)
pyparsing.exceptions.ParseException: Parsing sections info for library F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_common/libesp_common.a failed. Expected 'In archive'  (at char 0), (line:1, col:1)
Batch file failed at line 3 with errorcode 1
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the F:\ZZJ\zw\Firmware\zw-host\build\log\idf_py_stderr_output_9156 and F:\ZZJ\zw\Firmware\zw-host\build\log\idf_py_stdout_output_9156

More Information.

I have downloaded other versions of idf, but none of them worked

@AMAZONGSANG AMAZONGSANG added the Type: Bug bugs in IDF label Feb 18, 2025
@github-actions github-actions bot changed the title I can't build! I can't build! (IDFGH-14674) Feb 18, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 18, 2025
@fhrbata
Copy link
Collaborator

fhrbata commented Feb 18, 2025

Hello @AMAZONGSANG ,

it looks like an issue with the objdump output, possibly same as reported in #10440. It would be helpful to know the arguments passed to ldgen.py, particularly the --objdump argument. You might try running idf.py -v build in verbose mode to see how ldgen.py is executed. Hopefully, you should see it in the output before the error occurs.

Thank you

@AMAZONGSANG
Copy link
Author

I have learned about the #10440 issue, but unfortunately I don't understand it very well, and it is mac, I am not sure how to solve it on Windows

Here is the log I obtained using the "idf.py -v build" command

PS F:\ZZJ\zw\Firmware\zw-host> idf.py -v build
Checking Python dependencies...
Python requirements are satisfied.
Constraint file: D:\ESP32\Espressif\espidf.constraints.v5.3.txt
Requirement files:
 - D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\requirements\requirements.core.txt
Python being checked: D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Scripts\python.exe
Checking used Python interpreter...
Executing action: all (aliases: build)
Running ninja in directory F:\ZZJ\zw\Firmware\zw-host\build
Executing "ninja -v all"...
[1/9] esp-idf\esp_system\CMakeFiles\sections.ld-d65dc84.bat 40d683c3f21cac5e
FAILED: esp-idf/esp_system/ld/sections.ld F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_system/ld/sections.ld
esp-idf\esp_system\CMakeFiles\sections.ld-d65dc84.bat 40d683c3f21cac5e
Traceback (most recent call last):
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\core.py", line 850, in _parseNoCache
    loc, tokens = self.parseImpl(instring, pre_loc, do_actions)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\core.py", line 2470, in parseImpl
    if instring[loc] == self.firstMatchChar and instring.startswith(
       ~~~~~~~~^^^^^
IndexError: string index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 124, in add_sections_info
    results = parser.parseString(first_line, parseAll=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\util.py", line 376, in _inner
    return fn(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\core.py", line 1216, in parse_string
    raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected 'In archive'  (at char 0), (line:1, col:1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen.py", line 176, in <module>
    main()
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen.py", line 133, in main
    sections_infos.add_sections_info(dump)
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 126, in add_sections_info
    raise ParseException('Parsing sections info for library ' + sections_info_dump.name + ' failed. ' + p.msg)
pyparsing.exceptions.ParseException: Parsing sections info for library F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_app_format/libesp_app_format.a failed. Expected 'In archive'  (at char 0), (line:1, col:1)
Batch file failed at line 3 with errorcode 1
[2/9] C:\WINDOWS\system32\cmd.exe /C "cd /D F:\ZZJ\zw\Firmware\zw-host\build\bootloader && D:\ESP32\Espressif\tools\cmake\3.30.2\bin\cmake.exe -DSDKCONFIG=F:/ZZJ/zw/Firmware/zw-host/sdkconfig -DIDF_PATH=D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2 -DIDF_TARGET=esp32s3 -DPYTHON_DEPS_CHECKED=1 -DPYTHON=D:/ESP32/Espressif/python_env/idf5.3_py3.11_env/Scripts/python.exe -DEXTRA_COMPONENT_DIRS=D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/bootloader -DPROJECT_SOURCE_DIR=F:/ZZJ/zw/Firmware/zw-host -DIGNORE_EXTRA_COMPONENT= -GNinja -S D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/bootloader/subproject -B F:/ZZJ/zw/Firmware/zw-host/build/bootloader && D:\ESP32\Espressif\tools\cmake\3.30.2\bin\cmake.exe -E touch F:/ZZJ/zw/Firmware/zw-host/build/bootloader-prefix/src/bootloader-stamp/bootloader-configure"
FAILED: bootloader-prefix/src/bootloader-stamp/bootloader-configure F:/ZZJ/zw/Firmware/zw-host/build/bootloader-prefix/src/bootloader-stamp/bootloader-configure
C:\WINDOWS\system32\cmd.exe /C "cd /D F:\ZZJ\zw\Firmware\zw-host\build\bootloader && D:\ESP32\Espressif\tools\cmake\3.30.2\bin\cmake.exe -DSDKCONFIG=F:/ZZJ/zw/Firmware/zw-host/sdkconfig -DIDF_PATH=D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2 -DIDF_TARGET=esp32s3 -DPYTHON_DEPS_CHECKED=1 -DPYTHON=D:/ESP32/Espressif/python_env/idf5.3_py3.11_env/Scripts/python.exe -DEXTRA_COMPONENT_DIRS=D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/bootloader -DPROJECT_SOURCE_DIR=F:/ZZJ/zw/Firmware/zw-host -DIGNORE_EXTRA_COMPONENT= -GNinja -S D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/bootloader/subproject -B F:/ZZJ/zw/Firmware/zw-host/build/bootloader && D:\ESP32\Espressif\tools\cmake\3.30.2\bin\cmake.exe -E touch F:/ZZJ/zw/Firmware/zw-host/build/bootloader-prefix/src/bootloader-stamp/bootloader-configure"
-- git rev-parse returned 'fatal: detected dubious ownership in repository at 'D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2'
'D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2' is owned by:
        BUILTIN/Administrators (S-1-5-32-544)
but the current user is:
        DESKTOP-2AN6RV4/PC (S-1-5-21-138969761-3891255532-4185153907-1001)
To add an exception for this directory, call:

        git config --global --add safe.directory D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2'
fatal: detected dubious ownership in repository at 'D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2'
'D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2' is owned by:
        BUILTIN/Administrators (S-1-5-32-544)
but the current user is:
        DESKTOP-2AN6RV4/PC (S-1-5-21-138969761-3891255532-4185153907-1001)
To add an exception for this directory, call:

        git config --global --add safe.directory D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2
-- git rev-parse returned 'fatal: detected dubious ownership in repository at 'D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2'
'D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2' is owned by:
        BUILTIN/Administrators (S-1-5-32-544)
but the current user is:
        DESKTOP-2AN6RV4/PC (S-1-5-21-138969761-3891255532-4185153907-1001)
To add an exception for this directory, call:

        git config --global --add safe.directory D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2'
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s3
-- Project sdkconfig file F:/ZZJ/zw/Firmware/zw-host/sdkconfig
-- Compiler supported targets: xtensa-esp-elf
CMake Error at D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/tools/cmake/tool_version_check.cmake:36 (message):


  Tool doesn't match supported version from list ['esp-13.2.0_20240530']:
  D:/ESP32/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc.exe


  Please try to run 'idf.py fullclean' to solve it.

Call Stack (most recent call first):
  D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_common/project_include.cmake:10 (check_expected_tool_version)
  D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/tools/cmake/build.cmake:400 (include)
  D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/tools/cmake/build.cmake:632 (__build_process_project_includes)
  D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/tools/cmake/project.cmake:710 (idf_build_process)
  CMakeLists.txt:66 (project)


-- Configuring incomplete, errors occurred!
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the F:\ZZJ\zw\Firmware\zw-host\build\log\idf_py_stderr_output_18064 and F:\ZZJ\zw\Firmware\zw-host\build\log\idf_py_stdout_output_18064

Run the "idf.py -v build" command again to obtain logs after the "idf.py fullclean" command is used

PS F:\ZZJ\zw\Firmware\zw-host> idf.py -v build
Checking Python dependencies...
Python requirements are satisfied.
Constraint file: D:\ESP32\Espressif\espidf.constraints.v5.3.txt
Requirement files:
 - D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\requirements\requirements.core.txt
Python being checked: D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Scripts\python.exe
Checking used Python interpreter...
Executing action: all (aliases: build)
Running ninja in directory F:\ZZJ\zw\Firmware\zw-host\build
Executing "ninja -v all"...
[1/8] C:\WINDOWS\system32\cmd.exe /C "cd /D F:\ZZJ\zw\Firmware\zw-host\build\bootloader && D:\ESP32\Espressif\tools\cmake\3.30.2\bin\cmake.exe --build ."
[1/1] C:\WINDOWS\system32\cmd.exe /C "cd /D F:\ZZJ\zw\Firmware\zw-host\build\bootloader\esp-idf\esptool_py && D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Scripts\python.exe D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 F:/ZZJ/zw/Firmware/zw-host/build/bootloader/bootloader.bin"
Bootloader binary size 0x5a90 bytes. 0x2570 bytes (29%) free.
[2/8] C:\WINDOWS\system32\cmd.exe /C "cd /D F:\ZZJ\zw\Firmware\zw-host\build\bootloader && D:\ESP32\Espressif\tools\cmake\3.30.2\bin\cmake.exe -E echo_append"
[3/8] C:\WINDOWS\system32\cmd.exe /C "cd /D F:\ZZJ\zw\Firmware\zw-host\build && D:\ESP32\Espressif\tools\cmake\3.30.2\bin\cmake.exe -E make_directory F:/ZZJ/zw/Firmware/zw-host/build/CMakeFiles && D:\ESP32\Espressif\tools\cmake\3.30.2\bin\cmake.exe -E touch F:/ZZJ/zw/Firmware/zw-host/build/CMakeFiles/bootloader-complete && D:\ESP32\Espressif\tools\cmake\3.30.2\bin\cmake.exe -E touch F:/ZZJ/zw/Firmware/zw-host/build/bootloader-prefix/src/bootloader-stamp/bootloader-done"
[4/8] esp-idf\esp_system\CMakeFiles\sections.ld-d65dc84.bat 40d683c3f21cac5e
FAILED: esp-idf/esp_system/ld/sections.ld F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_system/ld/sections.ld
esp-idf\esp_system\CMakeFiles\sections.ld-d65dc84.bat 40d683c3f21cac5e
Traceback (most recent call last):
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\core.py", line 850, in _parseNoCache
    loc, tokens = self.parseImpl(instring, pre_loc, do_actions)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\core.py", line 2470, in parseImpl
    if instring[loc] == self.firstMatchChar and instring.startswith(
       ~~~~~~~~^^^^^
IndexError: string index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 124, in add_sections_info
    results = parser.parseString(first_line, parseAll=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\util.py", line 376, in _inner
    return fn(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\core.py", line 1216, in parse_string
    raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected 'In archive'  (at char 0), (line:1, col:1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen.py", line 176, in <module>
    main()
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen.py", line 133, in main
    sections_infos.add_sections_info(dump)
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 126, in add_sections_info
    raise ParseException('Parsing sections info for library ' + sections_info_dump.name + ' failed. ' + p.msg)
pyparsing.exceptions.ParseException: Parsing sections info for library F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_common/libesp_common.a failed. Expected 'In archive'  (at char 0), (line:1, col:1)
Batch file failed at line 3 with errorcode 1
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the F:\ZZJ\zw\Firmware\zw-host\build\log\idf_py_stderr_output_20152 and F:\ZZJ\zw\Firmware\zw-host\build\log\idf_py_stdout_output_20152

@AMAZONGSANG
Copy link
Author

Oh!I think of one thing, after using the Windows11 installation assistant, I waited a few days to compile, is this problem related to this step? If so, how do I restore to the original system environment?

@AMAZONGSANG
Copy link
Author

I'm sorry I ordered it wrong

@AMAZONGSANG AMAZONGSANG reopened this Feb 19, 2025
@fhrbata
Copy link
Collaborator

fhrbata commented Feb 19, 2025

Hello @AMAZONGSANG ,

I have learned about the #10440 issue, but unfortunately I don't understand it very well, and it is mac, I am not sure how to solve it on Windows

Yes, it was reported for Mac, but the issue seems quite similar. The problem appears to be that ldgen.py cannot parse the output from objdump, although I might have overlooked something.

Thank you for the output. I'm sorry, I overlooked that CMake on Windows might wrap the command in a batch file, possibly due to command line length limitations. Therefore, the full ldgen command should be in the sections.ld-d65dc84.bat file. Could you please either attach the file F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_system/ld/sections.ld esp-idf\esp_system\CMakeFiles\sections.ld-d65dc84.bat or paste its contents here?

Oh!I think of one thing, after using the Windows11 installation assistant, I waited a few days to compile, is this problem related to this step? If so, how do I restore to the original system environment?

For Windows, I would recommend using either the online or offline installer as described here https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/windows-setup.html. This should set up everything required for the ESP-IDF environment. I suspect there might be an issue with the ESP-IDF installation or environment.

Thank you

@AMAZONGSANG
Copy link
Author

Hello @fhrbata ,
thank you for your kindness,Here are my files sections.ld

/*

 * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD

 *

 * SPDX-License-Identifier: Apache-2.0

 */
/*

 * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD

 *

 * SPDX-License-Identifier: Apache-2.0

 */
/*

 * Automatically generated file. DO NOT EDIT.

 * Espressif IoT Development Framework (ESP-IDF) 5.3.2 Configuration Header

 */
       
/* List of deprecated options */
/* CPU instruction prefetch padding size for flash mmap scenario */
/*

 * PMP region granularity size

 * Software may determine the PMP granularity by writing zero to pmp0cfg, then writing all ones

 * to pmpaddr0, then reading back pmpaddr0. If G is the index of the least-significant bit set,

 * the PMP granularity is 2^G+2 bytes.

 */
/* CPU instruction prefetch padding size for memory protection scenario */
/* Memory alignment size for PMS */
    /* rtc timer data (s_rtc_timer_retain_mem, see esp_clk.c files). For rtc_timer_data_in_rtc_mem section. */
/* Default entry point */
ENTRY(call_start_cpu0);
SECTIONS
{
  /**

   * RTC fast memory holds RTC wake stub code,

   * including from any source file named rtc_wake_stub*.c

   */
  .rtc.text :
  {
    
 . = ALIGN(4); 
 _rtc_fast_start = ABSOLUTE(.);
    
 . = ALIGN(4); 
 _rtc_text_start = ABSOLUTE(.);
    *(.rtc.entry.literal .rtc.entry.text)
    mapping[rtc_text]
    *rtc_wake_stub*.*(.literal .text .literal.* .text.*)
    *(.rtc_text_end_test)
    /* Padding for possible CPU prefetch + alignment for PMS split lines */
    . += 16;
    . = ALIGN(256);
    _rtc_text_end = ABSOLUTE(.);
  } > rtc_iram_seg
  /**

   * This section located in RTC FAST Memory area.

   * It holds data marked with RTC_FAST_ATTR attribute.

   * See the file "esp_attr.h" for more information.

   */
  .rtc.force_fast :
  {
    
 . = ALIGN(4); 
 _rtc_force_fast_start = ABSOLUTE(.);
    mapping[rtc_force_fast]
    *(.rtc.force_fast .rtc.force_fast.*)
    
 . = ALIGN(4); 
 _rtc_force_fast_end = ABSOLUTE(.);
  } > rtc_data_seg
  /**

   * RTC data section holds RTC wake stub

   * data/rodata, including from any source file

   * named rtc_wake_stub*.c and the data marked with

   * RTC_DATA_ATTR, RTC_RODATA_ATTR attributes.

   * The memory location of the data is dependent on

   * CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM option.

   */
  .rtc.data :
  {
    _rtc_data_start = ABSOLUTE(.);
    mapping[rtc_data]
    *rtc_wake_stub*.*(.data .rodata .data.* .rodata.*)
    _rtc_data_end = ABSOLUTE(.);
  } > rtc_data_location
  /* RTC bss, from any source file named rtc_wake_stub*.c */
  .rtc.bss (NOLOAD) :
  {
    _rtc_bss_start = ABSOLUTE(.);
    *rtc_wake_stub*.*(.bss .bss.*)
    *rtc_wake_stub*.*(COMMON)
    mapping[rtc_bss]
    _rtc_bss_end = ABSOLUTE(.);
  } > rtc_data_location
  /**

   * This section holds data that should not be initialized at power up

   * and will be retained during deep sleep.

   * User data marked with RTC_NOINIT_ATTR will be placed

   * into this section. See the file "esp_attr.h" for more information.

   * The memory location of the data is dependent on

   * CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM option.

   */
  .rtc_noinit (NOLOAD):
  {
    
 . = ALIGN(4); 
 _rtc_noinit_start = ABSOLUTE(.);
    *(.rtc_noinit .rtc_noinit.*)
    
 . = ALIGN(4); 
 _rtc_noinit_end = ABSOLUTE(.);
  } > rtc_data_location
  /**

   * This section located in RTC SLOW Memory area.

   * It holds data marked with RTC_SLOW_ATTR attribute.

   * See the file "esp_attr.h" for more information.

   */
  .rtc.force_slow :
  {
    
 . = ALIGN(4); 
 _rtc_force_slow_start = ABSOLUTE(.);
    *(.rtc.force_slow .rtc.force_slow.*)
    
 . = ALIGN(4); 
 _rtc_force_slow_end = ABSOLUTE(.);
  } > rtc_slow_seg
  /**

   * This section holds RTC data that should have fixed addresses.

   * The data are not initialized at power-up and are retained during deep

   * sleep.

   */
  .rtc_reserved (NOLOAD):
  {
    
 . = ALIGN(4); 
 _rtc_reserved_start = ABSOLUTE(.);
    /**

     * New data can only be added here to ensure existing data are not moved.

     * Because data have adhered to the end of the segment and code is relied

     * on it.

     * >> put new data here <<

     */
    *(.rtc_timer_data_in_rtc_mem .rtc_timer_data_in_rtc_mem.*)
    KEEP(*(.bootloader_data_rtc_mem .bootloader_data_rtc_mem.*))
    _rtc_reserved_end = ABSOLUTE(.);
  } > rtc_reserved_seg
  _rtc_reserved_length = _rtc_reserved_end - _rtc_reserved_start;
  ASSERT((_rtc_reserved_length <= LENGTH(rtc_reserved_seg)),
          "RTC reserved segment data does not fit.")
  /* Get size of rtc slow data based on rtc_data_location alias */
  _rtc_slow_length = (ORIGIN(rtc_slow_seg) == ORIGIN(rtc_data_location))
                        ? (_rtc_force_slow_end - _rtc_data_start)
                        : (_rtc_force_slow_end - _rtc_force_slow_start);
  _rtc_fast_length = (ORIGIN(rtc_slow_seg) == ORIGIN(rtc_data_location))
                        ? (_rtc_force_fast_end - _rtc_fast_start)
                        : (_rtc_noinit_end - _rtc_fast_start);
  ASSERT((_rtc_slow_length <= LENGTH(rtc_slow_seg)),
          "RTC_SLOW segment data does not fit.")
  ASSERT((_rtc_fast_length <= LENGTH(rtc_data_seg)),
          "RTC_FAST segment data does not fit.")
  /* Send .iram0 code to iram */
  .iram0.vectors :
  {
    _iram_start = ABSOLUTE(.);
    /* Vectors go to IRAM */
    _vector_table = ABSOLUTE(.);
    . = 0x0;
    KEEP(*(.WindowVectors.text));
    . = 0x180;
    KEEP(*(.Level2InterruptVector.text));
    . = 0x1c0;
    KEEP(*(.Level3InterruptVector.text));
    . = 0x200;
    KEEP(*(.Level4InterruptVector.text));
    . = 0x240;
    KEEP(*(.Level5InterruptVector.text));
    . = 0x280;
    KEEP(*(.DebugExceptionVector.text));
    . = 0x2c0;
    KEEP(*(.NMIExceptionVector.text));
    . = 0x300;
    KEEP(*(.KernelExceptionVector.text));
    . = 0x340;
    KEEP(*(.UserExceptionVector.text));
    . = 0x3C0;
    KEEP(*(.DoubleExceptionVector.text));
    . = 0x400;
    _invalid_pc_placeholder = ABSOLUTE(.);
    *(.*Vector.literal)
    *(.UserEnter.literal);
    *(.UserEnter.text);
    . = ALIGN (16);
    *(.entry.literal)
    *(.entry.text)
    *(.init.literal)
    *(.init)
    _init_end = ABSOLUTE(.);
  } > iram0_0_seg
  .iram0.text :
  {
    /* Code marked as running out of IRAM */
    _iram_text_start = ABSOLUTE(.);
    mapping[iram0_text]
  } > iram0_0_seg
  /**

   * This section is required to skip .iram0.text area because iram0_0_seg and

   * dram0_0_seg reflect the same address space on different buses.

   */
  .dram0.dummy (NOLOAD):
  {
    . = ORIGIN(dram0_0_seg) + MAX(_iram_end - _diram_i_start, 0);
  } > dram0_0_seg
  .dram0.data :
  {
    _data_start = ABSOLUTE(.);
    *(.gnu.linkonce.d.*)
    *(.data1)
    *(.sdata)
    *(.sdata.*)
    *(.gnu.linkonce.s.*)
    *(.gnu.linkonce.s2.*)
    *(.jcr)
    mapping[dram0_data]
    _data_end = ABSOLUTE(.);
  } > dram0_0_seg
  /**

   * This section holds data that should not be initialized at power up.

   * The section located in Internal SRAM memory region. The macro _NOINIT

   * can be used as attribute to place data into this section.

   * See the "esp_attr.h" file for more information.

   */
  .noinit (NOLOAD):
  {
    
 . = ALIGN(4); 
 _noinit_start = ABSOLUTE(.);
    *(.noinit .noinit.*)
    
 . = ALIGN(4); 
 _noinit_end = ABSOLUTE(.);
  } > dram0_0_seg
  /* Shared RAM */
  .dram0.bss (NOLOAD) :
  {
    
 . = ALIGN(8); 
 _bss_start = ABSOLUTE(.);
    /**

     * ldgen places all bss-related data to mapping[dram0_bss]

     * (See components/esp_system/app.lf).

     */
    mapping[dram0_bss]
    
 . = ALIGN(8); 
 _bss_end = ABSOLUTE(.);
  } > dram0_0_seg
  ASSERT(((_bss_end - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)),
         "DRAM segment data does not fit.")
  .flash.text :
  {
    _stext = .;
    /**

     * Mark the start of flash.text.

     * This can be used by the MMU driver to maintain the virtual address.

     */
    _instruction_reserved_start = ABSOLUTE(.);
    _text_start = ABSOLUTE(.);
    mapping[flash_text]
    *(.stub)
    *(.gnu.warning)
    *(.gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
    *(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */
    /**

     * CPU will try to prefetch up to 16 bytes of of instructions.

     * This means that any configuration (e.g. MMU, PMS) must allow

     * safe access to up to 16 bytes after the last real instruction, add

     * dummy bytes to ensure this

     */
    . += 16;
    _text_end = ABSOLUTE(.);
    /**

     * Mark the flash.text end.

     * This can be used for MMU driver to maintain virtual address.

     */
    _instruction_reserved_end = ABSOLUTE(.);
    _etext = .;
    /**

     * Similar to _iram_start, this symbol goes here so it is

     * resolved by addr2line in preference to the first symbol in

     * the flash.text segment.

     */
    _flash_cache_start = ABSOLUTE(0);
  } > default_code_seg
  /**

   * Dummy section represents the .flash.text section but in default_rodata_seg.

   * Thus, it must have its alignment and (at least) its size.

   */
  .flash_rodata_dummy (NOLOAD):
  {
    _flash_rodata_dummy_start = ABSOLUTE(.);
    . = ALIGN(ALIGNOF(.flash.text)) + SIZEOF(.flash.text);
    /* Add alignment of MMU page size + 0x20 bytes for the mapping header. */
    . = ALIGN(0x10000) + 0x20;
  } > default_rodata_seg
  .flash.appdesc : ALIGN(0x10)
  {
    /**

     * Mark flash.rodata start.

     * This can be used for mmu driver to maintain virtual address

     */
    _rodata_reserved_start = ABSOLUTE(.);
    _rodata_start = ABSOLUTE(.);
    /* !DO NOT PUT ANYTHING BEFORE THIS! */
    /* Should be the first.  App version info. */
    *(.rodata_desc .rodata_desc.*)
    /* Should be the second. Custom app version info. */
    *(.rodata_custom_desc .rodata_custom_desc.*)
    /**

     * Create an empty gap within this section. Thanks to this, the end of this

     * section will match .flah.rodata's begin address. Thus, both sections

     * will be merged when creating the final bin image.

     */
    . = ALIGN(ALIGNOF(.flash.rodata));
  } > default_rodata_seg
  ASSERT((ADDR(.flash.rodata) == ADDR(.flash.appdesc) + SIZEOF(.flash.appdesc)), "The gap between .flash.appdesc and .flash.rodata must not exist to produce the final bin image.")
  .flash.rodata : ALIGN(0x10)
  {
    _flash_rodata_start = ABSOLUTE(.);
    mapping[flash_rodata]
    *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */
    *(.gnu.linkonce.r.*)
    *(.rodata1)
    /* C++ exception handlers table. */
    
 . = ALIGN(4); 
 __XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
    *(.xt_except_table)
    *(.gcc_except_table .gcc_except_table.*)
    *(.gnu.linkonce.e.*)
    
 . = ALIGN(4); 
 __XT_EXCEPTION_DESCS_ = ABSOLUTE(.);
    *(.xt_except_desc)
    *(.gnu.linkonce.h.*)
    __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
    *(.xt_except_desc_end)
    /**

     * C++ constructor tables.

     *

     * Excluding crtbegin.o/crtend.o since IDF doesn't use the toolchain crt.

     */
    
 . = ALIGN(4); 
 __init_array_start = ABSOLUTE(.);
    KEEP (*(EXCLUDE_FILE (*crtend.* *crtbegin.*) .ctors SORT(.ctors.*)))
    __init_array_end = ABSOLUTE(.);
    /* Addresses of memory regions reserved via SOC_RESERVE_MEMORY_REGION() */
    
 . = ALIGN(4); 
 soc_reserved_memory_region_start = ABSOLUTE(.);
    KEEP (*(.reserved_memory_address))
    soc_reserved_memory_region_end = ABSOLUTE(.);
    /* System init functions registered via ESP_SYSTEM_INIT_FN */
    
 . = ALIGN(4); 
 _esp_system_init_fn_array_start = ABSOLUTE(.);
    KEEP (*(SORT_BY_INIT_PRIORITY(.esp_system_init_fn.*)))
    _esp_system_init_fn_array_end = ABSOLUTE(.);
    _rodata_end = ABSOLUTE(.);
    /* Literals are also RO data. */
    _lit4_start = ABSOLUTE(.);
    *(*.lit4)
    *(.lit4.*)
    *(.gnu.linkonce.lit4.*)
    _lit4_end = ABSOLUTE(.);
    /* TLS data. */
    
 . = ALIGN(4); 
 _thread_local_start = ABSOLUTE(.);
    *(.tdata)
    *(.tdata.*)
    *(.tbss)
    *(.tbss.*)
    _thread_local_end = ABSOLUTE(.);
  } > default_rodata_seg
  _flash_rodata_align = ALIGNOF(.flash.rodata);
  /**

   * This section contains all the rodata that is not used

   * at runtime, helping to avoid an increase in binary size.

   */
  .flash.rodata_noload (NOLOAD) :
  {
    /**

     * This symbol marks the end of flash.rodata. It can be utilized by the MMU

     * driver to maintain the virtual address.

     * NOLOAD rodata may not be included in this section.

     */
    _rodata_reserved_end = ABSOLUTE(.);
    mapping[rodata_noload]
  } > default_rodata_seg
  /**

   * Dummy section to skip flash rodata sections.

   * Because to `extern_ram_seg` and `drom0_0_seg` are on the same bus

   */
  .ext_ram.dummy (NOLOAD):
  {
    . = ORIGIN(extern_ram_seg);
    . = . + (_rodata_reserved_end - _flash_rodata_dummy_start);
    . = ALIGN (0x10000);
  } > extern_ram_seg
  /* Marks the end of IRAM code segment */
  .iram0.text_end (NOLOAD) :
  {
    /* Padding for possible CPU prefetch + alignment for PMS split lines */
    . += 16;
    . = ALIGN(256);
    /* iram_end_test section exists for use by memprot unit tests only */
    *(.iram_end_test)
    _iram_text_end = ABSOLUTE(.);
  } > iram0_0_seg
  .iram0.data :
  {
    
 . = ALIGN(4); 
 _iram_data_start = ABSOLUTE(.);
    mapping[iram0_data]
    
 . = ALIGN(4); 
 _iram_data_end = ABSOLUTE(.);
  } > iram0_0_seg
  .iram0.bss (NOLOAD) :
  {
    
 . = ALIGN(4); 
 _iram_bss_start = ABSOLUTE(.);
    mapping[iram0_bss]
    _iram_bss_end = ABSOLUTE(.);
    
 . = ALIGN(4); 
 _iram_end = ABSOLUTE(.);
  } > iram0_0_seg
  /* Marks the end of data, bss and possibly rodata  */
  .dram0.heap_start (NOLOAD) :
  {
    /* Lowest possible start address for the heap */
    
 . = ALIGN(8); 
 _heap_low_start = ABSOLUTE(.);
  } > dram0_0_seg
  /* DWARF 1 */
  .debug 0 : { *(.debug) }
  .line 0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo 0 : { *(.debug_srcinfo) }
  .debug_sfnames 0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges 0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev 0 : { *(.debug_abbrev) }
  .debug_line 0 : { *(.debug_line) }
  .debug_frame 0 : { *(.debug_frame) }
  .debug_str 0 : { *(.debug_str) }
  .debug_loc 0 : { *(.debug_loc) }
  .debug_macinfo 0 : { *(.debug_macinfo) }
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  /* DWARF 3 */
  .debug_ranges 0 : { *(.debug_ranges) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames 0 : { *(.debug_varnames) }
  /* GNU DWARF 2 extensions */
  .debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
  .debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
  /* DWARF 4 */
  .debug_types 0 : { *(.debug_types) }
  /* DWARF 5 */
  .debug_addr 0 : { *(.debug_addr) }
  .debug_line_str 0 : { *(.debug_line_str) }
  .debug_loclists 0 : { *(.debug_loclists) }
  .debug_macro 0 : { *(.debug_macro) }
  .debug_names 0 : { *(.debug_names) }
  .debug_rnglists 0 : { *(.debug_rnglists) }
  .debug_str_offsets 0 : { *(.debug_str_offsets) }
  .comment 0 : { *(.comment) }
  .note.GNU-stack 0: { *(.note.GNU-stack) }
/**

 * .xt.prop and .xt.lit sections will be used by the debugger and disassembler

 * to get more information about raw data present in the code.

 * Indeed, it may be required to add some padding at some points in the code

 * in order to align a branch/jump destination on a particular bound.

 * Padding these instructions will generate null bytes that shall be

 * interpreted as data, and not code by the debugger or disassembler.

 * This section will only be present in the ELF file, not in the final binary

 * For more details, check GCC-212

 */
  .xtensa.info 0: { *(.xtensa.info) }
  .xt.prop 0 : { *(.xt.prop .xt.prop.* .gnu.linkonce.prop.*) }
  .xt.lit 0 : { *(.xt.lit .xt.lit.* .gnu.linkonce.p.*) }
  /DISCARD/ :
  {
   *(.fini)
   *(.eh_frame_hdr)
   *(.eh_frame)
  }
}
ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),
          "IRAM0 segment data does not fit.")
ASSERT(((_heap_low_start - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)),
          "DRAM segment data does not fit.")

and sections.ld-d65dc84.bat

Traceback (most recent call last):
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 152, in _get_infos_from_file
    results = parser.parseString(info.content, parseAll=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\util.py", line 376, in _inner
    return fn(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Lib\site-packages\pyparsing\core.py", line 1216, in parse_string
    raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected end of text, found 'log'  (at char 8231), (line:138, col:1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen.py", line 176, in <module>
    main()
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen.py", line 152, in main
    mapping_rules = generation_model.generate(sections_infos, non_contiguous_sram)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\generation.py", line 522, in generate
    root_node.insert(entity, sections, target, flags, entities)
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\generation.py", line 249, in insert
    self.child_placement(entity, sections, target, flags, sections_db)
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\generation.py", line 241, in child_placement
    child.insert(entity, sections, target, flags, sections_db)
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\generation.py", line 249, in insert
    self.child_placement(entity, sections, target, flags, sections_db)
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\generation.py", line 241, in child_placement
    child.insert(entity, sections, target, flags, sections_db)
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\generation.py", line 249, in insert
    self.child_placement(entity, sections, target, flags, sections_db)
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\generation.py", line 304, in child_placement
    found_sections = sections_db.get_sections(self.parent.name, self.name)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 198, in get_sections
    obj = self._match_obj(archive, obj)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 183, in _match_obj
    objs = self.get_objects(archive)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 176, in get_objects
    self._process_archive(archive)
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 164, in _process_archive
    parsed = self._get_infos_from_file(stored)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\ldgen\ldgen\entity.py", line 154, in _get_infos_from_file
    raise ParseException('Unable to parse section info file ' + info.filename + '. ' + p.msg)
pyparsing.exceptions.ParseException: Unable to parse section info file F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/log/liblog.a. Expected end of text  (at char 0), (line:1, col:1)
Batch file failed at line 3 with errorcode 1

[已退出进程,代码为 1 (0x00000001)]
现在可以使用Ctrl+D关闭此终端,或按 Enter 重新启动。

我的环境配置就是根据官网配置来的,但是不能进行编译
My environment configuration is based on the official website configuration, but can not be compiled
it troubles me too much.

@fhrbata
Copy link
Collaborator

fhrbata commented Feb 19, 2025

Hello @AMAZONGSANG ,

thank you for the additional information. It seems that you posted the output of the sections.ld-d65dc84.bat, not the actual content of the file. I rebooted to windows to take a closer look and tried with the hello_world example. For illustration here is how my build\esp-idf\esp_system\CMakeFiles\sections.ld-d65dc84.bat looks like for the hello_world example. It shows how the ldgen.py is invoked and what objdump command is passed to it with the --objdump option.

C:\Users\FrantisekHrbata\work\esp-idf\examples\get-started\hello_world>cat build\esp-idf\esp_system\CMakeFiles\sections.ld-d65dc84.bat
@echo off
cd /D C:\Users\FrantisekHrbata\work\esp-idf\examples\get-started\hello_world\build\esp-idf\esp_system || (set FAIL_LINE=2& goto :ABORT)
C:\Espressif\python_env\idf5.5_py3.11_env\Scripts\python.exe C:/Users/FrantisekHrbata/work/esp-idf/tools/ldgen/ldgen.py --config C:/Users/FrantisekHrbata/work/esp-idf/examples/get-started/hello_world/sdkconfig --fragments-list C:/Users/
FrantisekHrbata/work/esp-idf/components/xtensa/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_gpio/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_pm/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/
components/esp_mm/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/spi_flash/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_system/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_system/app.lf;C:
/Users/FrantisekHrbata/work/esp-idf/components/esp_common/common.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_common/soc.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_rom/linker.lf;C:/Users/FrantisekHrbata/work/esp-
idf/components/hal/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/log/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/heap/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/soc/linker.lf;C:/Users/Frantise
kHrbata/work/esp-idf/components/esp_hw_support/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_hw_support/dma/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_hw_support/ldo/linker.lf;C:/Users/FrantisekHrbat
a/work/esp-idf/components/esp_hw_support/mspi_timing_tuning/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/freertos/linker_common.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/freertos/linker.lf;C:/Users/FrantisekHrbat
a/work/esp-idf/components/newlib/src/newlib.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/newlib/src/system_libs.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_gptimer/linker.lf;C:/Users/FrantisekHrbata/work/esp-id
f/components/esp_ringbuf/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_uart/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/app_trace/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_even
t/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_phy/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_usb_serial_jtag/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/vfs/linker.lf;C:/Users
/FrantisekHrbata/work/esp-idf/components/lwip/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_netif/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/wpa_supplicant/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf
/components/esp_wifi/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_spi/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_pcnt/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_dri
ver_mcpwm/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_ana_cmpr/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_dac/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_rmt
/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_sdm/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_i2c/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_ledc/linker.lf;C:
/Users/FrantisekHrbata/work/esp-idf/components/esp_driver_parlio/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/driver/twai/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_adc/linker.lf;C:/Users/FrantisekHrbat
a/work/esp-idf/components/esp_driver_isp/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_eth/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_gdbstub/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/component
s/esp_psram/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/esp_lcd/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/espcoredump/linker.lf;C:/Users/FrantisekHrbata/work/esp-idf/components/ieee802154/linker.lf;C:/Use
rs/FrantisekHrbata/work/esp-idf/components/openthread/linker.lf --input C:/Users/FrantisekHrbata/work/esp-idf/examples/get-started/hello_world/build/esp-idf/esp_system/ld/sections.ld.in --output C:/Users/FrantisekHrbata/work/esp-idf/exa
mples/get-started/hello_world/build/esp-idf/esp_system/ld/sections.ld --kconfig C:/Users/FrantisekHrbata/work/esp-idf/Kconfig --env-file C:/Users/FrantisekHrbata/work/esp-idf/examples/get-started/hello_world/build/config.env --libraries
-file C:/Users/FrantisekHrbata/work/esp-idf/examples/get-started/hello_world/build/ldgen_libraries --objdump C:/Espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32-elf-objdump.exe || (set FAIL_LINE=3& goto
 :ABORT)
goto :EOF

:ABORT
set ERROR_CODE=%ERRORLEVEL%
echo Batch file failed at line %FAIL_LINE% with errorcode %ERRORLEVEL%
exit /b %ERROR_CODE%

My environment configuration is based on the official website configuration, but can not be compiled
it troubles me too much.

Were you able to successfully finish the installation with ESP-IDF Tools Installer as described here https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/windows-setup.html?

In one of outputs you posted, there is the following message, which might be related to your problem

Tool doesn't match supported version from list ['esp-13.2.0_20240530']:
D:/ESP32/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc.exe

IIUC you have the the esp-idf framework in D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2 directory. Please try to run the install and export scripts again. It might help with this problem or at least provide additional info if something is wrong with your installation or environment.

D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\install.ps1
D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\export.ps1

There also seem to be another problem with the esp-idf repository ownership. Following is also from one of outputs you posted.

fatal: detected dubious ownership in repository at 'D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2'
'D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2' is owned by:
BUILTIN/Administrators (S-1-5-32-544)
but the current user is:
DESKTOP-2AN6RV4/PC (S-1-5-21-138969761-3891255532-4185153907-1001)
To add an exception for this directory, call:

   git config --global --add safe.directory D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2 

Thank you

@AMAZONGSANG
Copy link
Author

Hello @fhrbata ,
Thank you for your correction,I think this is what you want

PS F:\ZZJ\zw\Firmware\zw-host> cat build\esp-idf\esp_system\CMakeFiles\sections.ld-d65dc84.bat
@echo off
cd /D F:\ZZJ\zw\Firmware\zw-host\build\esp-idf\esp_system || (set FAIL_LINE=2& goto :ABORT)
D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Scripts\python.exe D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/tools/ldgen/ldgen.py --config F:/ZZJ/zw/Firmware/zw-host/sdkconfig --fragments-list D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/xtensa/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_gpio/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_pm/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_mm/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/spi_flash/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_system/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_system/app.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_common/common.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_common/soc.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_rom/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/hal/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/log/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/heap/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/soc/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_hw_support/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_hw_support/dma/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_hw_support/ldo/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/freertos/linker_common.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/freertos/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/newlib/newlib.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/newlib/system_libs.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_gptimer/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_ringbuf/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_uart/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/app_trace/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_event/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_pcnt/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_spi/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_mcpwm/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_ana_cmpr/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_dac/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_rmt/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_sdm/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_i2c/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_ledc/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_driver_parlio/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/driver/twai/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_phy/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/vfs/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/lwip/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_netif/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/wpa_supplicant/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_wifi/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_adc/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_eth/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_gdbstub/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_psram/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/esp_lcd/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/espcoredump/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/ieee802154/linker.lf;D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/components/openthread/linker.lf --input F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_system/ld/sections.ld.in --output F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_system/ld/sections.ld --kconfig D:/ESP32/Espressif/frameworks/esp-idf-v5.3.2/Kconfig --env-file F:/ZZJ/zw/Firmware/zw-host/build/config.env --libraries-file F:/ZZJ/zw/Firmware/zw-host/build/ldgen_libraries --objdump D:/ESP32/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-objdump.exe || (set FAIL_LINE=3& goto :ABORT)
goto :EOF

:ABORT
set ERROR_CODE=%ERRORLEVEL%
echo Batch file failed at line %FAIL_LINE% with errorcode %ERRORLEVEL%
exit /b %ERROR_CODE%

I installed the fourth package that appears on the following page, which is 5.3.2 -Offline Installer
https://[dl.espressif.com.cn/dl/esp-idf/?idf=4.4](https://dl.espressif.com.cn/dl/esp-idf/?idf=4.4)

After I execute this this instruction

D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\install.ps1
D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\export.ps1

The following log appears

PS F:\ZZJ\zw\Firmware\zw-host> D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\export.ps1
Setting IDF_PATH: D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2
Checking Python compatibility
Adding ESP-IDF tools to PATH...
WARNING: The following issue occurred while accessing the ESP-IDF version file in the Python environment: [Errno 2] No such file or directory: 'D:\\ESP32\\Espressif\\python_env\\idf5.3_py3.11_env\\idf_version.txt'. (Diagnostic information. It can be ignored.)

Name                           Value
----                           -----
IDF_DEACTIVATE_FILE_PATH       C:\Users\PC\AppData\Local\Temp\tmpqk8nypzkidf_21976
No directories added to PATH:
D:\ESP32\Espressif\tools\xtensa-esp-elf-gdb\14.2_20240403\xtensa-esp-elf-gdb\bin
D:\ESP32\Espressif\tools\riscv32-esp-elf-gdb\14.2_20240403\riscv32-esp-elf-gdb\bin
D:\ESP32\Espressif\tools\xtensa-esp-elf\esp-13.2.0_20240530\xtensa-esp-elf\bin
D:\ESP32\Espressif\tools\esp-clang\16.0.1-fe4f10a809\esp-clang\bin
D:\ESP32\Espressif\tools\riscv32-esp-elf\esp-13.2.0_20240530\riscv32-esp-elf\bin
D:\ESP32\Espressif\tools\esp32ulp-elf\2.38_20240113\esp32ulp-elf\bin
D:\ESP32\Espressif\tools\cmake\3.30.2\bin
D:\ESP32\Espressif\tools\openocd-esp32\v0.12.0-esp32-20241016\openocd-esp32\bin
D:\ESP32\Espressif\tools\ninja\1.12.1\
D:\ESP32\Espressif\tools\idf-exe\1.0.3\
D:\ESP32\Espressif\tools\ccache\4.10.2\ccache-4.10.2-windows-x86_64
D:\ESP32\Espressif\tools\dfu-util\0.11\dfu-util-0.11-win64
D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools
D:\ESP32\Espressif\tools\idf-git\2.44.0\cmd
D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Scripts
D:\ESP32\Espressif
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
C:\Program Files\dotnet\
F:\Git\cmd
C:\Users\PC\AppData\Local\Microsoft\WindowsApps
D:\VScode\Microsoft VS Code\bin
D:\VScode\MinGW\bin
D:\ESP32\Espressif\tools\idf-python\3.11.2\Scripts

Checking if Python packages are up to date...
Constraint file: D:\ESP32\Espressif\espidf.constraints.v5.3.txt
Requirement files:
 - D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\requirements\requirements.core.txt
Python being checked: D:\ESP32\Espressif\python_env\idf5.3_py3.11_env\Scripts\python.exe
Python requirements are satisfied.

Detected installed tools that are not currently used by active ESP-IDF version.
For removing old versions of idf-driver, idf-python-wheels use command 'python.exe D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\idf_tools.py uninstall'
For free up even more space, remove installation packages of those tools. Use option 'python.exe D:\ESP32\Espressif\frameworks\esp-idf-v5.3.2\tools\idf_tools.py uninstall --remove-archives'.


Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
    idf.py build

But I still get an error when I compile again
At the same time I ran instructions in Git Bash,The build result is the same

@fhrbata
Copy link
Collaborator

fhrbata commented Feb 19, 2025

Hello @AMAZONGSANG,

thank you for providing the additional information and assistance as we work to understand the issue.

It appears that ldgen.py is having trouble parsing the objdump output. The error message from your output:

pyparsing.exceptions.ParseException: Parsing sections info for library F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_common/libesp_common.a failed. Expected 'In archive'  (at char 0), (line:1, col:1)

Could you please run the following command to ensure the binary functions correctly in your environment and share the output?

D:/ESP32/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-objdump.exe --version

Additionally, please try this command. It might help us understand what objdump output is passed to ldgen for parsing:

D:/ESP32/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-objdump.exe -h F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_common/libesp_common.a

Thank you.

@AMAZONGSANG
Copy link
Author

hello @fhrbata,
Thank you for taking time out of your busy schedule to reply me
Here are the results I got using two commands

PS F:\ZZJ\zw\Firmware\zw-host> D:/ESP32/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-objdump.exe --version
GNU objdump (crosstool-NG esp-13.2.0_20240530) 2.41
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
PS F:\ZZJ\zw\Firmware\zw-host> D:/ESP32/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-objdump.exe -h F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_common/libesp_common.a
In archive F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_common/libesp_common.a:

esp_err_to_name.c.obj:     file format elf32-xtensa-le

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .literal.esp_err_to_name 00000008  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .literal.esp_err_to_name_r 00000018  00000000  00000000  0000003c  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  2 .text         00000000  00000000  00000000  00000054  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  3 .data         00000000  00000000  00000000  00000054  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  4 .bss          00000000  00000000  00000000  00000054  2**0
                  ALLOC
  5 .text.esp_err_to_name 00000027  00000000  00000000  00000054  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  6 .rodata.esp_err_to_name_r.str1.4 0000000c  00000000  00000000  0000007c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .text.esp_err_to_name_r 00000056  00000000  00000000  00000088  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  8 .rodata.esp_unknown_msg 00000006  00000000  00000000  000000e0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .rodata.str1.4 0000180a  00000000  00000000  000000e8  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .rodata.esp_err_msg_table 000006d0  00000000  00000000  000018f4  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
 11 .debug_frame  00000040  00000000  00000000  00001fc4  2**2
                  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
 12 .debug_info   000003b8  00000000  00000000  00002004  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
 13 .debug_abbrev 000001d9  00000000  00000000  000023bc  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
 14 .debug_loc    000000f2  00000000  00000000  00002595  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
 15 .debug_aranges 00000028  00000000  00000000  00002687  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
 16 .debug_ranges 00000018  00000000  00000000  000026af  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
 17 .debug_line   000004ad  00000000  00000000  000026c7  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
 18 .debug_str    000004f5  00000000  00000000  00002b74  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
 19 .comment      00000030  00000000  00000000  00003069  2**0
                  CONTENTS, READONLY
 20 .xtensa.info  00000038  00000000  00000000  00003099  2**0
                  CONTENTS, READONLY
 21 .xt.lit       00000010  00000000  00000000  000030d1  2**0
                  CONTENTS, RELOC, READONLY
 22 .xt.prop      000000cc  00000000  00000000  000030e1  2**0
                  CONTENTS, RELOC, READONLY

Thank you

@fhrbata
Copy link
Collaborator

fhrbata commented Feb 20, 2025

Hello @AMAZONGSANG ,

Thank you for taking time out of your busy schedule to reply me

You're very welcome! Though, unfortunately, I haven't been able to provide anything truly helpful for your issue so far. 😞

Here are the results I got using two commands

To be honest, I wasn't expecting this output since it looks correct. I was hoping to see something unusual that could help explain the behavior you're experiencing.

Based on your outputs, the failure doesn’t seem to be specific to a single library (libesp_common.a, libesp_app_format.a, liblog.a).

pyparsing.exceptions.ParseException: Expected 'In archive'  (at char 0), (line:1, col:1)
pyparsing.exceptions.ParseException: Parsing sections info for library F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_common/libesp_common.a failed. Expected 'In archive'  (at char 0), (line:1, col:1)
pyparsing.exceptions.ParseException: Expected 'In archive'  (at char 0), (line:1, col:1)
pyparsing.exceptions.ParseException: Parsing sections info for library F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/esp_app_format/libesp_app_format.a failed. Expected 'In archive'  (at char 0), (line:1, col:1)

The two snippets above, IIUC, mean that there was no output from the objdump passed to ldgen. Strange thing is that the objdump has not failed. If there was something wrong we would see different error like command not found, invalid argument(non-existing, empty or invalid format of the library). It just for some reason returns empty output or it's somehow discarded in the bat file or python, which I think is unlikely.

The following snipped means that there was some output, but ldgen was not able to parse it. The section parsing failed.

pyparsing.exceptions.ParseException: Expected end of text, found 'log'  (at char 8231), (line:138, col:1)
pyparsing.exceptions.ParseException: Unable to parse section info file F:/ZZJ/zw/Firmware/zw-host/build/esp-idf/log/liblog.a. Expected end of text  (at char 0), (line:1, col:1)

I tried to make sense of this, but I'm not sure how it could have happened. I guess there has to be something wrong with the installation. It's hard to say.

Tool doesn't match supported version from list ['esp-13.2.0_20240530']:
D:/ESP32/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc.exe

This means that the xtensa-esp32s3-elf-gcc.exe --version returns different version than supported for the activated esp-idf(esp-13.2.0_20240530 as defined in tools\tools.json) . Which is strange, because it is located in the esp-13.2.0_20240530 directory. It seems there might be some mismatch with toolchains.

I guess if this was a generic problem with ldgen, there would be more issues reported for this.

I would recommend a fresh ESP-IDF installation to rule out any issues that might be caused by a broken installation.
I installed v5.3.2 using both the online and offline installers on Windows 10.0.19045, and everything worked fine. I followed the default installation process but changed the destination directories for ESP-IDF and tools to ensure a completely fresh installation without any potential conflicts with existing setups. After installation, I used the provided PowerShell terminal, where ESP-IDF was activated, and successfully compiled hello_world for the ESP32-S3 target. You might want to try the same approach to see if it helps.

Oh!I think of one thing, after using the Windows11 installation assistant, I waited a few days to compile, is this problem related to this step? If so, how do I restore to the original system environment?

I'm not sure. I suppose it's possible but unlikely—but I'm not a Windows user and my experience with it is very limited.

Thank you very much for all the information you've provided. You can try a fresh install as described above to see if it helps. Apologies if I missed anything. Perhaps others may have additional insights into what might be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

3 participants