Hello,
I am trying to integrate the LSM6DSM into the jetson nano dev board. I followed the steps included in the STM driver kernel image README: https://github.com/STMicroelectronics/STMems_Linux_IIO_drivers/tree/linux-4.9.y-gh.
- I have added the driver files into kernel-4.9/drivers/iio/imu
- I have edited the Kconfig to include the IMU driver option
- I have updated the defconfig file to flag the Kconfig option as m
- I have updated the device tree as the following
i2c@7000c500 {
status = “ok”;
imu: lsm6dsm@6a {
compatible = “st,lsm6dsm”;
reg = <0x6a>;
interrupts = <&gpio TEGRA_GPIO(Y, 2) IRQ_TYPE_LEVEL_HIGH>;
};
- I flashed the board with the updated files
From this, I have the following messages from dmesg:
nvidia@nn-123:~$ dmesg | grep lsm
[ 1.838885] st-lsm6dsm-i2c 2-006a: DRDY not available, curernt implementation needs irq!
[ 1.838894] st-lsm6dsm-i2c: probe of 2-006a failed with error -22
It seems like the driver loads but is not recognizing the interrupt in the device tree. Any ideas on how to resolve this issue?
Thank you,
Ben
Have try to modify the interrupt like below.
interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(Y, 2) IRQ_TYPE_LEVEL_HIGH>;
I made that change to the DTB. The device no longer completes a boot and I have this on the serial debug output:
Starting kernel …
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.140-hawkware (ben@X112) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) ) #1 SMP PREEMPT Tue Dec 8 14:52:58 EST 2020
[ 0.000000] Boot CPU: AArch64 Processor [411fd071]
[ 0.000000] OF: fdt:memory scan node memory@80000000, reg size 48,
[ 0.000000] OF: fdt: - 80000000 , 7ee00000
[ 0.000000] OF: fdt: - 100000000 , 7f200000
[ 0.000000] earlycon: uart8250 at MMIO32 0x0000000070006000 (options ‘’)
[ 0.000000] bootconsole [uart8250] enabled
[ 1.021461] tegradc tegradc.1: dpd enable lookup fail:-19
[ 1.527547] Host read timeout at address 545c00c4
[ 1.773030] imx219 7-0010: imx219_board_setup: error during i2c read probe (-121)
[ 1.780586] imx219 7-0010: board setup failed
[ 1.808924] imx219 8-0010: imx219_board_setup: error during i2c read probe (-121)
[ 1.816449] imx219 8-0010: board setup failed
[ 2.086105] Unable to handle kernel read from unreadable memory at virtual address 00000040
[ 2.094642] Mem abort info:
[ 2.097443] ESR = 0x96000005
[ 2.100507] Exception class = DABT (current EL), IL = 32 bits
[ 2.106429] SET = 0, FnV = 0
[ 2.109475] EA = 0, S1PTW = 0
[ 2.112630] Data abort info:
[ 2.115520] ISV = 0, ISS = 0x00000005
[ 2.119356] CM = 0, WnR = 0
[ 2.122326] [0000000000000040] user address but active_mm is swapper
[ 2.128678] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 2.134240] Modules linked in:
[ 2.137297] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.140-hawkware #1
[ 2.144071] Hardware name: NVIDIA Jetson Nano Developer Kit (DT)
[ 2.150066] task: ffffffc0fa6f0000 task.stack: ffffffc0fa66c000
[ 2.155979] PC is at sysfs_create_link+0x28/0x68
[ 2.160590] LR is at iio_device_register+0x5d0/0x6c0
[ 2.165543] pc : [] lr : [] pstate: 20400045
[ 2.172924] sp : ffffffc0fa66fad0
[ 2.176230] x29: ffffffc0fa66fad0 x28: ffffffc0f7b2a800
[ 2.181547] x27: ffffff80090a88e8 x26: 0000000000000010
[ 2.186863] x25: 0000000000000000 x24: ffffffc0f7f7f3b0
[ 2.192175] x23: ffffffc0f7ca2380 x22: ffffffc0f7f7f010
[ 2.197490] x21: ffffff8009506790 x20: ffffffc0f7f7f020
[ 2.202806] x19: 0000000000000010 x18: 0000000000000000
[ 2.208119] x17: 0000000000000003 x16: 0000000000000000
[ 2.213433] x15: 000000000000000b x14: ffffffc0f7d9791c
[ 2.218747] x13: ffffffc0f7d97196 x12: 0000000000000018
[ 2.224061] x11: 0000000000000400 x10: 0000000000000000
[ 2.229376] x9 : 00000000007cbd1a x8 : 0000000000000400
[ 2.234690] x7 : 0000000000002c00 x6 : ffffffc0f79b7840
[ 2.240003] x5 : ffffffc0fa6f0000 x4 : ffffffc0fefc1120
[ 2.245315] x3 : ffffffc0f9478800 x2 : ffffff8009506790
[ 2.250629] x1 : ffffffc0f7f7f020 x0 : ffffff8008cd2790
[ 2.255943]
[ 2.257428] Process swapper/0 (pid: 1, stack limit = 0xffffffc0fa66c000)
[ 2.264115] Call trace:
[ 2.266556] [] sysfs_create_link+0x28/0x68
[ 2.272205] [] iio_device_register+0x5d0/0x6c0
[ 2.278201] [] st_lsm6dsm_common_probe+0x724/0x850
[ 2.284543] [] st_lsm6dsm_i2c_probe+0x60/0xa0
[ 2.290453] [] i2c_device_probe+0x144/0x258
[ 2.296189] [] driver_probe_device+0xd8/0x408
[ 2.302097] [] __driver_attach+0xdc/0x128
[ 2.307658] [] bus_for_each_dev+0x5c/0xa8
[ 2.313218] [] driver_attach+0x30/0x40
[ 2.318520] [] bus_add_driver+0x20c/0x2a8
[ 2.324081] [] driver_register+0x6c/0x110
[ 2.329642] [] i2c_register_driver+0x4c/0xb0
[ 2.335465] [] st_lsm6dsm_driver_init+0x18/0x20
[ 2.341548] [] do_one_initcall+0x44/0x130
[ 2.347111] [] kernel_init_freeable+0x1a0/0x244
[ 2.353195] [] kernel_init+0x18/0x108
[ 2.358408] [] ret_from_fork+0x10/0x30
[ 2.363713] —[ end trace f88b29066ce0c621 ]—
[ 2.373603] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 2.373603]
[ 2.382727] SMP: stopping secondary CPUs
[ 2.386697] Kernel Offset: disabled
[ 2.390179] Memory Limit: none
[ 2.398393] Rebooting in 5 seconds…
I will continue to investigate to try get to the bottom of it. It does seem to be an issue with probing the lsm6dsm device
Have a check below patch was in your current release kernel source.