Page 1 of 1

esp32c3 set-target

Posted: Mon Feb 27, 2023 5:45 pm
by borisbergman
I use vscode, esp-idf 5.0.1 and ubuntu 22.04. When I open an Example (gatt_client in this case, but also hello_world), and try to adjust the target to esp32c3 (or any other esp32 patform) I get this message. IDF_TARGET variable points to "esp32". What goes wrong and how to I fix this?

Code: Select all

$ idf.py set-target esp32c3
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Build directory '/home/bergm006/esp-projects/hello_world/build' not found. Nothing to clean.
Executing action: set-target
Set Target to: esp32c3, new sdkconfig created. Existing sdkconfig renamed to sdkconfig.old.
Running cmake in directory /home/bergm006/esp-projects/hello_world/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/home/bergm006/.espressif/python_env/idf5.0_py3.10_env/bin/python -DESP_PLATFORM=1 -DIDF_TARGET=esp32c3 -DCCACHE_ENABLE=0 /home/bergm006/esp-projects/hello_world"...
CMake Error at /home/bergm006/esp/esp-idf/tools/cmake/targets.cmake:19 (message):
  IDF_TARGET in CMake cache does not match IDF_TARGET environment variable.
  To change the target, clear the build directory and sdkconfig file, and
  build the project again
Call Stack (most recent call first):
  /home/bergm006/esp/esp-idf/tools/cmake/project.cmake:7 (__target_init)
  CMakeLists.txt:5 (include)


-- Configuring incomplete, errors occurred!
cmake failed with exit code 1, output of the command is in the /home/bergm006/esp-projects/hello_world/build/log/idf_py_stderr_output_529336 and /home/bergm006/esp-projects/hello_world/build/log/idf_py_stdout_output_529336

Re: esp32c3 set-target

Posted: Tue Feb 28, 2023 1:02 am
by ESP_Sprite
Did you try clearing (or removing entirely) the build directory, as the message said?

Re: esp32c3 set-target

Posted: Tue Feb 28, 2023 8:02 am
by borisbergman
Well as far as I can see the message sais no build directory found, nothing to clean, which corresponds to having no build directory. I found out it's caused by the vscode esp-idf terminal window. When I open a regular terminal and run . ~/esp/esp-idf/export.sh the conversion works fine.