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

Build error for example code of LIS2DH with nRF SDK v1.3.1

Hello,

I am using example code of LIS2DH accelerometer sensor with nRF SDK v1.3.1. Building  the example code I am getting macro error in devicetree.h file as mentioned below

#define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))  

with following message in output

error: 'DT_N_INST_0_st_lis2dh_P_label' undeclared (first use in this function)

Please suggest appropriate solution for the above problem.

Thanks.

Parents
  • Hello,

    I am using example code for the LSM6DSL which I believe is very similar to the LIS2DH here.  I am stuck with the same error output here.  I tried the suggest from Simon, but no luck so far.  My LSM6DSL is connected via SPI instead of I2C.  Here is my overlay file.

    &spi3 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    sck-pin = <3>;
    mosi-pin = <4>;
    miso-pin = <5>;

    lsm6dsl {
    compatible = "st,lsm6dsl";
    reg = <8>;
    label = "LSM6DSL";
    };
    };

    Any help is much appreciated.  Thanks in advance.

Reply
  • Hello,

    I am using example code for the LSM6DSL which I believe is very similar to the LIS2DH here.  I am stuck with the same error output here.  I tried the suggest from Simon, but no luck so far.  My LSM6DSL is connected via SPI instead of I2C.  Here is my overlay file.

    &spi3 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    sck-pin = <3>;
    mosi-pin = <4>;
    miso-pin = <5>;

    lsm6dsl {
    compatible = "st,lsm6dsl";
    reg = <8>;
    label = "LSM6DSL";
    };
    };

    Any help is much appreciated.  Thanks in advance.

Children
No Data
Related