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

zigbee examples point to the incorrect directory for zcl_utility, causing CMake failure (IDFGH-14552) #15313

Open
3 tasks done
tmcomm opened this issue Jan 31, 2025 · 3 comments
Assignees
Labels
Status: Opened Issue is new Type: Bug bugs in IDF

Comments

@tmcomm
Copy link

tmcomm commented Jan 31, 2025

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.

v5.4.0

Espressif SoC revision.

ESP32-C6

Operating System used.

Linux

How did you build your project?

VS Code IDE

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

None

Development Kit.

ESP32-C6-DevKitC-1 v1.2

Power Supply used.

USB

What is the expected behavior?

Generate CMake build files and compile the zigbee example projects HA_on_off_switch and HA_on_off_light.

What is the actual behavior?

The zigbee example projects HA_on_off_switch and HA_on_off_light fail to generate CMake build files and fail to compile.

The incorrect directory is sourced for zcl_utility.

Steps to reproduce.

  1. Create new example zigbee projects HA_on_off_switch or HA_on_off_light.
  2. Select a target device, attempt to generate CMake build files, or attempt to build the project.

Debug Logs.


More Information.

In both zigbee example projects HA_on_off_switch and HA_on_off_light, main/CMakeLists.txt points to the incorrect zcl_utility directories with these two lines:

SRC_DIRS  "." "../../../common/zcl_utility/src"
INCLUDE_DIRS "." "../../../common/zcl_utility/include"

These lines should be changed to the following to point to the correct location of zcl_utility in the current version of IDF:

SRC_DIRS  "." "$ENV{IDF_PATH}/examples/zigbee/common/zcl_utility/src"
INCLUDE_DIRS "." "$ENV{IDF_PATH}/examples/zigbee/common/zcl_utility/include"

The above change is functional on my fresh Linux install of IDF v5.4.0

@tmcomm tmcomm added the Type: Bug bugs in IDF label Jan 31, 2025
@github-actions github-actions bot changed the title zigbee examples point to the incorrect directory for zcl_utility, causing CMake failure zigbee examples point to the incorrect directory for zcl_utility, causing CMake failure (IDFGH-14552) Jan 31, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 31, 2025
@rmv5004
Copy link

rmv5004 commented Feb 4, 2025

I had the same issue. However your fix did not work in VSCode.

Fix path by replacing backslashes with forward slashes

string(REPLACE "\" "/" IDF_PATH_FIXED "$ENV{IDF_PATH}")

idf_component_register(
SRC_DIRS "." "${IDF_PATH_FIXED}/examples/zigbee/common/zcl_utility/src"
INCLUDE_DIRS "." "${IDF_PATH_FIXED}/examples/zigbee/common/zcl_utility/include"
)

@tmcomm
Copy link
Author

tmcomm commented Feb 5, 2025

@rmv5004 Are you using Windows? Did you rebuild IDF, or just change the file? I'm on Linux which uses "/" and my original fix works, but I didn't rebuild IDF.

Since all the other CMakeLists.txt files I looked at also use "/", I'm guessing they are changed at build time when IDF is built for Windows. I'm not very familiar with the project though.

@xieqinan
Copy link
Collaborator

xieqinan commented Feb 6, 2025

@rmv5004

The Zigbee examples use relative paths to point to the source code, which is fine for building the original examples. However, it is better to use absolute paths. If you plan to create a new Zigbee example, please correct the path before optimization is merged.

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

4 participants