Using LSM6DSO sensor on NRF52832

Hello, 

I'm new to pretty much all of this, but I'll do my best to explain my issue. As the title says, I'm currently trying to get a LSM6DSO sensor to work with the NRF52832 board. I'm using the Nordic sample code for LSM6DSO and using VSCode to build it for the NRF52832. I was having issues with the devicetree not being able to find the sensor using DEVICE_DT_GET_ONE (this function initially returned a negative value), so I added an extra overlay file: 

arduino_i2c: &i2c0 {
    lsm6dso@6a {
        compatible = "st,lsm6dso";
        label = "LSM6DSO";
        reg = <0x6a>;
    };
};
This seemed to fix the issue. The only other thing I changed from the base project code was adding the lines
CONFIG_LOG=y
CONFIG_LOG_PRINTK=y
to my prj.conf file so that I could log any errors.
I've fully connected the sensor to the board and have verified the connections are correct using a colleagues code, so I don't think the connections are the issue. When I build and flash the code, this is the output I get:
As I said, I'm fairly new to how Nordic organizes code and devicetree, so I'm really just not sure what to do from here. Obviously, the code is running through its main function, but it gets an error when it tries to test the trigger mode. I believe the sample code is supposed to work with an ST board, so I think getting this code to work is just a matter of making small changes to the overlay files or the configuration files, although I could easily be wrong.
Any advice would be greatly appreciated, and let me know if I can provide any more information that might help. Thank you!
Parents
  • I was in your position about half an hour ago. I believe trigger mode is flagged as unsupported because you haven't specified the trigger pin in your overlay. The error message is resolved for me when I specify int-pin and irq-gpios (with int-pin being either 1 or 2, and selecting between the first and second listed IRQ GPIO):

    &spi1 {
    	status = "okay";
    	cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>,
    			   <&gpio1 11 GPIO_ACTIVE_LOW>;
    	pinctrl-0 = <&spi1_default>;
    	lsm6dso@0 {
    		compatible = "st,lsm6dso";
    		reg = <0x0>;
    		spi-max-frequency = <8000000>;
            status = "okay";
    		irq-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>, <&gpio1 13 GPIO_ACTIVE_HIGH>;
            int-pin = <1>;
    	};
    };

  • Thank you for the response. So the changes I would need to make to my overlay file are to add something like 

            status = "okay";
    		irq-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>, <&gpio1 13 GPIO_ACTIVE_HIGH>;
            int-pin = <1>;

    to my overlay file? In your example, it looks like you're using spi whereas I'm using I2C. I also see that you specified pins 12 and 13 as the irq-gpios. For me, would those be the same pins as I'm using for the I2C connections (26 and 27)? Thanks!

  • I played around with a few combinations and am still getting the same error.

Reply Children
No Data
Related