Skip to main content
Visitor II
December 6, 2019
Question

Why does Linux Kernel not apply ST-sensor driver to pressure sensor?

  • December 6, 2019
  • 4 replies
  • 2735 views

I connected an external sensor via i2c and modified the device tree dk2 with following addition:

&i2c5 {
	status = "okay";
	clock-frequency = <100000>;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&i2c5_pins_a>;
	pinctrl-1 = <&i2c5_pins_sleep_a>;
	
	pressure@5c{
		compatible = "st,lps22hb-press";
		reg = <0x5c>;
		vdd-supply = <&v3v3>;
		
};
 

I am able to see the sensor on the correct address in the register but the kernel doesnt seem to recognize it as a st pressure sensor. Its also not shown in the list of iio.

I also modified the device tree dk1 like this:

&i2c5 {
	status = "okay";
	clock-frequency = <100000>;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&i2c5_pins_a>;
	pinctrl-1 = <&i2c5_pins_sleep_a>;
}

the sensor is the correct one btw.

edit:

I also checked in the config that ST-sensor-Drivers are activated before building.

    This topic has been closed for replies.

    4 replies

    Technical Moderator
    December 6, 2019
    Visitor II
    December 9, 2019

    Hi Patrick,

    thanks for your answer but that is exactly the documentation I used to get to the point where I am now.

    It worked perfectly up to the point "Describing the BME280 in the Device Tree".

    the "compatible" string should be correct as I copied it directly from the list of compatible strings in the st-sensors.txt.

    p.s.: The sensor is located on a waveshare sense-hat which is connected via i2c. could that be a problem?

    best regards,

    Niklas

    Technical Moderator
    December 9, 2019
    Visitor II
    December 10, 2019

    Unfortunately still no success.

    I'll try using a different sensor to see if results are different there.

    Technical Moderator
    December 10, 2019

    Did you check the kernel configuration using: cat /proc/config.gz | gunzip | grep ST_PRESS

    Visitor II
    December 10, 2019

    yes I did. everything is enabled. I also tried enabling it with <*> in menuconfig instead of building it as a module but same results