Trying to get an overlay for a ST LSM303DLM (ACC+MAG) running but that is causing me issues.
Overlay compiles and loads successful. Nevertheless, no devices are created, no traces in the log that things go wrong.
Modules are enabled in the kernel ('Device Drivers > Industrial I/O support > Accelerometers > STMicroelectronics accelerometers 3-Axis I2C Interface' and 'Device Drivers > Industrial I/O support > Magnetometer sensors > STMicroelectronics magnetometers 3-Axis I2C Interface') but driver drivers don't get loaded.
The overlay in questionSouldn't I be able to see an IMU in evtest as well btw?
Overlay compiles and loads successful. Nevertheless, no devices are created, no traces in the log that things go wrong.
Modules are enabled in the kernel ('Device Drivers > Industrial I/O support > Accelerometers > STMicroelectronics accelerometers 3-Axis I2C Interface' and 'Device Drivers > Industrial I/O support > Magnetometer sensors > STMicroelectronics magnetometers 3-Axis I2C Interface') but driver drivers don't get loaded.
The overlay in question
Code:
/* * LSM303DLM is a system-in-package featuring a * 3D digital linear acceleration * and * 3D digital magnetic field detection sensor. * * https://www.st.com/en/mems-and-sensors/lsm303dlm.html * * aBUGsworstnighmare - rev 0r1 * lsm303dlm-overlay.dts */ /dts-v1/;/plugin/;#include <dt-bindings/interrupt-controller/irq.h>#include <dt-bindings/input/input.h>#include <dt-bindings/gpio/gpio.h>#include <dt-bindings/pinctrl/bcm2835.h>#include "i2c-buses.dtsi"/ {compatible = "brcm,bcm2835";fragment@0 {target = <&gpio>;__overlay__ {lsm303_pins: lsm303_pins {brcm,pins = <20 21>; // DRDY_M INT1brcm,function = <0 0>; // in inbrcm,pull = <0 0>; // none};};};fragment@1 {target = <&i2cbus>;__overlay__ {#address-cells = <1>;#size-cells = <0>;status = "okay";magnetometer: magnetometer@1e {compatible = "st,lsm303dlm-magn";reg = <0x1e>;pinctrl-names = "default";pinctrl-0 = <&lsm303_pins>;interrupt-parent = <&gpio>;interrupts = <20 IRQ_TYPE_EDGE_RISING>;interrupt-names = "mag@1e drdym";status = "okay";};accelerometer: accelerometer@18 {compatible = "st,lsm303dlm-accel";// SA0_A connected to GNDreg = <0x18>;pinctrl-names = "default";pinctrl-0 = <&lsm303_pins>;interrupt-parent = <&gpio>;interrupts = <21 IRQ_TYPE_EDGE_RISING>;interrupt-names = "acc@18 int1";status = "okay";};};};};
Code:
pi@Pi5-SN530:~/linux $ i2cdetect -li2c-1i2c Synopsys DesignWare I2C adapter I2C adapteri2c-13i2c 107d508200.i2c I2C adapteri2c-14i2c 107d508280.i2c I2C adapterpi@Pi5-SN530:~/linux $ ls /sys/bus/i2c/driversdummy stmpe-i2cpi@Pi5-SN530:~/linux $ sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f00: -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- 1e -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- pi@Pi5-SN530:~/linux $ dmesg -l warn,err[ 2.218315] nvme nvme0: failed to allocate host memory buffer.[ 2.667485] genirq: irq_chip rp1_irq_chip did not update eff. affinity mask of irq 106[ 4.765585] rpivid_hevc: module is from the staging directory, the quality is unknown, you have been warned.[ 4.803058] pispbe 1000880000.pisp_be: Runtime PM usage count underflow![ 5.045380] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator[ 5.045438] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
Statistics: Posted by aBUGSworstnightmare — Mon Mar 03, 2025 4:36 pm — Replies 3 — Views 64