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
  • Hi,

    The Kconfig option CONFIG_DT_HAS_ST_VL53L0X_ENABLED cannot be set in prj.conf. This option is automatically enabled when VL53L1X is enabled in devicetree.
    To fix this, remove CONFIG_DT_HAS_ST_VL53L0X_ENABLED and create a devicetree overlay file where you add VL53L1X. It should look something like this, make sure to set correct I2C and reg for your project:

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

    Best regards,
    Marte

Reply
  • Hi,

    The Kconfig option CONFIG_DT_HAS_ST_VL53L0X_ENABLED cannot be set in prj.conf. This option is automatically enabled when VL53L1X is enabled in devicetree.
    To fix this, remove CONFIG_DT_HAS_ST_VL53L0X_ENABLED and create a devicetree overlay file where you add VL53L1X. It should look something like this, make sure to set correct I2C and reg for your project:

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

    Best regards,
    Marte

Children
Related