This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Implementing WS2812 Driver NCS (undefined reference to `__device_dts_ord_61')

I'm trying to implement the WS2812 driver in my own project. I'm referencing the sample code stored in zephyr/samples/drivers/led_ws2812. I have copied over all of the correct configuration files, however, I'm getting an error when I try to define the strip device struct. The line shown here is throwing the error: 

The error I'm getting on compile is: 

I have triple-checked all of my includes, my proj.conf is exactly the same as the sample, and my nrf52dk_nrf52832.overlay has the correct configuration. What am I missing? The sample compiles just fine.

Alternately, how is the *strip definition different than a normal sensor definition? For example, I have initialized my accelerometer as such: 

Is there a way to follow that same convention for my LED strip that would prevent this error I am seeing? Calling device_get_binding("WS2812") results in a NULL device. See below for my overlay file:

  • I think it would be interesting to do it the opposite way, start with the WS812 sample and add stuff from the peripheral_dis sample until it breaks. Then you will figure out what in the peripheral_dis sample that causes the issue.

    I can look into it tomorrow.

  • I found the cause of the problem. You forgot to add the file zephyr/samples/drivers/led_ws2812/boards/nrf52dk_nrf52832.conf to dis_led_test/boards.

    When I did that, I no longer got the compile error.

    Best regards,

    Simon

  • Simon,

    My mistake, in my main application I did have the nrf52dk_nrf52832.conf file included which initially gave me this compile error. I missed it for this experiment but, including it just now resulted in the same error as above (same with my main application). I made sure to clean, then build. Still no luck. 

    Could it be an environment problem? 

    Were you able to recreate the compile error without the .conf file? Could I be missing a step you took to make sure the configuration was applied? 

  • Try to delete the build folder and build it again.

    I did the following:

    • Tested your sample (west build -b nrf52dk_nrf52832) and go the error  "undefined reference to `__device_dts_ord_60'"
    • Added the file nrf52dk_nrf52832.conf and built it again, and I got the same error
    • Ran rm -rf build
    • Built again and it worked

    There seems to be some problems with west, not recognizing new conf files if using the same build.

    I will make a report on this west issue.

  • Great news! 

    Did it for me! Thank you for your help Simon. 

1 2 3