2019-12-06 03:22 AM
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.
2019-12-06 07:33 AM
Hello,
this could help you : https://bootlin.com/blog/building-a-linux-system-for-the-stm32mp1-connecting-an-i2c-sensor/
2019-12-09 12:53 AM
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
2019-12-09 04:55 AM
This might help you : https://wiki.st.com/stm32mpu/wiki/How_to_integrate_the_IKS01A2_expansion_board_with_STM32MP157C-DK2
2019-12-10 01:54 AM
Unfortunately still no success.
I'll try using a different sensor to see if results are different there.
2019-12-10 02:21 AM
Did you check the kernel configuration using: cat /proc/config.gz | gunzip | grep ST_PRESS
2019-12-10 02:39 AM
yes I did. everything is enabled. I also tried enabling it with <*> in menuconfig instead of building it as a module but same results
2019-12-10 04:48 AM
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.