RK1808M0 AI计算卡使用

测试环境:

  • RK1808M0 AI计算卡

  • LKD3588

其他Neardi产品也可参考。

Toybrick TB-RK1808M0 AI计算卡(以下简称计算卡)搭载瑞芯微RK1808神经网络处理器,配置1GB 运行内存,采用标准的Mini-PCIe接口,通过拨码开关切换USB3.0mini-PCIe数据通信,计算卡遵循Mini-PCIe规格,通过拨码开关切换两种模式:

../../_images/rk1808.png

LKD3588为USB通讯,拨码向下切换。

硬件连接

../../_images/LKD3588-RK1808.png

内核设置

默认固件未打开CONFIG_USB_NET_RNDIS_WLAN,打开方式如下:

--- 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

主动模式开发介绍与环境

  • 确认USB硬件连接正常

RK1808 AI计算棒插入PC的USB接口上,使用lsusb命令查看,如下(其中2207:0018即为RK1808人工智能计算棒)

neardi@LPA3588:~$ lsusb
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 002: ID 05e3:0620 Genesys Logic, Inc. USB3.2 Hub
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 007 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
**Bus 002 Device 002: ID 2207:0018 Fuzhou Rockchip Electronics Company TB-RK1808M0**
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  • RK1808计算棒插入上位机后,会被虚拟成网卡设备

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

enx10dcb69ff286为USB网卡(RK1808人工智能计算棒虚拟网卡)。

  • 上位机进行虚拟网卡配置,配置IP为192.168.180.1,保证上位机和RK1808中间的网络连接正常

虚拟网卡配置固定IP为192.168.180.1

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

测试网络连通性:

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
  • 计算棒默认IP为192.168.180.8,账号密码皆为toybrick,用户可以SSH登录计算棒,拷贝模型和server服务程序到计算棒

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:~$ 
  • NPU使用

请参考toybrick官网