I get a compile error at:
const struct device *const dev = DEVICE_DT_GET_ONE(st_lsm6dso32); //compile error

If I replace that line with the following everything else compiles.
const struct device *const dev = NULL; // this compiles…

It’s just the unmodified LSM6DSO32 Sample except for the additional overlay file.

my LSM6DSO32 Zephyr Sample

    Hi @mjordan you need likely need to create an entry in a board overlay if st_lsm6dso32 does not exist. You may be able to search the Zephyr repo for an example. Make sure you configure your pins correctly.

      jaredwolff Thanks for your reply. I learned that from your pin control and LIS2DH videos. I thought I had it correct. This is what I wrote…

      &pinctrl {
          i2c1_default: i2c1_default {
             group1 {
                psels = <NRF_PSEL(TWIM_SDA, 0, 30)>,
                   <NRF_PSEL(TWIM_SCL, 0, 31)>;
                  //  bias-pull-up;  //yellow squiggle???
             };
          };
          i2c1_sleep: i2c1_sleep {
             group1 {
                psels = <NRF_PSEL(TWIM_SDA, 0, 30)>,
                   <NRF_PSEL(TWIM_SCL, 0, 31)>;
                      //   low-power-enable; //yellow squiggle???
             };
          };
       };
      
       &i2c1 {
          compatible = "nordic,nrf-twim";
          // compatible = "i2c-device";
          status = "okay";
          /* default state */
          pinctrl-0 = <&i2c1_default>;
          /* sleep state (only applicable if CONFIG_PM_DEVICE=y) */
          pinctrl-1 = <&i2c1_sleep>;
          /* state assigned to each pinctrl-N property by index */
          pinctrl-names = "default", "sleep";
          clock-frequency = <I2C_BITRATE_STANDARD>;
      
          lsm6dso32: lsm6dso32@18 {
              compatible = "st,lsm6dso32";
              status = "okay";
              label = "lsm6dso32";
              reg = <0x18>;
          };
       };

        At first glance seems ok.

        Have you tried putting your overlay file in an boards folder? I don’t think Zephyr will pick it up in your app’s base directory

          I was wondering about that. I should have tested it… I got a response from Nordic suggesting the following, which compiled, but it’s unclear if the device will actually work with these setting/driver. I have one on order to test…

          I made the changes to the overlay in the base directory and it appears to have picked up the change, so it seems Zephyr will tolerate overlay files in the base directory.

          It surprises me that there would be a devicetree definition without a driver… Seems both are required to do anything useful. But, I don’t fully understand everything behind the curtain…

          Nordic Dev Zone:
          _I think you get this error because it can’t find any driver for the device.

          I can’t find any driver implementation for LSM6DSO32, although it has a devicetree definition, and there seems to be no reference to this in the Kconfig reference.

          Adding “CONFIG_LSM6DSO=y” in the prj.conf, chanding DT overlay to "compatible = “st,lsm6dso”;" and changing main() to “DEVICE_DT_GET_ONE(st_lsm6dso);” resolves the build errors on my end, but I do not have the device to test if the application works with these changes._

            10 months later

            Closing the loop on this discussion as I am using this part now.
            To use lsm6dso32 instead of lsm6dso, simply add another compatibility flag to your overlay

            
            lsm6dso: spi-dev-lsm6dso@0 {
            		compatible = "st,lsm6dso","st,lsm6dso32";
            		spi-max-frequency = <8000000>;
            		reg = <0>;
                    irq-gpios = <&gpio0 19 0>, <&gpio0 23 0>;
            	};
            Terms and Conditions | Privacy Policy