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

adxl362 sample not compiling

Hi,

I am attempting to get the adxl362 sample working with the nrf9160 dk board. I am using the nordic SDK v1.2.0. I cannot get it to compile, compiling the code below fails with the error:

"DT_INST_0_ADI_ADXL362_LABEL undeclared".

I even tried downloading a fresh SDK install using the new toolchain manager. I have followed other adxl362 tickets on the forum without any success....the closest solution involved updating to the latest release which I have done.

Any help will be appreciated! 

Thanks in advance.

struct device *dev = device_get_binding(DT_INST_0_ADI_ADXL362_LABEL);
if (dev == NULL) {
printf("Device get binding device\n");
return;
}

overlay file:

&spi3 {
status = "ok";
sck-pin = <10>;
mosi-pin = <11>;
miso-pin = <12>;
ss-pin = <13>;
spi-max-frequency = <4000000>;

adxl362@0 {
compatible = "adi,adxl362";
label = "ADXL362";
spi-max-frequency = <4000000>;
reg = <0>;
int1-gpios = <&gpio0 9 0>;
};

config:

CONFIG_SENSOR=y
CONFIG_ADXL362=y
CONFIG_ADXL362_TRIGGER_GLOBAL_THREAD=y
CONFIG_ADXL362_INTERRUPT_MODE=1
CONFIG_ADXL362_ABS_REF_MODE=1

# SPI
CONFIG_SPI=y
CONFIG_SPI_3_NRF_SPIM=y
CONFIG_SPI_3=y 
CONFIG_SPI_NRFX=y

Parents Reply
  • Thanks for your reply,

    That did clear that error, but now I have another error in adxl362.c

    "CONFIG_ADXL362_DEV_NAME undeclared":

    DEVICE_AND_API_INIT(adxl362, CONFIG_ADXL362_DEV_NAME, adxl362_init,
    &adxl362_data, NULL, POST_KERNEL,
    CONFIG_SENSOR_INIT_PRIORITY, &adxl362_api_funcs);

    If I replace CONFIG_ADXL362_DEV_NAME  with "SPI_3"  (a guess at this stage!) the error moves to "adxl362_config undeclared"

    What am I missing to set this up properly? 

Children
Related