I am trying to implement the Ws2812 driver on the NRF5340 based on the driver example.
The specific error I am getting is:
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: zephyr/drivers/spi/libdrivers__spi.a(spi_nrfx_spim.c.obj):(.rodata.__compound_literal.1+0x0): undefined reference to `__device_dts_ord_68'
This is similar to this post:
Implementing WS2812 Driver NCS (undefined reference to `__device_dts_ord_61')
It seems like there is something missing in the configuration.
prj.conf:
# BT CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="QuantaFlo 2.0"" CONFIG_BT_DEVICE_APPEARANCE=833 CONFIG_BT_MAX_PAIRED=1 CONFIG_BT_DEBUG_LOG=y CONFIG_BT_MAX_CONN=1 #CONFIG_BT_L2CAP_TX_BUF_COUNT=5 # This example requires more workqueue stack CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_HEAP_MEM_POOL_SIZE=2048 # SPI CONFIG_SPI=y #CONFIG_NRFX_SPIM=y #CONFIG_NRFX_SPIM4=y CONFIG_GPIO=n CONFIG_CPLUSPLUS=y CONFIG_LIB_CPLUSPLUS=y CONFIG_NEWLIB_LIBC=y # CONFIG_CONSOLE is not set CONFIG_GPIO_NRFX=n #CONFIG_NRFX_GPIOTE=y # USB CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="SS QF2.0" CONFIG_LOG=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_PID=0x0501 CONFIG_USB_DEVICE_VID=0x2047 # Logging CONFIG_USE_SEGGER_RTT=y #CONFIG_LOG_BACKEND_RTT=y # Neopixels CONFIG_LED_STRIP=y CONFIG_WS2812_STRIP=y CONFIG_LED_STRIP_LOG_LEVEL_DBG=y
The overlay file:
&spi4 {
compatible="nordic,nrf-spim";
status = "ok";
sck-pin = <36>;
mosi-pin = <41>;
miso-pin = <25>;
};
&zephyr_udc0 {
cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
#include <dt-bindings/led/led.h>
#define SPI_FREQ 4000000
#define ZERO_FRAME 0x40
#define ONE_FRAME 0x70
&spi2 {
compatible = "nordic,nrf-spim";
status = "okay";
sck-pin = <0>;
miso-pin = <0>;
mosi-pin = <16>;
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <SPI_FREQ>;
/* WS2812 */
chain-length = <1>; /* arbitrary; change at will */
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
spi-one-frame = <ONE_FRAME>;
spi-zero-frame = <ZERO_FRAME>;
};
};
/ {
aliases {
led-strip = &led_strip;
};
};
Nothing in the other linked post seemed to help.