Issues: latest toolchain install on Windows

User avatar
drwill
Posts: 14
Joined: Mon Oct 28, 2019 10:01 pm

Issues: latest toolchain install on Windows

Postby drwill » Mon Oct 28, 2019 10:39 pm

I'm trying to get side-by-side stable and latest toolchains configured on my Windows 10 PC. I have stable working fine, in as much as I can run menuconfig and build/flash/monitor the hello_world app. For stable, I did not set any global environment variables - instead I set the values in the .bash_profile script. That way, none of the values would conflict with latest.

I'm having trouble with the latest toolchain installation, and I'm running into a problem running menuconfig in the hello_world sample (copied to another directory).

This is my second time through the installer, and I've worked through a few issues, but still run into this same error in menuconfig. Hopefully someone can help me work through this. I'll post relevant information below.

My local directories:
  • Root directory: c:\tools\esp32-latest, has folders dist, python_env, and tools (along with an esp directory that I added). Also has idf_cmd_init.bat and a few other files.
  • IDF_PATH: c:\tools\esp32-latest\esp\esp-idf (I chose v4 release in the installer).
  • IDF_TOOLS_PATH: c:\tools\esp32-latest (not set by me, including before installation)
  • c:\users\<me>\.espressif: contains dist, python_env, and tools folders.
menuconfig error:
c:\tools\esp32-latest\esp\hello_world>idf.py menuconfig
Checking Python dependencies...
Python requirements from c:\tools\esp32-latest\esp\esp-idf\requirements.txt are satisfied.
Executing action: menuconfig
Running cmake in directory c:\tools\esp32-latest\esp\hello_world\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized -DCCACHE_ENABLE=0 c:\tools\esp32-latest\esp\hello_world"...
Warn about uninitialized values.
CMake Warning at C:/tools/esp32-latest/esp/esp-idf/tools/cmake/idf.cmake:14 (message):
IDF_PATH environment variable is different from inferred IDF_PATH.

Check if your project's top-level CMakeLists.txt includes the right
CMake files. Environment IDF_PATH will be used for the build.
Call Stack (most recent call first):
C:/tools/esp32-latest/esp/esp-idf/tools/cmake/project.cmake:7 (include)
CMakeLists.txt:5 (include)


-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.23.0.windows.1")
-- mconf-idf version mconf-v4.6.0.0-idf-20190628-win32
-- IDF_TARGET not set, using default target: esp32
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/tools/esp32-latest/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/tools/esp32-latest/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/tools/esp32-latest/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe -- broken
CMake Error at C:/tools/esp32-latest/tools/cmake/3.13.4/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler

"C:/tools/esp32-latest/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/tools/esp32-latest/esp/hello_world/build/CMakeFiles/CMakeTmp

Run Build Command:"C:/tools/esp32-latest/tools/ninja/1.9.0/ninja.exe" "cmTC_214b0"
[1/2] Building C object CMakeFiles/cmTC_214b0.dir/testCCompiler.c.obj
[2/2] Linking C executable cmTC_214b0
FAILED: cmTC_214b0
cmd.exe /C "cd . && C:\tools\esp32-latest\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -mlongcalls -Wno-frame-address -nostdlib CMakeFiles/cmTC_214b0.dir/testCCompiler.c.obj -o cmTC_214b0 && cd ."
The system cannot find the path specified.
c:/tools/esp32-latest/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 00400054
ninja: build stopped: subcommand failed.




CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
C:/tools/esp32-latest/esp/esp-idf/tools/cmake/project.cmake:258 (__project)
CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "C:/tools/esp32-latest/esp/hello_world/build/CMakeFiles/CMakeOutput.log".
See also "C:/tools/esp32-latest/esp/hello_world/build/CMakeFiles/CMakeError.log".
cmake failed with exit code 1
I've attached the CMake*.log files.

Btw, here's the output when I start the console:
he system cannot find the path specified.
Using Python in C:\Python38\
Python 3.8.0
Using Git in C:\Program Files\Git\cmd\
git version 2.23.0.windows.1
Setting IDF_PATH: c:\tools\esp32-latest\esp\esp-idf

