Error in code identifier "__device_dts_ord_120" is undefinedC/C++(20)

Hi! I get error in visual studio code function:

const struct device * data_uart = DEVICE_DT_GET(DT_NODELABEL(uart0));

I use windows 10 with nrf extensions. Ncs version is 2.6.0. I have libraries:

#include <stdlib.h>
#include <stdint.h>

#include <zephyr/device.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/audio/dmic.h>
#include <dk_buttons_and_leds.h>
#include <nrfx_pdm.h>
#include <zephyr/drivers/uart.h>
.

And in prj.conf have:

CONFIG_LOG=y
CONFIG_AUDIO=y
CONFIG_AUDIO_DMIC=y

CONFIG_NRFX_PDM_LOG=y
CONFIG_NRFX_PDM=y
CONFIG_DEBUG_OPTIMIZATIONS=y

CONFIG_DK_LIBRARY=y


CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y

  • Hello,

    Sorry for the late reply. We are a bit short staffed due to Easter Holidays here in Norway. In addition, we will be closed from tomorrow (28th) until 2nd of April, so we will not be able to answer any questions for that period. I am sorry for the inconvenience.

    The ""device_dts_ord_XXX" is undefined" message means that you are trying to use something that is not enabled. To see exactly which one it refers to, I would need to see your build folder, but you can check it yourself. If you open the file found in:

    build\zephyr\include\generated\devicetree_generated.h

    There you will see the list of the node ordering. What does it say on the number 120 in your case?

    Best regards,

    Edvin

Related