SDK 2.2 + "__device_dts_ord_XX" errors

Hi community,

I try to acces gpio0 and adc channels on a icarus board (nRF9160 + SDK 2.2).

On building, i have these errors "__device_dts_ord_94", "__device_dts_ord_95" and "__device_dts_ord_4".

DEVICE_DT_GET seems not accepted.
Any idea to solve this ?
Many thanks !

#define GPIO_NODE DT_NODELABEL(gpio0)
#define ADC_0 DT_CHILD(DT_NODELABEL(adc), channel_0)
#define ADC_5 DT_CHILD(DT_NODELABEL(adc), channel_5)

static const struct device *adc0;
static const struct device *adc5;
static const struct device *gpio;

adc0 = DEVICE_DT_GET(ADC_0);
adc5 = DEVICE_DT_GET(ADC_5);	
gpio = DEVICE_DT_GET(GPIO_NODE);

and overlay

&adc {
	#address-cells = <1>;
	#size-cells = <0>;
	
	channel@0 {
		reg = <0>;
		zephyr,gain = "ADC_GAIN_1_6";
		zephyr,reference = "ADC_REF_INTERNAL";
		zephyr,acquisition-time = <ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 20)>;
		zephyr,input-positive = <NRF_SAADC_AIN0>;
		zephyr,resolution = < 10 >;
	};

	channel@5 {
		reg = <5>;
		zephyr,gain = "ADC_GAIN_1_6";
		zephyr,reference = "ADC_REF_INTERNAL";
		zephyr,acquisition-time = <ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 20)>;
		zephyr,input-positive = <NRF_SAADC_AIN5>;
		zephyr,resolution = < 10 >;
	};
};

Parents Reply Children
  • If i do nothing, i have this "errors" (not blocking build operation)

    #include <zephyr/kernel.h>				// Noyau
    #include <zephyr/device.h>
    #include <zephyr/drivers/adc.h>			// ADC
    #include <zephyr/drivers/gpio.h>		// GPIO
    #include <stdio.h>						// Calcul
    #include <zephyr/sys/printk.h>			// Affichage
    #include <zephyr/logging/log.h>			// Logging
    
    all with tilde -> impossible d'ouvrir le fichier source "zephyr/kernel.h"C/C++(1696)

    if i modify in folder .vscode, the file c_cpp_properties.json

    like this (create automatically the file and add a line)

    "includePath": [
                    "${default}",
                    "/opt/nordic/ncs/v2.2.0/zephyr/include",
                    "${workspaceFolder}/**" <-- i have add this
                ],

    i have no errors of include files.

    But 3 errors _device_dts_ord_XX

  • Alskandar said:
    i have this "errors" (not blocking build operation)

    If your project builds you can ignore these warnings, VS Code not finding the header files doesn't mean the NCS build system doesn't find them.

    Alskandar said:
    if i modify in folder .vscode, the file c_cpp_properties.json

    I wouldn't recommend messing around in these files unless you really know what you're doing.

Related