cancel
Showing results for 
Search instead for 
Did you mean: 

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

NHuhs.2394
Associate II

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 discussion is locked. Please start a new topic to ask your question.
7 REPLIES 7
PatrickF
ST Employee

Hello,

this could help you : https://bootlin.com/blog/building-a-linux-system-for-the-stm32mp1-connecting-an-i2c-sensor/

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
NEW ! Sidekick STM32 AI agent, see here
NHuhs.2394
Associate II

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

PatrickF
ST Employee

This might help you : https://wiki.st.com/stm32mpu/wiki/How_to_integrate_the_IKS01A2_expansion_board_with_STM32MP157C-DK2

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
NEW ! Sidekick STM32 AI agent, see here
NHuhs.2394
Associate II

Unfortunately still no success.

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

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

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
NEW ! Sidekick STM32 AI agent, see here

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

okay after rebuilding the kernel from the beginning one last time it worked somehow.

No idea what was causing the problem. I just did everything as before, added the changes to the device trees and the driver is added as a module.

Anyway thanks for taking your time to help me.