Hi, I tried to migrate my project from nRF Connect SDK v2.5.3 to v2.9.0, switching to sysbuild and creating my own board definition instead of using a overlay file.
I decided to go for v2.9.0 because I used this version for another project already and I have made the local changes in the SDK directory for correct netcore updates already.
I'm using the mcp2515 CAN controller which worked fine with SDK v2.5.3. But if I try to put the configuration into my new board definition, I get the following error message during the build process:
C:/MyProject/build_v2.9.0/MyProject/zephyr/include/generated/zephyr/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mfp16-format=ieee -mtp=soft --sysroot=C:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/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=C:/MyProject=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.9.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.9.0=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -MD -MT zephyr/drivers/can/CMakeFiles/drivers__can.dir/can_mcp2515.c.obj -MF zephyr\drivers\can\CMakeFiles\drivers__can.dir\can_mcp2515.c.obj.d -o zephyr/drivers/can/CMakeFiles/drivers__can.dir/can_mcp2515.c.obj -c C:/ncs/v2.9.0/zephyr/drivers/can/can_mcp2515.c In file included from C:/ncs/v2.9.0/zephyr/include/zephyr/sys/util_macro.h:34, from C:/ncs/v2.9.0/zephyr/include/zephyr/sys/util.h:17, from C:/ncs/v2.9.0/zephyr/include/zephyr/sys/atomic.h:18, from C:/ncs/v2.9.0/zephyr/include/zephyr/kernel_includes.h:25, from C:/ncs/v2.9.0/zephyr/include/zephyr/kernel.h:17, from C:/ncs/v2.9.0/zephyr/drivers/can/can_mcp2515.c:9: C:/ncs/v2.9.0/zephyr/include/zephyr/device.h:92:41: error: '__device_dts_ord_21' undeclared here (not in a function); did you mean '__device_dts_ord_24'? 92 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id) | ^~~~~~~~~
What could be the reason? I correctly defined the SPI interface and I set the chosen information. But the error message says that something is wrong with the device IDs... sounds like my devicetree entry is removed again during the build process...
&spi4 { status = "okay"; pinctrl-0 = <&spi4_default>; pinctrl-1 = <&spi4_sleep>; pinctrl-names = "default", "sleep"; cs-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; my_can: can@0 { compatible = "microchip,mcp2515"; spi-max-frequency = <8000000>; int-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; status = "okay"; reg = <0x0>; osc-freq = <24000000>; bitrate = <1000000>; //sjw = <1>; sample-point = <875>; }; }; [...] / { chosen { zephyr,canbus = &my_can; }; };
The CAN configuration is enabled in prj.conf, not in the board definition. I hope this is okay, as there may be software that doesn't use the CAN.
Any ideas what is going wrong here?
Best regards,
Michael