1. 硬件环境
- RK1808M0 AI计算卡(简称“计算卡”):搭载瑞芯微RK1808神经网络处理器,配置1GB运行内存,采用标准的Mini-PCIe接口。
- LKD3588:通过USB通信连接计算卡,拨码开关切换至USB3.0模式。
2. 硬件连接
计算卡通过Mini-PCIe接口连接至LKD3588
3. 内核设置
内核配置:默认固件未开启CONFIG_USB_NET_RNDIS_WLAN,需要手动修改内核配置文件以支持此功能。
修改rockchip_linux_defconfig:
--- a/kernel/arch/arm64/configs/rockchip_linux_defconfig
+++ b/kernel/arch/arm64/configs/rockchip_linux_defconfig
@@ -677,3 +677,4 @@ CONFIG_USB_WDM=y
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_CDC_NCM=y
+CONFIG_USB_NET_RNDIS_WLAN=y
4. 主动模式开发介绍与环境
使用lsusb命令确认设备是否被正确识别(设备ID为2207:0018)。
neardi@LPA3588:~$ lsusb
Bus 002 Device 002: ID 2207:0018 Fuzhou Rockchip Electronics Company TB-RK1808M0
虚拟网卡配置
计算棒插入上位机后,会虚拟成一个网卡设备。使用ifconfig -a查看网卡设备名称,例如enx10dcb69ff286。
neardi@LPA3588:~$ ifconfig -a
enx10dcb69ff286: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::c88:e6b0:9127:d944 prefixlen 64 scopeid 0x20<link>
ether 10:dc:b6:9f:f2:86 txqueuelen 1000 (Ethernet)
RX packets 35 bytes 1396 (1.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 40 bytes 8779 (8.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
配置虚拟网卡的固定IP地址为192.168.180.1,以确保上位机与RK1808之间的网络通信正常。
neardi@LPA3588:~$ sudo ifconfig enx10dcb69ff286 192.168.180.1
neardi@LPA3588:~$ ifconfig -a
enx10dcb69ff286: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.180.1 netmask 255.255.255.0 broadcast 192.168.180.255
ether 10:dc:b6:9f:f2:86 txqueuelen 1000 (Ethernet)
RX packets 137 bytes 4628 (4.6 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 88 bytes 18660 (18.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
通过ping命令测试上位机与计算棒之间的连通性。
neardi@LPA3588:~$ lsusb
neardi@LPA3588:~$ ping 192.168.180.8
PING 192.168.180.8 (192.168.180.8) 56(84) bytes of data.
64 bytes from 192.168.180.8: icmp_seq=1 ttl=64 time=0.748 ms
64 bytes from 192.168.180.8: icmp_seq=2 ttl=64 time=0.686 ms
64 bytes from 192.168.180.8: icmp_seq=3 ttl=64 time=0.736 ms
SSH登录计算棒
计算棒的默认IP为192.168.180.8,默认账号密码均为toybrick。用户可通过SSH登录计算棒以拷贝模型和服务程序。
neardi@LPA3588:~$ ssh toybrick@192.168.180.8
toybrick@192.168.180.8's password:
Linux debian10.toybrick 4.4.194 #5 SMP PREEMPT Fri Jun 24 17:46:46 CST 2022 aarch64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Oct 23 00:14:17 2019 from 192.168.180.1
toybrick@debian10:~$
5. NPU使用
请参考toybrick官网