Page 1 of 1

Error in running programs in ESP-IDF

Posted: Sun May 07, 2023 5:50 pm
by Madhura A V
I was setting up ESP-IDF to use it with ESP32-S-series. Where I am encountering the problem in building the projects.
The build is getting failed. It says there is an error in the default CMake files. Tried solving it in available ways but no luck.

It says,
CMake Error at C:/Espressif/frameworks/esp-idf-v5.0/tools/cmake/project.cmake:356 (set):
Maximum recursion depth of 100 exceeded
-- Configuring incomplete, errors occurred!

cmake --build . -- -v
ninja: error: loading 'build.ninja': The system cannot find the file specified.

Hoping to find some suggestions regarding the error.

Re: Error in running programs in ESP-IDF

Posted: Mon May 08, 2023 3:36 pm
by MicroController
It says there is an error in the default CMake files
That's probably not what it says. It detects the problem while running the IDF's project.cmake, but the issue probably originates in your application's setup/cmake file. Care to share it with us?

Re: Error in running programs in ESP-IDF

Posted: Thu Jun 26, 2025 7:27 am
by MittenClaw
Hi.
I am having a similar issue with running code.

The CMakeLists.txt file in the ESP IDF directory is:
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(Blah)



The CMakeLists.txt file in the esp-idf-v5.4.1\examples\peripherals\adc\continuous_read directory is:
cmake_minimum_required(VERSION 3.16)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(continuous_read)



In the main folder under that it is:
idf_component_register(SRCS "continuous_read_main.c"
INCLUDE_DIRS ".")


My environment variables are
IDF_PATH (ESP_IDF directory)
IDF_TARGET esp32
In Path it goes to the tools directory below that


The output code goes:
Executing action: menuconfig
(...)
CMake Error at tools/cmake/project.cmake:585 (set):
Maximum recursion depth of 1000 exceeded
Call Stack (most recent call first):
tools/cmake/project.cmake:586 (__project)
tools/cmake/project.cmake:586 (__project) (Onwards 1000 times)


CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
cmake failed with exit code 1



The CMD setup code goes:
IDF_TOOLS_PATH not set. Setting to C:\Espressif
Setting PYTHONNOUSERSITE, was not set
Using Python in C:\Espressif\python_env\idf5.4_py3.11_env\Scripts
Python 3.11.2
Using Git in C:\Espressif\tools\idf-git\2.44.0\cmd
git version 2.44.0.windows.1
Activating ESP-IDF 5.4
Setting IDF_PATH to 'C:\Espressif\frameworks\esp-idf-v5.4.1'.
* Checking python version ... 3.11.2
* Checking python dependencies ... OK
* Deactivating the current ESP-IDF environment (if any) ... OK
* Establishing a new ESP-IDF environment ... OK
* Identifying shell ... powershell.exe
* Detecting outdated tools in system ... Found tools that are not used by active ESP-IDF version.



Does anybody see any problems? I have tried many things to fix this. IDF_TOOLS_PATH being set to the tools directory screws over the CMD on startup. I have tried having less CMakeLists.txt files but the one in the ESP IDF directory is needed and constantly fails. ESP IDF IDE doesn't work as well.