Mttcan相关ko加载报错

日志启动有报错,手动modprobe加载也不行,以下是相关日志:
[ 17.154461] can_dev: Unknown symbol napi_complete_done (err -22)
[ 17.171520] can_dev: disagrees about version of symbol alloc_netdev_mqs
[ 17.178518] can_dev: Unknown symbol alloc_netdev_mqs (err -22)
[ 17.178546] can_dev: disagrees about version of symbol __napi_schedule
[ 17.191619] can_dev: Unknown symbol __napi_schedule (err -22)
[ 17.191640] can_dev: disagrees about version of symbol netif_napi_add
[ 17.204520] can_dev: Unknown symbol netif_napi_add (err -22)
[ 17.204524] can_dev: disagrees about version of symbol netif_receive_skb
[ 17.204525] can_dev: Unknown symbol netif_receive_skb (err -22)
[ 17.204530] can_dev: disagrees about version of symbol register_netdev
[ 17.204531] can_dev: Unknown symbol register_netdev (err -22)
[ 17.204535] can_dev: disagrees about version of symbol free_netdev
[ 17.204536] can_dev: Unknown symbol free_netdev (err -22)
[ 17.204546] can_dev: disagrees about version of symbol netif_rx_ni
[ 17.254731] can_dev: Unknown symbol netif_rx_ni (err -22)
[ 17.260340] can_dev: disagrees about version of symbol netif_rx
[ 17.266481] can_dev: Unknown symbol netif_rx (err -22)
[ 17.266496] can_dev: disagrees about version of symbol __dev_kfree_skb_any
[ 17.278925] can_dev: Unknown symbol __dev_kfree_skb_any (err -22)
[ 17.278936] can_dev: disagrees about version of symbol napi_schedule_prep
[ 17.292250] can_dev: Unknown symbol napi_schedule_prep (err -22)
[ 17.292254] can_dev: disagrees about version of symbol netdev_info
[ 17.292255] can_dev: Unknown symbol netdev_info (err -22)
[ 17.328514] can_dev: disagrees about version of symbol unregister_netdev
[ 17.335437] can_dev: Unknown symbol unregister_netdev (err -22)
[ 17.335445] can_dev: disagrees about version of symbol netdev_warn
[ 17.347944] can_dev: Unknown symbol netdev_warn (err -22)
[ 17.353506] can_dev: disagrees about version of symbol __netif_napi_del
[ 17.353508] can_dev: Unknown symbol __netif_napi_del (err -22)
[ 17.353511] can_dev: disagrees about version of symbol netdev_err
[ 17.353512] can_dev: Unknown symbol netdev_err (err -22)
[ 17.353515] can_dev: disagrees about version of symbol napi_complete_done
[ 17.353516] can_dev: Unknown symbol napi_complete_done (err -22)
[ 17.353518] can_dev: disagrees about version of symbol alloc_netdev_mqs
[ 17.353520] can_dev: Unknown symbol alloc_netdev_mqs (err -22)
[ 17.353530] can_dev: disagrees about version of symbol __napi_schedule
[ 17.410682] tegra210-adsp tegra210-adsp: Loaded app wire
[ 17.410789] can_dev: Unknown symbol __napi_schedule (err -22)
[ 17.416373] tegra210-adsp tegra210-adsp: Loaded app apm
[ 17.422240] can_dev: disagrees about version of symbol netif_napi_add
[ 17.427589] tegra210-adsp tegra210-adsp: Loaded app adma
[ 17.434212] can_dev: Unknown symbol netif_napi_add (err -22)
[ 17.439674] tegra210-adsp tegra210-adsp: Loaded app adma_tx
[ 17.439679] nvadsp_set_adma_dump_reg: callback for adma reg dump is sent to 000000007cd6e5e5
[ 17.459910] can_dev: disagrees about version of symbol netif_receive_skb
[ 17.459911] can_dev: Unknown symbol netif_receive_skb (err -22)
[ 17.459915] can_dev: disagrees about version of symbol register_netdev
[ 17.459920] can_dev: Unknown symbol register_netdev (err -22)
[ 17.466591] tegra210-adsp tegra210-adsp: Tegra210 ADSP driver successfully registered
[ 17.493636] can_dev: disagrees about version of symbol free_netdev
[ 17.493637] can_dev: Unknown symbol free_netdev (err -22)
[ 17.493642] can_dev: disagrees about version of symbol netif_rx_ni
[ 17.493643] can_dev: Unknown symbol netif_rx_ni (err -22)
[ 17.493650] can_dev: disagrees about version of symbol netif_rx
[ 17.523571] can_dev: Unknown symbol netif_rx (err -22)
[ 17.523583] can_dev: disagrees about version of symbol __dev_kfree_skb_any
[ 17.535984] can_dev: Unknown symbol __dev_kfree_skb_any (err -22)
[ 17.536019] can_dev: disagrees about version of symbol napi_schedule_prep
[ 17.549292] can_dev: Unknown symbol napi_schedule_prep (err -22)
[ 17.555474] can_dev: disagrees about version of symbol netdev_info
[ 17.561844] can_dev: Unknown symbol netdev_info (err -22)
手动加载时报错如下:

Hi caihaotong123,

Are you using the devkit or custom board for AGX Orin?
What’s your Jetpack version in use?

Do you configure the pinmux for CAN before using it?
May I also know what’s your use case for CAN?

你好,kevin,开发套件和定制版都会出现这个打印,我用的是JetPack 5.1.1版本,加载ko时会报错,can脚本使用如下:
sudo busybox devmem 0x0c303000 w 0x0000C400
sudo busybox devmem 0x0c303008 w 0x0000C458
sudo busybox devmem 0x0c303010 w 0x0000C400
sudo busybox devmem 0x0c303018 w 0x0000C458

sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan

sudo ip link set can0 type can bitrate 500000
sudo ip link set up can0
sudo ip link set can1 type can bitrate 500000
sudo ip link set up can1

Could you update to the latest JP5.1.3(R35.5.0) to verify?

Do you run those commands through script?
If so, please run them one-by-one manually.

你要不要先說一下你怎麼build還有install module的

这些命令是一个个敲得,modprobe的报错上面的图里有

我是直接执行nvbuild脚本编译的,然后用新变异的can.ko can-raw.ko mttcan.ko替换到模组里,然后手动加载出现的问题

你要整包kernel image和kernel modules一起裝
很明顯是這三個module有用到其他東西 但是沒有被你裝進去所以報錯找不到

1 Like

我是用脚本编译的内核,请问需要怎么操作

sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=<top>/Linux_for_Tegra/rootfs/

https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/SD/Kernel/KernelCustomization.html#to-build-display-kernel-modules

最开始flash刷机的时候操作过此命令,这每次难道更新都要编译拷贝吗?

當然…
每次重編kernel都需要

这个编译的产物是什么?我后面单独更新Image镜像或者dtb文件,应该是不需要再执行的吧?不可能每次都全部刷系统

你更新kernel image就要連kernel modules一起更新
否則要嘛少東西 報錯unknown symbol 要嘛版本對不上 報錯disagrees about version of…

就是每次都要

后期可能还会部署算法之类的,存一些东西,所以每次全部刷系统不太方便,而且之前使用xavier的时候也没有每次都进行modules的编译,只单独烧录镜像或设备树也可以正常加载

我覺得我這裡已經說得很清楚了

好的,谢谢,我试了下将can驱动内核加载,没有此报错了