I am following your youtube channel for Zephyr.

I am using nrf Connect’s LIS2DH example and trying to learn how to add motion interrupt.

When I add “CONFIG_LIS2DH_TRIGGER_GLOBAL_THREAD=y” line in prj.conf file, I get this warning: CONFIG_LIS2DH_TRIGGER_GLOBAL_THREAD was assigned the value y, but got the value n. Missing dependencies:<choice LIS2DH_TRIGGER_MODE>.

Can you please help? What am I missing here? I am a newbie in the Zephyr world.

Best,
Ashish

    config LIS2DH_TRIGGER_GLOBAL_THREAD
    	bool "Use global thread"
    	depends on GPIO
    	select LIS2DH_TRIGGER

    I guess, you need to enable GPIO as well. Or provide your “complete conf” along with the NCS version you’re using to see, what’s missing.
    if your interested in more information about using the LIS2DH, you may read my comment . The bindings has been improved and if you read the “app-notes” (see my comment) you will learn a lot about that LIS2DH. In my case, enabling the filter as well instead of using a pretty high threshold was the config, which made it working for my case.

    Thank for helping me out here.

    My nRF Connect is v2.3.0. Zephyr version is 3.2.99.

    I cloned https://github.com/circuitdojo/nrf9160-feather-examples-and-drivers as Jared mentioned. When trying to use accelerometer example, I am still getting warning for lines:
    CONFIG_LIS2DH=y
    CONFIG_LIS2DH_TRIGGER_GLOBAL_THREAD=y

    Here is complete proj.conf file in accelerometer folder:
    ' General
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

    Adding I2C
    CONFIG_I2C=y

    Add the accelerometer
    CONFIG_SENSOR=y
    CONFIG_LIS2DH=y
    CONFIG_LIS2DH_TRIGGER_GLOBAL_THREAD=y
    CONFIG_BOOTLOADER_MCUBOOT=y`

    I checked Kconfig file for lis2dh in folder zephyr\drivers\sensor\lis2dh. It does have “depends on GPIO”:
    config LIS2DH_TRIGGER_GLOBAL_THREAD
    bool “Use global thread”
    depends on GPIO
    select LIS2DH_TRIGGER

    Yea make sure that CONFIG_GPIO=y and your overlay/board is configure to use GPIO interrupts for the LIS2Dh

    I checked Kconfig file for lis2dh in folder zephyr\drivers\sensor\lis2dh. It does have “depends on GPIO”:

    Yes, that “depends on GPIO” defines, that you need to enable GPIO in order to enable LIS2DH_TRIGGER_GLOBAL_THREAD. GPIO should be usually enabled, but though you don’t provide the exact error message, it’s hard to see, what is wrong.
    What do you get if you enable LIS2DH_TRIGGER_NONE instead of LIS2DH_TRIGGER_GLOBAL_THREAD? That means “no wakeup” and doesn’t really work in your case but may help to find the cause of your issues. And please provide the build/error-logs.

    Terms and Conditions | Privacy Policy