Building failed, devicetree_generated.h:2575:29: error: 'DT_N_S_leds_S_led_2_P_gpios_IDX_0_VAL_pin' undeclared here (not in a function); did you mean 'DT_N_S_buttons_S_button_2_P_gpios_IDX_0_VAL_pin'?

I get the source code from the github.com/.../ncs-fund.git , and  trying to build the exercise-1-5 of nrf-connect-sdk-fundamenta lesson-4-serial-communication-uart for 54l15dk, 2.9.0 with ubuntu 22.04, normal build using VSCODE or command line works. 

it failed in devicetree_generated.h:2575:29: error: 'DT_N_S_leds_S_led_2_P_gpios_IDX_0_VAL_pin' undeclared here (not in a function); did you mean 'DT_N_S_buttons_S_button_2_P_gpios_IDX_0_VAL_pin'?

/wewins/ncs/v2.9.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/wewins/workspace/ncs-fund/l5/l5_e1_sol_modify=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/wewins/ncs/v2.9.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/wewins/ncs/v2.9.0=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c /home/wewins/workspace/ncs-fund/l5/l5_e1_sol_modify/src/main.c
In file included from /home/wewins/ncs/v2.9.0/zephyr/include/zephyr/toolchain/gcc.h:98,
                 from /home/wewins/ncs/v2.9.0/zephyr/include/zephyr/toolchain.h:50,
                 from /home/wewins/ncs/v2.9.0/zephyr/include/zephyr/kernel_includes.h:23,
                 from /home/wewins/ncs/v2.9.0/zephyr/include/zephyr/kernel.h:17,
                 from /home/wewins/workspace/ncs-fund/l5/l5_e1_sol_modify/src/main.c:10:
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/device.h:92:41: error: '__device_dts_ord_DT_N_S_leds_S_led_0_P_gpios_IDX_0_PH_ORD' undeclared here (not in a function)
   92 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                         ^~~~~~~~~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
  137 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/device.h:92:33: note: in expansion of macro '_CONCAT'
   92 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                 ^~~~~~~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/device.h:229:37: note: in expansion of macro 'DEVICE_NAME_GET'
  229 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
      |                                     ^~~~~~~~~~~~~~~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/device.h:246:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
  246 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
      |                                  ^~~~~~~~~~~~~~~~~~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/drivers/gpio.h:333:25: note: in expansion of macro 'DEVICE_DT_GET'
  333 |                 .port = DEVICE_DT_GET(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx)),\
      |                         ^~~~~~~~~~~~~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/drivers/gpio.h:369:9: note: in expansion of macro 'GPIO_DT_SPEC_GET_BY_IDX'
  369 |         GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, 0)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/home/wewins/workspace/ncs-fund/l5/l5_e1_sol_modify/src/main.c:34:41: note: in expansion of macro 'GPIO_DT_SPEC_GET'
   34 | static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
      |                                         ^~~~~~~~~~~~~~~~
In file included from /home/wewins/ncs/v2.9.0/zephyr/include/zephyr/arch/arm/arch.h:20,
                 from /home/wewins/ncs/v2.9.0/zephyr/include/zephyr/arch/cpu.h:19,
                 from /home/wewins/ncs/v2.9.0/zephyr/include/zephyr/kernel_includes.h:36:
/home/wewins/workspace/ncs-fund/l5/l5_e1_sol_modify/build/l5_e1_sol_modify/zephyr/include/generated/zephyr/devicetree_generated.h:2708:29: error: 'DT_N_S_leds_S_led_0_P_gpios_IDX_0_VAL_pin' undeclared here (not in a function); did you mean 'DT_N_S_buttons_S_button_0_P_gpios_IDX_0_VAL_pin'?
 2708 | #define DT_N_ALIAS_led0     DT_N_S_leds_S_led_0
      |                             ^~~~~~~~~~~~~~~~~~~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4888:9: note: in definition of macro 'DT_CAT7'
 4888 |         a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
      |         ^~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/devicetree/gpio.h:110:9: note: in expansion of macro 'DT_PHA_BY_IDX'
  110 |         DT_PHA_BY_IDX(node_id, gpio_pha, idx, pin)
      |         ^~~~~~~~~~~~~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/drivers/gpio.h:334:24: note: in expansion of macro 'DT_GPIO_PIN_BY_IDX'
  334 |                 .pin = DT_GPIO_PIN_BY_IDX(node_id, prop, idx),                 \
      |                        ^~~~~~~~~~~~~~~~~~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/drivers/gpio.h:369:9: note: in expansion of macro 'GPIO_DT_SPEC_GET_BY_IDX'
  369 |         GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, 0)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/home/wewins/workspace/ncs-fund/l5/l5_e1_sol_modify/src/main.c:34:41: note: in expansion of macro 'GPIO_DT_SPEC_GET'
   34 | static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
      |                                         ^~~~~~~~~~~~~~~~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4877:24: note: in expansion of macro 'DT_N_ALIAS_led0'
 4877 | #define DT_CAT(a1, a2) a1 ## a2
      |                        ^~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:240:25: note: in expansion of macro 'DT_CAT'
  240 | #define DT_ALIAS(alias) DT_CAT(DT_N_ALIAS_, alias)
      |                         ^~~~~~
/home/wewins/workspace/ncs-fund/l5/l5_e1_sol_modify/src/main.c:34:58: note: in expansion of macro 'DT_ALIAS'
   34 | static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
      |                                                          ^~~~~~~~
/home/wewins/ncs/v2.9.0/zephyr/include/zephyr/device.h:92:41: error: '__device_dts_ord_DT_N_S_leds_S_led_1_P_gpios_IDX_0_PH_ORD' undeclared here (not in a function)
   92 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)

Checked the file zephyr.dts,  the  node and lable are already defined, the /leds/led_0 /leds/led_1 /leds/led_2 node exists and has a valid gpios property.  the related gpio is in status "okey" 

 3554.zephyr.dts

Related