Error when insmod peak_usb.ko with AAOS in mek_imx8: Unknown symbol can_get_echo_skb

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error when insmod peak_usb.ko with AAOS in mek_imx8: Unknown symbol can_get_echo_skb

372 Views
reymor
Contributor I

Hello, I have successfully generated an Android image from imx-automotive-14.0.0_2.1.0

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=14
PRODUCT_INCLUDE_TAGS=com.android.mainline mainline_module_prebuilt_nightly
TARGET_PRODUCT=mek_8q_car2
TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
HOST_OS=linux
BUILD_ID=AP1A.240505.004
============================================

I want to connect a peakcan to the mek board. I realized that there is not peak_usb module included. So, I added to device/nxp/imx8q/mek_8q/automotive_addition_car2_defconfig file this line:

CONFIG_CAN_PEAK_USB=m

Also, I add this line to device/nxp/imx8q/mek_8q/SharedBoardConfig.mk file

#CONFIG_CAN_PEAK_USB
BOARD_VENDOR_KERNEL_MODULES += \
$(KERNEL_OUT)/drivers/net/can/usb/peak_usb/peak_usb.ko

This adds the module to /vendor_dlkm/lib/modules/peak_usb.ko

When I try to run insmod I got this errr: 

insmod: failed to load ./vendor_dlkm/lib/modules/peak_usb.ko: No such file or directory

When I saw the dmesg, this gives this information:

[13549.962243] peak_usb: Unknown symbol can_get_echo_skb (err -2)
[13549.969056] peak_usb: Unknown symbol driver_for_each_device (err -2)

I run these commands:

mek_8q:/ # /proc/kallsym

cat /proc/kallsyms | grep can_get_echo_skb
0000000000000000 r __export_symbol_can_get_echo_skb [can_dev]
0000000000000000 t can_get_echo_skb [can_dev]
0000000000000000 t __can_get_echo_skb [can_dev]

mek_8q:/ # cat /proc/kallsyms | grep driver_for_each_device
0000000000000000 T driver_for_each_device

Here, I'm not really sure what is going on. It seems to me that the modules is loaded. I have perform multiple test check like de CRC in Module.symvers and in peak_usb.mod.c both seems to be the same. I'm not really sure if this is a SELinux policy because I run setenforce 0 and got the same error

I will appreciate any help.

Thanks in advance.

0 Kudos
Reply
1 Reply

335 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi  Reymor:

 

Just an information to you, in the android user's guider,  there is some description about how to add new drivers.  please see section 9.4.

If some symbols are not exported but used by the added driver modules,  some suggested steps can be performed.

https://www.nxp.com/docs/en/user-guide/ANDROID_USERS_GUIDE.pdf

 

danielchen_0-1744941321664.png

 

 

Regards

Daniel

0 Kudos
Reply