zephyr: Referencing ST morpho header in custom shield leads to devicetree error
Describe the bug
I’m currently working on a shield definition for a custom shield targeted to be connected to the ST morpho headers of the nucleo_g071rb and nucleo_g0b1re boards (see boards folder in https://github.com/PhilippFinke1988/nucleo_my_shield). Both boards contain nexus nodes describing the pin mapping of their ST morpho header (see https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/st/nucleo_g071rb/st_morpho_connector.dtsi and https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/st/nucleo_g0b1re/st_morpho_connector.dtsi).
Trying to build my application by calling
west build -b nucleo_g071rb . -p --build-dir build\debug --shield nucleo_my_shield
leads to a devicetree error
-- west build: making build dir C:\my-ws\application\build\debug pristine
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: C:/my-ws/application
-- CMake version: 3.30.4
-- Found Python3: c:/my-ws/.venv/Scripts/python.exe (found suitable version "3.12.6", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: C:/my-ws/zephyr/.cache
-- Zephyr version: 3.7.0 (C:/my-ws/zephyr)
-- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
-- Board: nucleo_g071rb, qualifiers: stm32g071xx
-- Shield(s): nucleo_my_shield
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.16.8 (C:/Users/finkeph/.zephyr_ide/toolchains/zephyr-sdk-0.16.8)
-- Found toolchain: zephyr 0.16.8 (C:/Users/finkeph/.zephyr_ide/toolchains/zephyr-sdk-0.16.8)
-- Found Dtc: C:/ProgramData/chocolatey/bin/dtc.exe (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found BOARD.dts: C:/my-ws/zephyr/boards/st/nucleo_g071rb/nucleo_g071rb.dts
-- Found devicetree overlay: C:/my-ws/application/boards/shields/nucleo_my_shield/nucleo_my_shield.overlay
devicetree error: expected '#gpio-cells' property on <Node /soc/interrupt-controller@e000e100 in 'C:/my-ws/zephyr/misc/empty_file.c'> (referenced by <Node /soc/spi@40013000 in 'C:/my-ws/zephyr/misc/empty_file.c'>)
-- In: C:/my-ws/application/build/debug/zephyr, command: c:/my-ws/.venv/Scripts/python.exe;C:/my-ws/zephyr/scripts/dts/gen_defines.py;--dts;C:/my-ws/application/build/debug/zephyr/zephyr.dts.pre;--dtc-flags;'';--bindings-dirs;C:/my-ws/zephyr/dts/bindings;--header-out;C:/my-ws/application/build/debug/zephyr/include/generated/zephyr/devicetree_generated.h.new;--dts-out;C:/my-ws/application/build/debug/zephyr/zephyr.dts.new;--edt-pickle-out;C:/my-ws/application/build/debug/zephyr/edt.pickle;--vendor-prefixes;C:/my-ws/zephyr/dts/bindings/vendor-prefixes.txt
CMake Error at C:/my-ws/zephyr/cmake/modules/dts.cmake:296 (message):
gen_defines.py failed with return code: 1
Call Stack (most recent call first):
C:/my-ws/zephyr/cmake/modules/zephyr_default.cmake:132 (include)
C:/my-ws/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
C:/my-ws/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
CMakeLists.txt:5 (find_package)
-- Configuring incomplete, errors occurred!
←[91mFATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' -DWEST_PYTHON=c:/my-ws/.venv/Scripts/python.exe '-BC:\my-ws\application\build\debug' -GNinja -DBOARD=nucleo_g071rb -DSHIELD=nucleo_my_shield '-SC:\my-ws\application'
To Reproduce Steps to reproduce the behavior:
- Setup a new workspace.
west init -m https://github.com/PhilippFinke1988/nucleo_my_shield my-workspace cd my-workspace west update - Build the application (my-workspace is current working directory).
cd nucleo_my_shield west build -b nucleo_g071rb . -p --build-dir build\debug --shield nucleo_my_shield
Expected behavior
The application should build without any error.
Impact
This issue is rather an annyance.
Environment (please complete the following information):
- OS: Windows
- Toolchain Zephyr SDK 0.6.18
- Zephyr revision v3.7.0
Additional context
- Referencing the GPIO nodes directly instead of st_morpho_header works just fine.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (10 by maintainers)
@FRASTM Thank you! I approved PR #82410. I think we can close this issue after the PR has been merged.
Ok for keeping Pin 25 & 27 unchanged
The steps to reproduce I described might be a bit confusing. I updated them.
Sure, I pushed the code to https://github.com/PhilippFinke1988/nucleo_my_shield