hello dear support
I am trying to add an lm75 device driver to device tree overlays and did something like this:
/plugin/; //it is important for overlays!
//#include "imx6qdl.dtsi" NOT ALLOWED to include other lower dtb layer "boot stick alert!" !!
#include "imx6dl-pinfunc.h"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
/ {
model = "Toradex Colibri iMX6DL/S on Colibri Board Ver 1.0.0 ";
compatible = "toradex,colibri_imx6dl" , "toradex,colibri_imx6dl-eval-v3" , "fsl,imx6dl";
aliases {
// i2c2 = &i2c3; //no need these aliases because of defineing in lower dbt files
// rtc0 = &rtc_i2c;
// rtc1 = "/soc/aips-bus@02000000/snvs@020cc000/snvs-rtc-lp@34";
};
// wakeup {
// label = "Wake-Up";
// gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>;
// linux,code = <KEY_WAKEUP>;
// debounce-interval = <10>;
// gpio-key,wakeup;
// };
// };
};
&i2c3 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
lm75b@48 {
compatible = "national,lm75b", "national,lm75", "national,lm75a";
reg = <0x48>;
status = "okay";
};
};
everything looks fine and my imx6 boot successfully but the driver doesn’t seems to be loaded correctly and shows me:
root@colibri-imx6-14972041:~# i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
what is wrong with me?
appreciate your support…
I am using:
colibri IMX6dl with iris career board / bsp6.2
Hello @me_ahani98,
Thanks for reaching out! Your device tree overlay looks correct to me.
Have you enabled the module for LM75 driver in the kernel source? Otherwise, it wouldn’t work. By default, this driver is not enabled in the configurations for the upstream kernel for BSP 6. Please see the attached image to see what it looks like on the upstream kernel.
After you have enabled it, you will have to compile and deploy the kernel module. This is documented well in this article: Build Linux Kernel from Source Code | Toradex Developer Center
thanks for your quick response dear friend
I will check it and notify the result
wish you the bests
hello again dear friend
I have followed “Build Linux Kernel from Source Code | Toradex Developer Center” and downloaded “https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/snapshot/linux-6.2.y.tar.gz” then started to compiling my image
everything seemed to be fine
then I tried to deploy it using “Build Linux Kernel from Source Code | Toradex Developer Center”
my image was written correctly but it is hanging during boot and shows me :
[ 23.441885] usb0: HOST MAC ee:72:f7:61:60:ba
[ 23.446799] usb0: MAC 52:3b:73:8b:0c:28
[ 23.470312]
[ 23.471867] ============================================
[ 23.477223] WARNING: possible recursive locking detected
[ 23.482573] 6.2.16 #2 Not tainted
[ 23.485920] --------------------------------------------
[ 23.491272] echo/477 is trying to acquire lock:
[ 23.495838] c4760aec (&udc->connect_lock){+.+.}-{3:3}, at: usb_udc_vbus_handler+0x1c/0x3c
[ 23.504123]
[ 23.504123] but task is already holding lock:
[ 23.509997] c4760aec (&udc->connect_lock){+.+.}-{3:3}, at: gadget_bind_driver+0xa0/0x1cc
[ 23.518179]
[ 23.518179] other info that might help us debug this:
[ 23.524748] Possible unsafe locking scenario:
[ 23.524748]
[ 23.530705] CPU0
[ 23.533173] ----
[ 23.535643] lock(&udc->connect_lock);
[ 23.539520] lock(&udc->connect_lock);
[ 23.543397]
[ 23.543397] *** DEADLOCK ***
[ 23.543397]
[ 23.549357] May be due to missing lock nesting notation
[ 23.549357]
[ 23.556206] 6 locks held by echo/477:
[ 23.559906] #0: c45de284 (sb_writers#11){.+.+}-{0:0}, at: ksys_write+0x60/0xec
[ 23.567326] #1: c535ef50 (&buffer->mutex){+.+.}-{3:3}, at: configfs_write_iter+0x24/0x110
[ 23.575733] #2: c4e6b5c0 (&p->frag_sem){.+.+}-{3:3}, at: configfs_write_iter+0x88/0x110
[ 23.584009] #3: c425e5c8 (&gi->lock){+.+.}-{3:3}, at: gadget_dev_desc_UDC_store+0x58/0xf0
[ 23.592419] #4: c472444c (&dev->mutex){....}-{3:3}, at: __driver_attach+0x60/0x104
[ 23.600210] #5: c4760aec (&udc->connect_lock){+.+.}-{3:3}, at: gadget_bind_driver+0xa0/0x1cc
[ 23.608865]
[ 23.608865] stack backtrace:
[ 23.613302] CPU: 0 PID: 477 Comm: echo Not tainted 6.2.16 #2
[ 23.619030] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[ 23.625625] unwind_backtrace from show_stack+0x10/0x14
[ 23.630969] show_stack from dump_stack_lvl+0x58/0x70
[ 23.636135] dump_stack_lvl from __lock_acquire+0x8a4/0x27cc
[ 23.641901] __lock_acquire from lock_acquire+0x108/0x344
[ 23.647408] lock_acquire from __mutex_lock+0x88/0xeec
[ 23.652680] __mutex_lock from mutex_lock_nested+0x1c/0x24
[ 23.658289] mutex_lock_nested from usb_udc_vbus_handler+0x1c/0x3c
[ 23.664592] usb_udc_vbus_handler from ci_udc_start+0x74/0x98
[ 23.670456] ci_udc_start from gadget_bind_driver+0xc0/0x1cc
[ 23.676228] gadget_bind_driver from really_probe+0xc4/0x2b8
[ 23.681959] really_probe from __driver_probe_device+0x84/0x194
[ 23.687944] __driver_probe_device from driver_probe_device+0x2c/0xd0
[ 23.694447] driver_probe_device from __driver_attach+0x6c/0x104
[ 23.700516] __driver_attach from bus_for_each_dev+0x74/0xc0
[ 23.706235] bus_for_each_dev from bus_add_driver+0x154/0x1e8
[ 23.712033] bus_add_driver from driver_register+0x74/0x10c
[ 23.717662] driver_register from usb_gadget_register_driver_owner+0x40/0xd4
[ 23.724771] usb_gadget_register_driver_owner from gadget_dev_desc_UDC_store+0xbc/0xf0
[ 23.732760] gadget_dev_desc_UDC_store from configfs_write_iter+0xac/0x110
[ 23.739698] configfs_write_iter from vfs_write+0x2cc/0x480
[ 23.745322] vfs_write from ksys_write+0x60/0xec
[ 23.749985] ksys_write from ret_fast_syscall+0x0/0x1c
[ 23.755169] Exception stack(0xe1115fa8 to 0xe1115ff0)
[ 23.760262] 5fa0: 0000000a 01f081c0 00000001 01f081c0 0000000a 00000000
[ 23.768494] 5fc0: 0000000a 01f081c0 b6fbc220 00000004 0000000a 00000001 00000000 b6f7f384
[ 23.776724] 5fe0: 00000004 bec10b88 b6f10527 b6e91ae6
[ OK ] Started Hostname Service.
[ OK ] Finished set-hostname.service.
[ OK ] Reached target Preparation for Network.
Starting Connection service...
[ OK ] Started Connection service.
Starting Avahi mDNS/DNS-SD Stack...
Starting WPA supplicant...
[ OK ] Started Avahi mDNS/DNS-SD Stack.
[ 24.471804] Micrel KSZ8041 2188000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:00, irq=POLL)
[ OK ] Started WPA supplicant.
[* ] A start job is running for Load def… schema g1.schema (55s / no limit)
[** ] A start job is running for Load def…ma g1.schema (9min 54s / no limit)
what is wrong with me now??
I have found my solution
I had to download kernel v6.1