Adding ESP-IDF tools to PATH...
Not using an unsupported version of tool cmake found in PATH: 3.15.4.
c:\tools\esp32-latest\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin
c:\tools\esp32-latest\tools\esp32ulp-elf\2.28.51.20170517\esp32ulp-elf-binutils\bin
c:\tools\esp32-latest\tools\cmake\3.13.4\bin
c:\tools\esp32-latest\tools\openocd-esp32\v0.10.0-esp32-20190313\openocd-esp32\bin
c:\tools\esp32-latest\tools\mconf\v4.6.0.0-idf-20190628\
c:\tools\esp32-latest\tools\ninja\1.9.0\
c:\tools\esp32-latest\tools\idf-exe\1.0.1\
c:\tools\esp32-latest\tools\ccache\3.7\
c:\tools\esp32-latest\python_env\idf4.0_py3.8_env\Scripts
c:\tools\esp32-latest\esp\esp-idf\tools

Checking if Python packages are up to date...
Python requirements from c:\tools\esp32-latest\esp\esp-idf\requirements.txt are satisfied.

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

idf.py build
Attachments
CMakeOutput.log
(1.49 KiB) Downloaded 618 times
CMakeError.log
(933 Bytes) Downloaded 615 times

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Issues: latest toolchain install on Windows

Postby ESP_igrr » Tue Oct 29, 2019 6:40 am

Have you by any chance built the same project first with "stable" and then with "latest" IDF? If yes, please try deleting the build directory before switching versions. The following error indicates that something is wrong with the setting of IDF_PATH, and it may be because CMake caches this variable in CMakeCache.txt:

CMake Warning at C:/tools/esp32-latest/esp/esp-idf/tools/cmake/idf.cmake:14 (message):
IDF_PATH environment variable is different from inferred IDF_PATH.

Check if your project's top-level CMakeLists.txt includes the right
CMake files. Environment IDF_PATH will be used for the build.

User avatar
drwill
Posts: 14
Joined: Mon Oct 28, 2019 10:01 pm

Re: Issues: latest toolchain install on Windows

Postby drwill » Tue Oct 29, 2019 6:44 pm

Have you by any chance built the same project first with "stable" and then with "latest" IDF?
No, not the same project. I should have mentioned that my stable tool chain is installed at c:\tools\esp32-stable. It has it's own esp-idf repo clone (v3.3). From there I copied the hello_world sample to home/esp/hello_world.

So that is a technically a different project and folder from the "latest" tool chain folder.

That said, I deleted the build directory under latest's hello_world and tried again. I get the same error.

User avatar
drwill
Posts: 14
Joined: Mon Oct 28, 2019 10:01 pm

Re: Issues: latest toolchain install on Windows

Postby drwill » Tue Oct 29, 2019 10:09 pm

ESP_igrr wrote:
Tue Oct 29, 2019 6:40 am
CMake Warning at C:/tools/esp32-latest/esp/esp-idf/tools/cmake/idf.cmake:14 (message):
IDF_PATH environment variable is different from inferred IDF_PATH.
I edited tools\cmake\idf.cmake to spit out the values of idf_path and _idf_path to see how it was different. It looks like it is doing a case-sensitive comparison because the only difference is the case of my drive letter:
CMake Warning at C:/tools/esp32-latest/esp/esp-idf/tools/cmake/idf.cmake:14 (message):
IDF_PATH environment variable is different from inferred IDF_PATH.

Check if your project's top-level CMakeLists.txt includes the right
CMake files. Environment IDF_PATH will be used for the build.
c:/tools/esp32-latest/esp/esp-idf
C:/tools/esp32-latest/esp/esp-idf
Since that seems only to be a warning, I think the value of IDF_PATH is a misleading message. Windows is case-insensitive for file system paths so this difference shouldn't matter.

If I replace that idf.cmake code with the following to negate that, I get the following output.

