jeremyb31 / bluetooth-5.15

5 stars 0 forks source link

Make fails while building drivers for TP-Link UB500 #1

Open rahul-kurup opened 1 year ago

rahul-kurup commented 1 year ago

Hey I executed make in this repo. It gives this error:

me@orangepi5:/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15$ make
make -C /lib/modules/5.10.110-rockchip-rk3588/build M=/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15 modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.110-rockchip-rk3588'
  CC [M]  /mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.o
In file included from /mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:25:
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c: In function 'btusb_recv_bulk_intel':
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btintel.h:177:34: error: implicit declaration of function 'hci_get_priv'; did you mean 'hci_get_irk'? [-Werror=implicit-function-declaration]
  177 |         (((struct btintel_data *)hci_get_priv(hdev))->flags)
      |                                  ^~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btintel.h:179:56: note: in expansion of macro 'btintel_get_flag'
  179 | #define btintel_test_flag(hdev, nr)     test_bit((nr), btintel_get_flag(hdev))
      |                                                        ^~~~~~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:2054:13: note: in expansion of macro 'btintel_test_flag'
 2054 |         if (btintel_test_flag(hdev, INTEL_BOOTLOADER))
      |             ^~~~~~~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btintel.h:177:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
error, forbidden warning:btintel.h:177
  177 |         (((struct btintel_data *)hci_get_priv(hdev))->flags)
      |           ^
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btintel.h:179:56: note: in expansion of macro 'btintel_get_flag'
  179 | #define btintel_test_flag(hdev, nr)     test_bit((nr), btintel_get_flag(hdev))
      |                                                        ^~~~~~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:2054:13: note: in expansion of macro 'btintel_test_flag'
 2054 |         if (btintel_test_flag(hdev, INTEL_BOOTLOADER))
      |             ^~~~~~~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c: In function 'btusb_recv_event_intel':
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btintel.h:177:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
error, forbidden warning:btintel.h:177
  177 |         (((struct btintel_data *)hci_get_priv(hdev))->flags)
      |           ^
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btintel.h:179:56: note: in expansion of macro 'btintel_get_flag'
  179 | #define btintel_test_flag(hdev, nr)     test_bit((nr), btintel_get_flag(hdev))
      |                                                        ^~~~~~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:2062:13: note: in expansion of macro 'btintel_test_flag'
 2062 |         if (btintel_test_flag(hdev, INTEL_BOOTLOADER)) {
      |             ^~~~~~~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c: In function 'btusb_send_frame_intel':
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btintel.h:177:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
error, forbidden warning:btintel.h:177
  177 |         (((struct btintel_data *)hci_get_priv(hdev))->flags)
      |           ^
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btintel.h:179:56: note: in expansion of macro 'btintel_get_flag'
  179 | #define btintel_test_flag(hdev, nr)     test_bit((nr), btintel_get_flag(hdev))
      |                                                        ^~~~~~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:2101:21: note: in expansion of macro 'btintel_test_flag'
 2101 |                 if (btintel_test_flag(hdev, INTEL_BOOTLOADER)) {
      |                     ^~~~~~~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c: In function 'btusb_mtk_setup':
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:2903:17: error: implicit declaration of function 'hci_set_aosp_capable'; did you mean 'lmp_transp_capable'? [-Werror=implicit-function-declaration]
 2903 |                 hci_set_aosp_capable(hdev);
      |                 ^~~~~~~~~~~~~~~~~~~~
      |                 lmp_transp_capable
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c: In function 'btusb_probe':
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:3863:16: error: implicit declaration of function 'hci_alloc_dev_priv'; did you mean 'hci_alloc_dev'? [-Werror=implicit-function-declaration]
 3863 |         hdev = hci_alloc_dev_priv(priv_size);
      |                ^~~~~~~~~~~~~~~~~~
      |                hci_alloc_dev
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:3863:14: warning: assignment to 'struct hci_dev *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
error, forbidden warning:btusb.c:3863
 3863 |         hdev = hci_alloc_dev_priv(priv_size);
      |              ^
In file included from /mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:25:
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btintel.h:160:46: warning: initialization of 'struct btintel_data *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
error, forbidden warning:btintel.h:160
  160 |                 struct btintel_data *intel = hci_get_priv((hdev));      \
      |                                              ^~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:3948:25: note: in expansion of macro 'btintel_set_flag'
 3948 |                         btintel_set_flag(hdev, INTEL_BROKEN_INITIAL_NCMD);
      |                         ^~~~~~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btintel.h:160:46: warning: initialization of 'struct btintel_data *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
error, forbidden warning:btintel.h:160
  160 |                 struct btintel_data *intel = hci_get_priv((hdev));      \
      |                                              ^~~~~~~~~~~~
/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.c:3951:25: note: in expansion of macro 'btintel_set_flag'
 3951 |                         btintel_set_flag(hdev, INTEL_BROKEN_SHUTDOWN_LED);
      |                         ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:273: /mnt/nvme/Backups/linux-rockchip/bluetooth-5.15/btusb.o] Error 1
make[1]: *** [Makefile:1920: /mnt/nvme/Backups/linux-rockchip/bluetooth-5.15] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.110-rockchip-rk3588'
make: *** [Makefile:6: all] Error 2
me@orangepi5:/mnt/nvme/Backups/linux-rockchip/bluetooth-5.15$ 

I'm guessing the issue is with: https://github.com/jeremyb31/bluetooth-5.15/blob/aaf90601a15de501d5d87d02007955da2250228e/btintel.h#L160

Can you help me here?


Device: OrangePi 5 OS: Armbian Jammy Kernel: 5.10.110-rockchip-rk3588

jeremyb31 commented 1 year ago

Can you upgrade to a 5.16 kernel as the patch should be included there?

rahul-kurup commented 1 year ago

I guess that might not be possible because OrangePi does not comes with any other kernel version except for the one mentioned above. Is there a workaround of sorts that can be achieved with the kernel that I have? For a fact, UB500 is detected properly, the only problem left is that it does not detect any devices while scanning. Thus I'm asking for a workaround.

jeremyb31 commented 1 year ago

Check the /lib/firmware/rtl_bt or equivalent folder to see if you have the firmware for rtl8761 as I have 5 different ones, they can be downloaded at https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtl_bt

Try compiling https://termbin.com/ndv8 save it as btusb.c into a new directory, you may be able to use this as a Makefile https://github.com/jeremyb31/bluetooth-5.15/blob/main/Makefile just remove the line obj-m += ath3k.o as it isn't needed

rahul-kurup commented 1 year ago

Great thanks. I'll try this and update you

jeremyb31 commented 1 year ago

Check to see if you have the firmware with locate rtl8761

rahul-kurup commented 1 year ago

Check the /lib/firmware/rtl_bt or equivalent folder

Seems to be missing

Try compiling https://termbin.com/ndv8 save it as btusb.c into a new directory, you may be able to use this as a Makefile https://github.com/jeremyb31/bluetooth-5.15/blob/main/Makefile just remove the line obj-m += ath3k.o as it isn't needed

This didn't work. it started throwing some error related to intel

Check to see if you have the firmware with locate rtl8761

Gives nothing in the output.

Download https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtl_bt and copy-paste in /lib/firmware/rtl_bt

I rebooted after downloading all the 5 files, from the above link. But still no device found in scan

jeremyb31 commented 1 year ago

Create a new test directory with https://termbin.com/ndv8 as btusb.c then copy https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/bluetooth/btbcm.h?h=v5.10.177 for btbcm.h https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/bluetooth/btintel.h?h=v5.10.177 btintel.h https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/bluetooth/btrtl.h?h=v5.10.177 btrtl.h You only want these 4 files in the directory along with the Makefile and that can simply be

KVER ?= $(shell uname -r) obj-m += btusb.o

all: make -C /lib/modules/$(KVER)/build M=$(PWD) modules

clean: make -C /lib/modules/$(KVER)/build M=$(PWD) clean

jeremyb31 commented 1 year ago

If nothing else download https://github.com/jeremyb31/bluetooth-5.15/raw/main/bluetooth.tar.gz and extract it into its own directory and try compiling it, this source code should match your kernel with my patch for the UB500 added to it. You should only need to copy the btusb.ko into the location of where the current btusb.ko is, it will be listed under filename in results for modinfo btusb

Then check dmesg | egrep -i 'blue|firm' to see what firmware files it wants

rahul-kurup commented 1 year ago

Create a new test directory with https://termbin.com/ndv8 as btusb.c then copy https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/bluetooth/btbcm.h?h=v5.10.177 for btbcm.h https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/bluetooth/btintel.h?h=v5.10.177 btintel.h https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/bluetooth/btrtl.h?h=v5.10.177 btrtl.h You only want these 4 files in the directory along with the Makefile and that can simply be

KVER ?= $(shell uname -r) obj-m += btusb.o

all: make -C /lib/modules/$(KVER)/build M=$(PWD) modules

clean: make -C /lib/modules/$(KVER)/build M=$(PWD) clean

image

PS: I appreciate your extensive support

jeremyb31 commented 1 year ago

I usually use this for a make command when building some modules

make -j4 -C /lib/modules/$(uname -r)/build M=$(pwd) modules

rahul-kurup commented 1 year ago

If nothing else download https://github.com/jeremyb31/bluetooth-5.15/raw/main/bluetooth.tar.gz and extract it into its own directory and try compiling it, this source code should match your kernel with my patch for the UB500 added to it. You should only need to copy the btusb.ko into the location of where the current btusb.ko is, it will be listed under filename in results for modinfo btusb

I have tried this solution before (the first issue itself in this thread) following one of the comments mentioned here for bluetooth-5.13

rahul-kurup commented 1 year ago

make -j4 -C /lib/modules/$(uname -r)/build M=$(pwd) modules

image
jeremyb31 commented 1 year ago

There is a problem in the Makefile, the formatting is off for the commands under all and clean, there needs to be a TAB before the make line so it looks like https://github.com/jeremyb31/bluetooth-5.15/blob/main/Makefile Screenshot from 2023-04-08 14-24-36

I am not sure if modules in orange pi are compressed or are simply .ko files like Debian and Ubuntu

I just made that bluetooth.tar.gz file today so it will not be on any forum. Going to test the code tags here to see if they preserve the correct formatting for the Makefile `KVER ?= $(shell uname -r) obj-m += btusb.o obj-m += ath3k.o

all: make -C /lib/modules/$(KVER)/build M=$(PWD) modules

clean: make -C /lib/modules/$(KVER)/build M=$(PWD) clean`

The code tags don't preserve the correct format of the text

rahul-kurup commented 1 year ago

btusb.ko exists in op5 as well. I finally got the build working properly, thanks for the formatting tip.

But unfortunately Blueman is not showing up now. It crashes as soon as I open it. Here's some dmesg info

image
jeremyb31 commented 1 year ago

What result for sudo cat /sys/kernel/debug/usb/devices | awk '/0604/' RS= and modinfo btusb

rahul-kurup commented 1 year ago
me@orangepi5:~$ sudo cat /sys/kernel/debug/usb/devices | awk '/0604/' RS=
[sudo] password for me: 
T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2357 ProdID=0604 Rev= 2.00
S:  Manufacturer= 
S:  Product=TP-Link UB500 Adapter
S:  SerialNumber=E848B8C82000
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms

me@orangepi5:~$ modinfo btusb
filename:       /lib/modules/5.10.110-rockchip-rk3588/kernel/drivers/bluetooth/btusb.ko
license:        GPL
version:        0.8
description:    Generic Bluetooth USB driver ver 0.8
author:         Marcel Holtmann <marcel@holtmann.org>
firmware:       mediatek/mt7668pr2h.bin
firmware:       mediatek/mt7663pr2h.bin
srcversion:     4950D508EE238EFA3A17295
alias:          usb:v8087p0A5Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0930p*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v413Cp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v13D3p*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v050Dp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v0B05p*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v0A5Cp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v04CAp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v0489p*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v0BB4p*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v105Bp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v19FFp0239d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v413Cp8197d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0C10p0000d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDBp1002d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v044Ep3002d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v044Ep3001d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BFp030Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v057Cp3800d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp8281d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp821Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp821Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp821Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp8218d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp8215d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp8213d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0A5Cp21E1d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E8Dp763Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v*p*d*dc*dsc*dp*icE0isc01ip01in*
alias:          usb:v*p*d*dcE0dsc01dp04ic*isc*ip*in*
alias:          usb:v*p*d*dcE0dsc01dp01ic*isc*ip*in*
alias:          of:N*T*Cusb4ca,301aC*
alias:          of:N*T*Cusb4ca,301a
alias:          of:N*T*Cusbcf3,e300C*
alias:          of:N*T*Cusbcf3,e300
alias:          of:N*T*Cusb1286,204eC*
alias:          of:N*T*Cusb1286,204e
depends:        
name:           btusb
vermagic:       5.10.110-rockchip-rk3588 SMP mod_unload modversions aarch64
parm:           disable_scofix:Disable fixup of wrong SCO buffer size (bool)
parm:           force_scofix:Force fixup of wrong SCO buffers size (bool)
parm:           enable_autosuspend:Enable USB autosuspend by default (bool)
parm:           reset:Send HCI reset command on initialization (bool)
me@orangepi5:~$ 
jeremyb31 commented 1 year ago

Did you copy your compiled btusb.ko to /lib/modules/5.10.110-rockchip-rk3588/kernel/drivers/bluetooth/btusb.ko You may have to rename the original first to keep the new one from becoming btusb.ko.1 or something

rahul-kurup commented 1 year ago

Yes this is the copied version itself.

sudo mv /lib/modules/$(uname -r)/kernel/drivers/bluetooth/btusb.ko /lib/modules/$(uname -r)/kernel/drivers/bluetooth/btusb.ko.bak
sudo cp btusb.ko /lib/modules/$(uname -r)/kernel/drivers/bluetooth/
sudo depmod -a

Tomorrow I'll try to build from this repo directly by cherry-picking those 4 files only and see if it works or not

jeremyb31 commented 1 year ago

You really want to use what is in the https://github.com/jeremyb31/bluetooth-5.15/raw/main/bluetooth.tar.gz as source since it actually is what your kernel is based on. Once extracted open btusb.c in a text editor and change the module version from 0.8 to 0.9 before compiling and it will be easier to see when the updated btusb.ko is being used with modinfo. I know using the same version will cause dkms installs to fail.

Check lsmod | grep blue and see if btusb is loaded, then try> sudo modprobe -v btusb

rahul-kurup commented 1 year ago

You really want to use what is in the https://github.com/jeremyb31/bluetooth-5.15/raw/main/bluetooth.tar.gz as source since it actually is what your kernel is based on. Once extracted open btusb.c in a text editor and change the module version from 0.8 to 0.9 before compiling and it will be easier to see when the updated btusb.ko is being used with modinfo. I know using the same version will cause dkms installs to fail.

Check lsmod | grep blue and see if btusb is loaded, then try> sudo modprobe -v btusb sudo modprobe -v btusb

I used the above given source, cherry picked those 4 files and compiled them. There was no error compilation. Then I moved btusb.ko to bluetooth folder and rebooted the device. And then:

me@orangepi5: lsmod | grep blue
me@orangepi5: sudo modprobe -v btusb
[sudo] password for me: 
insmod /lib/modules/5.10.110-rockchip-rk3588/kernel/drivers/bluetooth/btusb.ko 
modprobe: ERROR: could not insert 'btusb': Exec format error
me@orangepi5: ls /lib/modules/5.10.110-rockchip-rk3588/kernel/drivers/bluetooth
ath3k.ko  bcm203x.ko  bfusb.ko  bpa10x.ko  btbcm.ko  btintel.ko  btmrvl.ko  btmtksdio.ko  btrtl.ko  btsdio.ko  btusb.ko  btusb.ko.bak  hci_uart.ko  hci_vhci.ko  rtk_btusb.ko
me@orangepi5: 

I executed ls in the drivers folder and saw rtk_btusb.ko along with btusb.ko. Not sure if they are related

me@orangepi5:~$ ls /lib/modules/5.10.110-rockchip-rk3588/kernel/drivers/bluetooth | grep btusb
btusb.ko
btusb.ko.bak
rtk_btusb.ko
me@orangepi5:~$ 
jeremyb31 commented 1 year ago

any results for> dmesg | grep btusb

rahul-kurup commented 1 year ago

me@orangepi5:~$ dmesg | grep btusbesg | grep btusb
[   19.512063] btusb: disagrees about version of symbol module_layout
[   19.512182] btusb: disagrees about version of symbol module_layout
[   19.512298] btusb: disagrees about version of symbol module_layout
[   19.512496] btusb: disagrees about version of symbol module_layout
me@orangepi5:~$ 
jeremyb31 commented 1 year ago

What result for> modinfo btusb

rahul-kurup commented 1 year ago

I added "Custom" in description


me@orangepi5:~$ modinfo btusb
filename:       /lib/modules/5.10.110-rockchip-rk3588/kernel/drivers/bluetooth/btusb.ko
license:        GPL
version:        0.9
description:    Custom Bluetooth USB driver ver 0.9
author:         Marcel Holtmann <marcel@holtmann.org>
firmware:       mediatek/mt7668pr2h.bin
firmware:       mediatek/mt7663pr2h.bin
srcversion:     1C950C1664787D5263DEA6A
alias:          usb:v8087p0A5Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0930p*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v413Cp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v13D3p*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v050Dp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v0B05p*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v0A5Cp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v04CAp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v0489p*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v0BB4p*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v105Bp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v19FFp0239d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v413Cp8197d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0C10p0000d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDBp1002d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v044Ep3002d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v044Ep3001d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04BFp030Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v057Cp3800d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp8281d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp821Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp821Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp821Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp8218d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp8215d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp8213d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0A5Cp21E1d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E8Dp763Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v05ACp*d*dc*dsc*dp*icFFisc01ip01in*
alias:          usb:v*p*d*dc*dsc*dp*icE0isc01ip01in*
alias:          usb:v*p*d*dcE0dsc01dp04ic*isc*ip*in*
alias:          usb:v*p*d*dcE0dsc01dp01ic*isc*ip*in*
alias:          of:N*T*Cusb4ca,301aC*
alias:          of:N*T*Cusb4ca,301a
alias:          of:N*T*Cusbcf3,e300C*
alias:          of:N*T*Cusbcf3,e300
alias:          of:N*T*Cusb1286,204eC*
alias:          of:N*T*Cusb1286,204e
depends:        
name:           btusb
vermagic:       5.10.110-rockchip-rk3588 SMP mod_unload modversions aarch64
parm:           disable_scofix:Disable fixup of wrong SCO buffer size (bool)
parm:           force_scofix:Force fixup of wrong SCO buffers size (bool)
parm:           enable_autosuspend:Enable USB autosuspend by default (bool)
parm:           reset:Send HCI reset command on initialization (bool)
me@orangepi5:~$ 
jeremyb31 commented 1 year ago

Do you have /lib/modules/$(uname -r)/Module.symvers or /usr/src/linux-headers for the kernel with Module.symvers and .config
Might have to make clean in the bluetooth source directory and copy those files in before compiling to avoid the error

rahul-kurup commented 1 year ago

I have these in the kernel directory


me@orangepi5:~$ ls -lA /lib/modules/$(uname -r)
total 1572
lrwxrwxrwx 1 root root     47 Feb 17 02:32 build -> /usr/src/linux-headers-5.10.110-rockchip-rk3588
drwxr-xr-x 9 root root   4096 Feb 18 13:44 kernel
-rw-r--r-- 1 root root 375885 Apr  9 13:25 modules.alias
-rw-r--r-- 1 root root 386004 Apr  9 13:25 modules.alias.bin
-rw-r--r-- 1 root root  23150 Feb 17 23:59 modules.builtin
-rw-r--r-- 1 root root  48510 Apr  9 13:25 modules.builtin.alias.bin
-rw-r--r-- 1 root root  24304 Apr  9 13:25 modules.builtin.bin
-rw-r--r-- 1 root root 151446 Feb 17 23:59 modules.builtin.modinfo
-rw-r--r-- 1 root root  85487 Apr  9 13:25 modules.dep
-rw-r--r-- 1 root root 134552 Apr  9 13:25 modules.dep.bin
-rw-r--r-- 1 root root    183 Apr  9 13:25 modules.devname
-rw-r--r-- 1 root root  44187 Feb 17 23:59 modules.order
-rw-r--r-- 1 root root    269 Apr  9 13:25 modules.softdep
-rw-r--r-- 1 root root 137352 Apr  9 13:25 modules.symbols
-rw-r--r-- 1 root root 172725 Apr  9 13:25 modules.symbols.bin
me@orangepi5:~$ 
jeremyb31 commented 1 year ago

What is in /usr/src/linux-headers-5.10.110-rockchip-rk3588

rahul-kurup commented 1 year ago

Should I use Module.symvers and .config from here ?


me@orangepi5:~$ ls -lA /usr/src/linux-headers-5.10.110-rockchip-rk3588
total 1620
drwxr-xr-x  26 root root    4096 Apr  9 10:22 arch
drwxr-xr-x   3 root root    4096 Apr  9 10:22 block
drwxr-xr-x   2 root root    4096 Apr  9 10:22 certs
-rw-r--r--   1 root root  218649 Apr  9 10:23 .config
-rw-r--r--   1 root root  219062 Apr  9 10:23 .config.old
drwxr-xr-x   4 root root    4096 Apr  9 10:22 crypto
drwxr-xr-x   8 root root    4096 Apr  9 10:22 Documentation
drwxr-xr-x 144 root root    4096 Apr  9 10:22 drivers
drwxr-xr-x  81 root root    4096 Apr  9 10:22 fs
drwxr-xr-x  31 root root    4096 Apr  9 10:22 include
drwxr-xr-x   2 root root    4096 Apr  9 10:22 init
drwxr-xr-x   2 root root    4096 Apr  9 10:22 ipc
-rw-r--r--   1 root root     555 Apr  9 10:23 Kconfig
drwxr-xr-x  19 root root    4096 Apr  9 10:22 kernel
drwxr-xr-x  21 root root    4096 Apr  9 10:22 lib
-rw-r--r--   1 root root   68751 Apr  9 10:23 Makefile
drwxr-xr-x   5 root root    4096 Apr  9 10:22 mm
-rw-r--r--   1 root root 1047574 Apr  9 10:23 Module.symvers
drwxr-xr-x  72 root root    4096 Apr  9 10:22 net
drwxr-xr-x  31 root root    4096 Apr  9 10:22 samples
drwxr-xr-x  17 root root   12288 Apr  9 10:23 scripts
drwxr-xr-x  13 root root    4096 Apr  9 10:22 security
drwxr-xr-x  26 root root    4096 Apr  9 10:22 sound
drwxr-xr-x  33 root root    4096 Apr  9 10:22 tools
drwxr-xr-x   3 root root    4096 Apr  9 10:22 usr
drwxr-xr-x   4 root root    4096 Apr  9 10:22 virt
me@orangepi5:~$ 
jeremyb31 commented 1 year ago

I would try copying those files into the bluetooth source directory and try to compile. If it doesn't work you might have to post on an armbian forum to see what is different there on compiling a module

rahul-kurup commented 1 year ago

there were NO compilation errors after following the steps mentioned above but these errors are still showing

me@orangepi5:~$ dmesg | grep btusb
[   19.152093] btusb: disagrees about version of symbol module_layout
[   19.152365] btusb: disagrees about version of symbol module_layout
[   19.152508] btusb: disagrees about version of symbol module_layout
[   19.152760] btusb: disagrees about version of symbol module_layout
me@orangepi5:~$ lsmod | grep blue
me@orangepi5:~$ modprobe -v btusb
insmod /lib/modules/5.10.110-rockchip-rk3588/kernel/drivers/bluetooth/btusb.ko 
modprobe: ERROR: could not insert 'btusb': Operation not permitted
me@orangepi5:~$ sudo modprobe -v btusb
[sudo] password for me: 
insmod /lib/modules/5.10.110-rockchip-rk3588/kernel/drivers/bluetooth/btusb.ko 
modprobe: ERROR: could not insert 'btusb': Exec format error
me@orangepi5:~$ 

Anyways thanks for helping this far out, I appreciate it. You may close the ticket :)

