bbc microbit v2 line follower robot

I am trying to build the robot line followerexample for the bbc microbit  v2 ...

The project works for  the bbc  microbit v0  but  when I create a copy of the boards overlay file and

rename it to bbc_microbit_v2.overlay

its contents are:

/*
 * Copyright (c) 2022 Nordic Semicondiuctor ASA
 * SPDX-License-Identifier: Apache-2.0
 */

/ {
    zephyr,user {
        left-gpios = <&edge_connector 13 GPIO_ACTIVE_HIGH>;
        right-gpios = <&edge_connector 14 GPIO_ACTIVE_HIGH>;
    };
};

&i2c0 {
    motorctl: motor-controller@10 {
        compatible = "motor-controller";
        reg = <0x10>;
    };
};

and invoke west build ...

the build fails with the following kinds of errors 

...

D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/device.h:91:41: error: '__device_dts_ord_DT_N_S_zephyr_user_P_left_gpios_IDX_0_PH_ORD' undeclared here (not in a function)
   91 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                         ^~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
  137 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/device.h:91:33: note: in expansion of macro '_CONCAT'
   91 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                 ^~~~~~~
D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/device.h:218:37: note: in expansion of macro 'DEVICE_NAME_GET'
  218 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
      |                                     ^~~~~~~~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/device.h:235:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
  235 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
      |                                  ^~~~~~~~~~~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/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)),\
      |                         ^~~~~~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/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)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/wsc/line_follower_robot/src/main.c:19:9: note: in expansion of macro 'GPIO_DT_SPEC_GET'
   19 |         GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), left_gpios);
      |         ^~~~~~~~~~~~~~~~
In file included from D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/arch/arm/arch.h:20,
                 from D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/arch/cpu.h:19,
                 from D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/kernel_includes.h:36:
D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/devicetree.h:92:17: error: 'DT_N_S_zephyr_user_P_left_gpios_IDX_0_VAL_pin' undeclared here (not in a function); did you mean 'DT_N_S_led_matrix_P_row_gpios_IDX_0_VAL_pin'?
   92 | #define DT_ROOT DT_N
      |                 ^~~~
D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/devicetree.h:4492:9: note: in definition of macro 'DT_CAT7'
 4492 |         a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
      |         ^~
D:/zephyr-resources-2024/zephyrproject/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)
      |         ^~~~~~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/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),                 \
      |                        ^~~~~~~~~~~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/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)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/wsc/line_follower_robot/src/main.c:19:9: note: in expansion of macro 'GPIO_DT_SPEC_GET'
   19 |         GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), left_gpios);
      |         ^~~~~~~~~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/sys/util_internal.h:104:26: note: in expansion of macro 'UTIL_PRIMITIVE_CAT'
  104 | #define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
      |                          ^~~~~~~~~~~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/devicetree.h:4459:9: note: in expansion of macro 'UTIL_CAT'
 4459 |         UTIL_CAT(DT_ROOT, MACRO_MAP_CAT(DT_S_PREFIX, __VA_ARGS__))
      |         ^~~~~~~~
D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/devicetree.h:4459:18: note: in expansion of macro 'DT_ROOT'
 4459 |         UTIL_CAT(DT_ROOT, MACRO_MAP_CAT(DT_S_PREFIX, __VA_ARGS__))
      |                  ^~~~~~~
D:/zephyr-resources-2024/zephyrproject/zephyr/include/zephyr/devicetree.h:144:22: note: in expansion of macro 'DT_PATH_INTERNAL'
  144 | #define DT_PATH(...) DT_PATH_INTERNAL(__VA_ARGS__)
      |                      ^~~~~~~~~~~~~~~~
D:/zephyr-resources-2024/zephyrproject/wsc/line_follower_robot/src/main.c:19:26: note: in expansion of macro 'DT_PATH'
   19 |         GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), left_gpios);
      |                          ^~~~~~

What am I missing here and how can I make sense of these errors.

Related