Hello support team,
I am a beginner in this environment and I am facing a problem while trying to compile my project in Zephyr for nRF52840dk board. I am trying to run this example using CAN-BUS github.com/.../counter but when I run the compile command, I am getting the following error:
In file included from C:/ncs/v2.6.1/zephyr/include/zephyr/toolchain/gcc.h:98, from C:/ncs/v2.6.1/zephyr/include/zephyr/toolchain.h:50, from C:/ncs/v2.6.1/zephyr/include/zephyr/kernel_includes.h:23, from C:/ncs/v2.6.1/zephyr/include/zephyr/kernel.h:17, from C:/counter/src/main.c:9:C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:89:41: error: '__device_dts_ord_DT_CHOSEN_zephyr_canbus_ORD' undeclared here (not in a function) 89 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id) | ^~~~~~~~~C:/ncs/v2.6.1/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT' 137 | #define _DO_CONCAT(x, y) x ## y | ^C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:89:33: note: in expansion of macro '_CONCAT' 89 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id) | ^~~~~~~C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:216:37: note: in expansion of macro 'DEVICE_NAME_GET' 216 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id)) | ^~~~~~~~~~~~~~~C:/ncs/v2.6.1/zephyr/include/zephyr/device.h:233:34: note: in expansion of macro 'DEVICE_DT_NAME_GET' 233 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id)) | ^~~~~~~~~~~~~~~~~~C:/counter/src/main.c:29:38: note: in expansion of macro 'DEVICE_DT_GET' 29 | const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)); | ^~~~~~~~~~~~~[37/162] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.objninja: build stopped: subcommand failed.FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\cf2149caf2\opt\bin\cmake.EXE' --build 'c:\counter\build'
And this warning too:
warning: CAN_MAX_FILTER (defined at drivers/can/Kconfig.mcux:39, drivers/can/Kconfig.mcp2515:30,
drivers/can/Kconfig.loopback:15, drivers/can/Kconfig.native_posix_linux:22,
drivers/can/Kconfig.sja1000:11, drivers/can/Kconfig.mcp251xfd:54) was assigned the value '5' but got
the value ''. Check these unsatisfied dependencies: ((CAN_MCUX_FLEXCAN && CAN) || (CAN_MCP2515 &&
CAN) || (CAN_LOOPBACK && CAN) || (CAN_NATIVE_POSIX_LINUX && CAN) || (CAN_SJA1000 && CAN) ||
(CAN_MCP251XFD && CAN)) (=n). See
docs.zephyrproject.org/.../kconfig.html and/or look up
CAN_MAX_FILTER in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.
I would be very grateful if you could help me :)