jeremyb31 commented 1 year ago

Does Secure Boot exist on these? Check> mokutil --sb

rahul-kurup commented 1 year ago

Secure boot does not exist on this system:


me@orangepi5:~$ mokutil --sb
EFI variables are not supported on this system
me@orangepi5:~$ 
sbarcelona11 commented 1 month ago

I receive this error when I try to make: make -C /lib/modules/4.9.337-tegra/build M= modules make[1]: Entering directory '/usr/src/linux-headers-4.9.337-tegra-ubuntu18.04_aarch64/kernel-4.9' scripts/kconfig/conf --silentoldconfig Kconfig drivers/net/ethernet/nvidia/Kconfig:30: can't open file "drivers/net/ethernet/nvidia/eqos/Kconfig" scripts/kconfig/Makefile:37: recipe for target 'silentoldconfig' failed make[3]: [silentoldconfig] Error 1 Makefile:575: recipe for target 'silentoldconfig' failed make[2]: [silentoldconfig] Error 2 make[1]: No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'. Stop. make[1]: Leaving directory '/usr/src/linux-headers-4.9.337-tegra-ubuntu18.04_aarch64/kernel-4.9' Makefile:6: recipe for target 'all' failed make: [all] Error 2

I'm using a Jetson Nano with a UB500 Bluetooth. Can you help me?

jeremyb31 commented 1 month ago

This

I receive this error when I try to make: make -C /lib/modules/4.9.337-tegra/build M= modules make[1]: Entering directory '/usr/src/linux-headers-4.9.337-tegra-ubuntu18.04_aarch64/kernel-4.9' scripts/kconfig/conf --silentoldconfig Kconfig drivers/net/ethernet/nvidia/Kconfig:30: can't open file "drivers/net/ethernet/nvidia/eqos/Kconfig" scripts/kconfig/Makefile:37: recipe for target 'silentoldconfig' failed make[3]: [silentoldconfig] Error 1 Makefile:575: recipe for target 'silentoldconfig' failed make[2]: [silentoldconfig] Error 2 make[1]: No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'. Stop. make[1]: Leaving directory '/usr/src/linux-headers-4.9.337-tegra-ubuntu18.04_aarch64/kernel-4.9' Makefile:6: recipe for target 'all' failed make: [all] Error 2

I'm using a Jetson Nano with a UB500 Bluetooth. Can you help me?

This wasn't intended for issues with a 4.9 kernel. I don't have easy access to that source code