Please provide procedure to use ToF sensor library VL53L1X in VS Code nRF Connect SDK.

Hi,

I am working on a project that involves using Time of Flight sensor VL53L1X with nRF9160. I have nRF9160DK and I am building my project in VS Code. 

I have tried adding following lines in prj.conf. 

CONFIG_I2C=y
CONFIG_NEWLIB_LIBC=y
CONFIG_SENSOR=y
CONFIG_DT_HAS_ST_VL53L0X_ENABLED=y
CONFIG_VL53L0X=y
CONFIG_VL53L0X_PROXIMITY_THRESHOLD=100
When I compile the project I am getting error w.r.t "CONFIG_DT_HAS_ST_VL53L0X_ENABLED." Below is the error message.
"error: DT_HAS_ST_VL53L0X_ENABLED (defined at
C:/nordicsemi/MyApps/TESTAppV0.1/build_1/Kconfig/Kconfig.dts:4962) is assigned in a configuration
file, but is not directly user-configurable (has no prompt). It gets its value indirectly from other
symbols. See docs.zephyrproject.org/.../kconfig.html
and/or look up DT_HAS_ST_VL53L0X_ENABLED in the menuconfig/guiconfig interface. The Application
Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of
the manual might be helpful too."
Kindly help me to solve this issue. 
 
Parents Reply Children
  • Hi,

    I based it on your configurations, as they are for VL53L0X.

    I have tried adding following lines in prj.conf. 

    CONFIG_I2C=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_SENSOR=y
    CONFIG_DT_HAS_ST_VL53L0X_ENABLED=y
    CONFIG_VL53L0X=y
    CONFIG_VL53L0X_PROXIMITY_THRESHOLD=100

    There is support for the VL53L1X, see st,vl53l1x (on i2c bus). This was added recently, so it is only on the main branch of nRF Connect SDK currently. The configs and devicetree will be very similar to vl53l0x:

    CONFIG_I2C=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_SENSOR=y
    CONFIG_VL53L1X=y

    &i2c2 {
        vl53l1x: vl53l1x@30 {
        compatible = "st,vl53l1x";
        reg = <0x30>;
        };
    };

    Best regards,
    Marte

Related