undefined reference to ` __device_dts_ord_347'

94 Views Asked by At

I am very new to Zephyr RTOS, I am developing an I2C Application for Interfacing I2C devices.

While building my code I am getting the following error like

/root/zephyrproject/zephyr/project/gimbal_app/src/main.c:27: undefined reference to `__device_dts_ord_347'

Here I have attached my code. Please anybody can guide me and solve my problem?

#include<stdio.h>
#include<zephyr/kernel.h>
#include<zephyr/drivers/gpio.h>
#include<zephyr/drivers/i2c.h>
#include<zephyr/device.h>

#define DT_DRV_COMPAT micro_wm89xx

static const struct device *gpio_ct_dev=DEVICE_DT_GET(DT_NODELABEL(gpio1));
static const struct device *i2c_dev=DEVICE_DT_GET(DT_NODELABEL(pinmux_lpi2c1));
//static const struct device *i2c_dev=DEVICE_DT_GET(DT_NODELABEL(lpi2c1));

uint32_t i2c_cfg =I2C_SPEED_SET(I2C_SPEED_STANDARD)|I2C_MODE_CONTROLLER;

int main(void)
{
      if(!device_is_ready(gpio_ct_dev))
      {
              return 0 ;
      }
      if((i2c_dev==NULL)||!device_is_ready(i2c_dev))
      {
              printf("fail\n");
      }
}

Apart from this can someone please explain to me how to use the Zephyr RTOS device tree for I2C? Interfacing from the beginning, if someone has already developed code for the i2c interface of Teensy with an i2c device using Zephyr RTOS.

0

There are 0 best solutions below