logo elektroda
logo elektroda
X
logo elektroda

Error compiling hello world on ESP32 - how to set paths and IDF_TARGET?

kamilmm 768 5
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18623657
    kamilmm
    Level 11  
    I'm just starting to "play" with esp32 so don't beat me up for a beginner's question.
    I'm having trouble compiling a simple "hello world.
    What I've done: installed the latest Python and Git for Windows. From https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html I downloaded the latest installer: esp-idf-tools-setup-2.3.exe, during the installation I selected esp-idf v4, manually added the location to cmake to the PATH (the installer didn't do it).
    Trying to compile (idf.py menuconfig) "hello_world" with "esp-idf\examples\get-started\hello_world" gives an error as below:
    
    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
    .
    Any ideas what is wrong?
  • ADVERTISEMENT
  • #2 18623852
    adamegah
    Level 21  
    Please include
    
    "C:/esp32/mkm/eclipse-workspace/hello_world/build/CMakeFiles/CMakeOutput.log"
    "C:/esp32/mkm/eclipse-workspace/hello_world/build/CMakeFiles/CMakeError.log"
    .
  • ADVERTISEMENT
  • #3 18624771
    khoam
    Level 42  
    kamilmm wrote:
    -- 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!

    Cannot find or there is a corrupt compiler file for xtensa-esp32.

    kamilmm wrote:
    I manually added the location to cmake to the PATH (the installer did not).
    .
    And how specifically? Do you follow this instruction?
    https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#id2
  • ADVERTISEMENT
  • #4 18632580
    kamilmm
    Level 11  
    khoam wrote:
    kamilmm wrote:
    -- 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!

    Cannot find or there is a corrupted compiler file for xtensa-esp32.

    kamilmm wrote:
    I manually added the location to cmake to the PATH (the installer did not do this).
    .
    And how specifically? Do you follow this instruction?
    https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#id2


    The editror is OK, I have made use of this instruction. I think the errors are with the PATH variable.
    I found a temporary workaround for the problem. When I type "idf.py menuconfig" in the "cmd" window I get errors as above, but when in the same window I issue the command
    path C:/Program Files/Java/jre1.8.0_241/bin/server;C:/Program Files/Java/jre1.8.0_241/bin;[tutaj reszta ścieżki];C:\esp32\esp-idf\tools;C:\esp32\esp-idf;C:\esp32\eclipse
    .
    then the program compiles without errors. This solution only works until the computer is restarted and only in the directory with the specific project. Changing to another project (changing the directory) causes errors.
    Path after "path" copied vividly from the window "sysdm.cpl/Advanced/Environmental variables.../PATH".
    How to turn the "workaround" into a permanent solution?
    Greetings
    Kamil

    [Added]
    The problem was bad characters in the PATH variable, swapped slashes and backslashes. In the registry it looked like this: „C: /esp32/.espressif/tools / ...”, while it should look like this: „C: /esp32/.espressif/tools / ...” Manual replacement helped.
    Topic to be closed.
  • ADVERTISEMENT
  • #5 18633148
    khoam
    Level 42  
    kamilmm wrote:
    How to turn a "workaround" into a permanent solution?
    .
    And it's not like you have to call export.bat from esp?
  • #6 18633410
    kamilmm
    Level 11  
    khoam wrote:
    kamilmm wrote:
    How to turn a "workaround" into a permanent solution?
    .
    And it's not like you have to call export.bat with espesp-idf ?
    .
    I ran first "install.bat" o later "export.bat". The problem was the wrong characters, confused / with (not sure if inserted wrong by the installer or by me).

    Greetings
    Kamil
ADVERTISEMENT