Code: Select all

    # Environment IDF_PATH should match the inferred IDF_PATH. If not, warn the user.
    if(idf_path)
        string(TOLOWER "${idf_path}" idf_path_lower)
        string(TOLOWER "${_idf_path}" _idf_path_lower)

        if(NOT idf_path_lower STREQUAL _idf_path_lower)
            message(WARNING "IDF_PATH environment variable is different from inferred IDF_PATH.
                            Check if your project's top-level CMakeLists.txt includes the right
                            CMake files. Environment IDF_PATH will be used for the build.
                            ${idf_path}
                            ${_idf_path}")
        endif()
c:\tools\esp32-latest\esp\hello_world>idf.py menuconfig
Checking Python dependencies...
Python requirements from c:\tools\esp32-latest\esp\esp-idf\requirements.txt are satisfied.
Executing action: menuconfig
Running cmake in directory c:\tools\esp32-latest\esp\hello_world\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized -DCCACHE_ENABLE=0 c:\tools\esp32-latest\esp\hello_world"...
Warn about uninitialized values.
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.23.0.windows.1")
-- mconf-idf version mconf-v4.6.0.0-idf-20190628-win32
-- IDF_TARGET not set, using default target: esp32
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/drwill/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/drwill/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/drwill/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe -- broken
CMake Error at C:/Users/drwill/.espressif/tools/cmake/3.13.4/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler

"C:/Users/drwill/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/tools/esp32-latest/esp/hello_world/build/CMakeFiles/CMakeTmp

Run Build Command:"C:/Users/drwill/.espressif/tools/ninja/1.9.0/ninja.exe" "cmTC_dffb9"
[1/2] Building C object CMakeFiles/cmTC_dffb9.dir/testCCompiler.c.obj
[2/2] Linking C executable cmTC_dffb9
FAILED: cmTC_dffb9
cmd.exe /C "cd . && C:\Users\drwill\.espressif\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -mlongcalls -Wno-frame-address -nostdlib CMakeFiles/cmTC_dffb9.dir/testCCompiler.c.obj -o cmTC_dffb9 && cd ."
The system cannot find the path specified.
c:/users/drwill/.espressif/tools/xtensa-esp32-elf/esp32-2019r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 00400054
ninja: build stopped: subcommand failed.




CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
C:/tools/esp32-latest/esp/esp-idf/tools/cmake/project.cmake:258 (__project)
CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "C:/tools/esp32-latest/esp/hello_world/build/CMakeFiles/CMakeOutput.log".
See also "C:/tools/esp32-latest/esp/hello_world/build/CMakeFiles/CMakeError.log".
cmake failed with exit code 1

User avatar
drwill
Posts: 14
Joined: Mon Oct 28, 2019 10:01 pm

Re: Issues: latest toolchain install on Windows

Postby drwill » Fri Nov 01, 2019 9:35 pm

Any idea @ESP_igrr?

From what I can tell, the following command references a directory structure and file that do not exist, and that is why it fails. Why does it have an expectation that isn't met? Is a previous step supposed to have set that up?

C:\Users\drwill\.espressif\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -mlongcalls -Wno-frame-address -nostdlib CMakeFiles/cmTC_dffb9.dir/testCCompiler.c.obj -o cmTC_dffb9

Thanks,
David

Kubuś Puchatek
Posts: 4
Joined: Tue Apr 14, 2020 8:47 pm

Re: Issues: latest toolchain install on Windows

Postby Kubuś Puchatek » Tue Apr 14, 2020 8:56 pm

I've got the same error.

Code: Select all

Warn about uninitialized values.
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.25.1.windows.1") 
-- IDF_TARGET not set, using default target: esp32
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe -- broken
-- Configuring incomplete, errors occurred!
See also "C:/esp32/mkm/eclipse-workspace/hello_world/build/CMakeFiles/CMakeOutput.log".
See also "C:/esp32/mkm/eclipse-workspace/hello_world/build/CMakeFiles/CMakeError.log".
Executing action: menuconfig
Running cmake in directory c:\esp32\mkm\eclipse-workspace\hello_world\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized -DCCACHE_ENABLE=0 c:\esp32\mkm\eclipse-workspace\hello_world"...
cmake failed with exit code 1


Building in: C:\esp32\mkm\eclipse-workspace\wer\build
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=C:\esp32\esp-idf\tools\cmake\toolchain-esp32.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DIDF_TARGET=esp32 C:\esp32\mkm\eclipse-workspace\wer
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe -- broken
CMake Error at C:/Users/mkm/.espressif/tools/cmake/3.16.4/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "C:/Users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/esp32/mkm/eclipse-workspace/wer/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):C:/Users/mkm/.espressif/tools/ninja/1.10.0/ninja.exe cmTC_e5599 && [1/2] Building C object CMakeFiles/cmTC_e5599.dir/testCCompiler.c.obj
    [2/2] Linking C executable cmTC_e5599
    FAILED: cmTC_e5599 
    cmd.exe /C "cd . && C:\Users\mkm\.espressif\tools\xtensa-esp32-elf\esp-2020r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -mlongcalls -Wno-frame-address   CMakeFiles/cmTC_e5599.dir/testCCompiler.c.obj  -o cmTC_e5599   && cd ."
    c:/users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:/users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/../libexec/gcc/xtensa-esp32-elf/8.2.0/liblto_plugin-0.dll: error loading plugin: 
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
      
Windows 7, ESP-IDF v4, last Python, git, CMake...
Any chance to solve it?
Regards
Kamil

User avatar
drwill
Posts: 14
Joined: Mon Oct 28, 2019 10:01 pm

Re: Issues: latest toolchain install on Windows

Postby drwill » Wed Apr 15, 2020 5:08 pm

I never got it working, and still no help from Espressif.

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Issues: latest toolchain install on Windows

Postby ESP_igrr » Wed Apr 15, 2020 10:35 pm

Kubuś Puchatek wrote: c:/users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:/users/mkm/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/../libexec/gcc/xtensa-esp32-elf/8.2.0/liblto_plugin-0.dll: error loading plugin:
collect2.exe: error: ld returned 1 exit status
Hi Kubuś, this seems to be a different error than the one reported by drwill. Can you please try running "xtensa-esp32-elf-ld -v" from IDF command prompt and see if that works?
drwill wrote: cmd.exe /C "cd . && C:\Users\drwill\.espressif\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -mlongcalls -Wno-frame-address -nostdlib CMakeFiles/cmTC_dffb9.dir/testCCompiler.c.obj -o cmTC_dffb9 && cd ."
The system cannot find the path specified.
Hi drwill, can you try creating a new directory (such as build_tmp) in your project, and then running cmake there manually (cmake .. -G Ninja, as shown here: https://docs.espressif.com/projects/esp ... e-directly). It looks like the step where CMake is trying to test the compiler is failing, but this part is not handled by the IDF build system. If it still fails when you run cmake manually, please attach the log file.

Kubuś Puchatek
Posts: 4
Joined: Tue Apr 14, 2020 8:47 pm

Re: Issues: latest toolchain install on Windows

Postby Kubuś Puchatek » Sat Apr 18, 2020 6:00 pm

ESP_igrr wrote:
Wed Apr 15, 2020 10:35 pm
Hi Kubuś, this seems to be a different error than the one reported by drwill. Can you please try running "xtensa-esp32-elf-ld -v" from IDF command prompt and see if that works?
It works, I think:

Code: Select all

c:\esp32\esp-idf\xtensa-esp32-elf-ld -v
GNU ld (crosstool-NG esp-2019r2) 2.31.1
But "idf.py menuconfig" is still not working (under Arduino everything is OK, but I prefer Eclipse and esp-idf). Something is wrong with the xtensa gcc compiler, I guess. Bad installation, wrong version or path?
Regards
Kamil

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Issues: latest toolchain install on Windows

Postby ESP_igrr » Sat Apr 18, 2020 10:57 pm

Hi Kamil,

could you try adding the following line to tools/cmake/toolchain-esp32.cmake file in ESP-IDF?

Code: Select all

set(CMAKE_EXE_LINKER_FLAGS "-fno-use-linker-plugin" CACHE STRING "Linker Base Flags")
then delete the "build" directory in your project, and try building again.

Who is online

Users browsing this forum: No registered users and 112 guests