add product operation instruction detail page

This commit is contained in:
龚祖望 2023-03-09 15:56:05 +08:00
parent a764bcf554
commit f6e0a68c11
22 changed files with 3805 additions and 1109 deletions

View File

@ -2,3 +2,4 @@ build/*.js
src/assets
public
dist
**/*.md

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,9 @@
"core-js": "^3.6.5",
"echarts": "^5.3.3",
"element-ui": "^2.15.8",
"html-loader": "^4.2.0",
"js-cookie": "2.2.0",
"markdown-loader": "^8.0.0",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
@ -43,6 +45,7 @@
"eslint-plugin-vue": "6.2.2",
"html-webpack-plugin": "3.2.0",
"lodash": "^4.17.21",
"markdown-it": "^13.0.1",
"mockjs": "1.0.1-beta3",
"qs": "^6.5.3",
"runjs": "4.3.2",

View File

@ -0,0 +1,769 @@
# XiHuiTong_Linux_Support_Collaborate_With_XiUOS
## 1. 系统交叉编译
### 1.1、测试环境
- `Ubuntu 18.04` 及以上
- 16.04 在编译 debian 文件系统时会出错,暂时未解决,不建议使用
解压 sdk 基础包
在路径 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Source_Code/rk3568_linux/sdk/base/ 下,拷贝到 Ubuntu 环境下,执行如下命令
```
tar -xzvf som3568_base_0520.tar.gz
cd rk356x_linux
```
### 1.2、交叉编译工具链
已内置于 sdk prebuilts 和 buildroot 目录下,不用重新安装
- aarch64-linux-gcc (gcc version 6.3.1 20170404)
- aarch64-buildroot-linux-gnu-gcc (gcc version 9.3.0)
### 1.3、其他安装包
```
sudo apt-get install repo git ssh make gcc libssl-dev liblz4-tool
sudo apt-get install expect g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support
sudo apt-get install qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g++-multilib
sudo apt-get install unzip zlib1g-dev
sudo apt-get install device-tree-compiler python-pip ncurses-dev
pip install pyelftools
```
### 1.4、打 patch
将 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Source_Code/rk3568_linux/patch 下三个 patch 文件取出
**下文 SDK_PATH 指代 rk356x_linux 目录**
repo_20210520_DLM3568_device_95d7e1_435a6c_01.patch 放在 $SDK_PATH/device/rockchip 下
repo_20210520_DLM3568_kernel_4f736f_a7164d_01.patch 放在 $SDK_PATH/kernel 下
repo_20210520_DLM3568_buildroot_94742b_86ca23_01.patch 放在 $SDK_PATH/buildroot 下
在对应目录下运行 `patch -p1 < *.patch` 打包
```shell
cd device/rockchip
patch -p1 < *.patch
cd ../../kernel
patch -p1 < *.patch
cd ../buildroot
patch -p1 < *.patch
```
配置 deconfig 文件和设备树(在 SDK_PATH 目录下)
```shell
cd ../
source envsetup.sh //输入74代表选择 rockchip_rk3568_dlm3568
./build.sh lunch //输入3代表选择 BoardConfig-rk3568-dlm3568-ddr4-A1.mk配置文件
```
![envsetup ](/static/img/envsetup.jpg)
`注:提前将 XiHuiTong_Linux_Support_Collaborate_With_XiUOS\Source_Code\rk3568_linux/dl目录拷贝到$SDK_PATH/buildroot/ 下,这个目录里是大量的压缩包,在编译内核时减少大量下载时间`
### 1.5、编译 Uboot
```
<SDK_PATH>$ ./build.sh uboot
```
### 1.6、编译 Kernel
编译 kernel 前把 5G 网卡驱动设置一下:
打开 $SDK_PATH/kernel/drivers/usb/serial/option.c ,在 option_probe 函数中 `unsigned long device_flags = id->driver_info;` 一行后面加入如下代码:
```cpp
if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2CB7) && serial->dev->descriptor.idProduct == cpu_to_le16(0x0104) && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
{
printk(KERN_INFO "Discover the 4th interface for fibocom\n");
return ENODEV;
}
if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2CB7) && serial->dev->descriptor.idProduct == cpu_to_le16(0x010A) && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 2)
{
printk(KERN_INFO "Discover the 4th interface for fibocom\n");
return ENODEV;
}
```
打开 SDK_PATH/build.sh (**该文件时间软连接到了 rk356x_linux/device/rockchip/common/build.sh**),在该文件的 build_kernel 函数中增加一行(函数起始位置大概在 481 行)
```makefile
make ARCH=$RK_ARCH menuconfig
```
![](https://s2.loli.net/2022/06/01/Eh9lbKqGtRDHXSU.png)
然后编译内核:
```
<SDK_PATH>$ ./build.sh kernel
```
menuconfig 时勾选上如下选项:(Device Drivers 下可以检索如下配置项 USB_SUPPORT、USB_SERIAL、USB_SERIAL_OPTION+回车可以快速找到 )
![](https://s2.loli.net/2022/06/01/G69cVg7BSLICQlr.png)
配置电源选项时,全部选择 3300000uV
![](https://s2.loli.net/2022/06/01/LTSJxhryAPOqupf.png)
如下表示配置成功:
![](https://s2.loli.net/2022/06/01/BfjzHt3ZWKe8Rk9.png)
最后显示 "Running build_kernel succeeded." 编译成功
### 1.7、编译 Recovery
```
<SDK_PATH>$ sudo ./build.sh recovery
```
需要特别注意 recovery.img 是包含 kernel.img所以每次 Kernel 更改后Recovery 是需要重新打包生成。如下:
```
<SDK_PATH>$ source envsetup.sh rockchip_芯片名称
<SDK_PATH>$ make recovery-rebuild
<SDK_PATH>$ sudo ./build.sh recovery
```
这一步需要从网上下载资源,比较耗时。
编译成功会显示"Running build_recovery succeeded."
### 1.8、编译 Debian
进入目录 ${SDK_PATH}
ubuntu16.04 及以后已不支持 `python-support`,需要手动安装:
```
wget http://launchpadlibrarian.net/109052632/python-support_1.0.15_all.deb
sudo dpkg -i python-support_1.0.15_all.deb
```
由于下载时可能因为被防火墙墙导致下载失败,在 ${SDK_PATH}/debian/ubuntu-build-service/buster-desktop-arm64/configure 文件中加入以下镜像网站配置
```
echo "I: create configuration"
export LB_BOOTSTRAP_INCLUDE="apt-transport-https gnupg"
lb config \
+ --mirror-bootstrap "http://mirrors.163.com/debian" \
+ --mirror-chroot "http://mirrors.163.com/debian" \
+ --mirror-chroot-security "http://mirrors.163.com/debian-security" \
+ --mirror-binary "http://mirrors.163.com/debian" \
+ --mirror-binary-security "http://mirrors.163.com/debian-security" \
--apt-indices false \
--apt-recommends false \
--apt-secure false \
```
编译文件系统:
```
<SDK_PATH>$ ./build.sh debian
```
若出现如下问题:
```
noexec or nodev issue /usr/share/debootstrap/functions: line 1450:
..../rootfs/ubuntu-build-service/buster-desktop-arm64/chroot/test-dev-null:
Permission denied E: Cannot install into target '/rootfs/ubuntu-buildservice/buster-desktop-arm64/chroot' mounted with noexec or nodev
```
解决方法:
```
sudo mount -o remount,exec,dev /home
```
若出现 live-build 相关的报错,尝试执行如下命令解决
![live-build-error1](/static/img/live-build-error1.jpg)
考虑升级 live-build参考 http://t.zoukankan.com/cute-p-15185054.html
若又出现若现如下问题:
![live-build-error2](image/live-build-error2.jpg)
执行如下操作进行解决:
```shell
sudo apt-get install -f
sudo apt-get install python-apt
sudo dpkg -i debian/ubuntu-build-service/packages/*
```
编译完成会显示:
Running build_debian succeeded.
Running build_rootfs succeeded.
编译完成会在 debian/ 目录下生成linaro-buster-alip-xxxxx-1.tar.gzxxxxx 表示生成时间戳)。
### 1.9、生成镜像
```
<SDK_PATH>$ sudo ./mkfirmware.sh
<SDK_PATH>$ sudo ./build.sh updateimg
```
生成 img 在 $SDK_PATH/rockdev 中,`update.img` 为整机镜像。
![1](https://s2.loli.net/2022/02/17/mBZGDMxF1lprIqg.png)
## 2. 烧录镜像及调试
Micro USB 连接上电脑
![2](https://s2.loli.net/2022/02/17/YLrMIJxVG39Nlba.png)
### 2.1、安装驱动 DriverAssitant_v5.11.zip
该文件在路径 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Source_Code/rk3568_linux/sdk/base 下的 som3568_base_0520.tar.gz 压缩包里,在 1.1 节解压后的目录里去取即可(在 rk356x_linux/tools/windows 目录下)。取出到自己的 windows 环境下解压压缩包,点击 DriverInstall.exe 进行安装。
![3](https://s2.loli.net/2022/02/18/OLQcrioKnH4hsZe.png)
### 2.2、打开 RKDevTool.exe
在 2.1 节相同的路径下取出 RKDevTool_Release_v2.84.zip 到自己的 windows 环境下,解压压缩包找到 RKDevTool.exe。
**`注:若一直提示找不到设备,按住 "Update" 按键并重新上电,会提示"发现一个 LOADER 设备",此时直接烧录即可 `(不需要执行图片中第 3 步的切换)**
![4](https://s2.loli.net/2022/02/17/inrgvTpONhIuafW.png)
1、连接设备
2、在打开工具的界面点击"升级固件"→“固件”,选择 1.9 节里编译生成的 update.img 文件,在 rk356x_linux\rockdev\ 路径下选择固件后稍等片刻等待固件版本、Loader 版本、芯片信息等加载出来
3、点击“切换”等待切换完成
4、点击"升级",右侧会显示升级信息,等出现重启设备成功说明升级完成
**调试口在电源侧,从外向里分别为 `GND、TX、RX` 串口连接的波特率为 1500000**
板子的引脚图和实物图如下所示:
![xihuitong-pin](image/xihuitong-pin.bmp)
![5](https://s2.loli.net/2022/02/17/Tti6sEbgM8de7O4.jpg)
**注意这里使用的串口模块是这种黑色串口模块,实验室的另一种白色串口模块连接不上。**
![Serial-port-module](image/Serial-port-module.jpg)
然后可以使用系统了,同样为了防止被墙,先更换下 apt 源,接上网线后更新一下 apt 源
第一步:打开 sources.list 文件
```
sudo vim /etc/apt/sources.list
```
第二步:将以下内容复制到 sources.list 文件(复制后在 vi 模式 ctrl+shift+v 进行复制)
```
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
```
第三步:更新源和系统软件
```shell
sudo apt-get update
sudo apt-get upgrade
```
**git 仓上保存了一份包含了已经编译好且包含 emmc 扩容后的 update.img 文件,可以不用进行编译直接拿来烧录使用。可以免去编译这一过程,但依然建议初次使用该文档的开发人员,从头至尾编译一边以加深印象。**
**update.img 保存路径XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Reference_Doc/ 可直接烧录文件**
## 3. 5G 网卡调试
```
sudo apt-get install microcom
sudo apt-get install udhcpc
```
**`注:先把 micro usb 烧录线拔下,否则 5G 卡无法识别!`**
先执行 lsusb 确认系统识别到 5G 网卡:
![](https://s2.loli.net/2022/02/18/5MNWk2jEgbzUQRG.png)
如果没有 lsusb 命令先执行如下命令进行安装
```shell
sudo apt-get install usbutils
```
再执行 ls /dev/tty\* 查看 tty 设备:
![](https://s2.loli.net/2022/02/18/D1H4AaQjIof7KLJ.png)
先关闭以太网卡:
```
ifconfig eth0 down
```
进入串口工具:
```
microcom -s 115200 -p /dev/ttyUSB1
```
切换到 ECM 拨号模式:
```
at+gtusbmode=18
```
查询 sim 卡是否插入:
```
at+cpin?
```
查看 5G 网络注册状态:
```
at+cgreg?
```
拨号:
```
at+gtrndis=0,1
at+gtrndis=1,1
```
**在 AT 模式下退出该模式ctrl+\然后输入 quit 即可退出。**
拨号完成后退出串口工具,自动获取 ip
```
udhcpc -i usb0
ifconfig usb0 up
```
此时 ifconfig 应该能看到 usb0 网卡状态:
![](https://s2.loli.net/2022/02/18/Jui9AwMVEkP5fbY.png)
ping 测试成功
```shell
ping www.baidu.com
```
![](https://s2.loli.net/2022/02/18/lVPm62OKiXFoake.png)
## 5. wifi 模块调试
WIFI 模块为 USB 接口,采用南方硅谷 ssv6x5x 芯片。
总体参考《南方硅谷 ssv6x5x 驱动移植用户指南\_20200818》
> ### 驱动编译
需要的驱动文件为 Source Code\Wifi\Wifi Related Tools\6155.6152 驱动.zip 这个压缩文件里,有个压缩文件 L.SMAC.19Q3.2042.02_FH.tar.gz将该文件 copy 到 rk356x_linux/kernel/drivers/net/wireless/ 下,解压为 ssv6x5x 文件夹
```bash
cd rk356x_linux/kernel/drivers/net/wireless/
tar -zxvf L.SMAC.19Q3.2042.02_FH.tar.gz
mv L.SMAC.19Q3.2042.02 ssv6x5x
```
如果是移植到 Linux 平台,可参考 platforms 下 t20 平台的相关配置文件。
将以上平台相关文件 copy 到 ssv6x5x 目录,进入 ssv6x5x 目录下:
```bash
cd ssv6x5x
cp platforms/platform-config.mak .
cp platforms/t20.cfg ssv6x5x.cfg
cp platforms/t20-generic-wlan.c ssv6x5x-generic-wlan.c
cp platforms/t20-wifi.cfg image/ssv6x5x-wifi.cfg
cp platforms/t20-wifi.cfg ssv6x5x-wifi.cfg
```
根据平台类型 copy 出一份正确的 makefile, 因为 ssv6x5x/makefile 默认驱动目录带的是 ubuntu 环境的 makefile 文件,不能直接使用。
```bash
cp Makefile.cross_linux Makefile
```
将 ssv6x5x 驱动存放在内核目录 rk356x_linux/kernel/drivers/net/wireless/ 路径下。
修改 drivers/net/wireless 目录的 Makefile新增
```sh
obj-$(CONFIG_SSV6X5X) += ssv6x5x/
```
![](https://s2.loli.net/2022/03/11/9Aa8D7KzEGtBQbX.png)
以及 Kconfig 文件,新增
```sh
source "drivers/net/wireless/ssv6x5x/Kconfig"
```
![](https://s2.loli.net/2022/03/11/iktgJKjdTOvVqMl.png)
在 rk356x_linux/kernel 路径下重新配置内核 menuconfig:
```bash
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-himix100-linux- menuconfig
```
networking support -> RF switch subsystem support ->下面的都选上(在 Networking support 中快速检索,搜索 RFKILL)
![](https://s2.loli.net/2022/03/11/QVUc9RZEbDdnpqf.png)
networking support -> wireless ->cfg80211 - wireless configuration API
networking support -> wireless ->Generic ...(mac80211)
![](https://s2.loli.net/2022/03/11/VxGBI6cHlmbSWT2.png)
然后就可以选上驱动:
Device Drivers -> Network device support -> Wireless LAN -> SSV6X5X Wireless driver
(可在 device drivers 中快速检索,依次搜索 NETDEVICES、WLAN、SSV6X5X
![](https://s2.loli.net/2022/06/16/p7guPtdqXoeOYJh.png)
在在 rk356x_linux 根目录下编译驱动,并重新编译一遍内核和 recovery, 编译生成的 ssv6x5x.ko 在 kernel/drivers/net/wireless/ssv6x5x 下
```bash
sudo ./build.sh modules
sudo ./build.sh kernel (如果又进入menuconfig那就检查一下上面几个项目是否全部勾选上了)
sudo ./build.sh recovery
```
同样,重新打包生成镜像文件:
```bash
sudo ./mkfirmware.sh
sudo ./build.sh updateimg
```
按照烧录流程重新烧录
> ### 驱动运行
确认系统是否识别到 wifi对于 usb wifi执行 lsusb 可以看到如下则确认识别 (for 6155/6255 型号的芯片)
```
Bus 005 Device 003: ID 8065:6000
```
接入以太网安装相关包:
```bash
sudo apt-get update && sudo apt-get install vim usbutils net-tools microcom udhcpc wireless-tools
```
复制相关文件到板子的文件系统中
复制可以用 U 盘复制,拷贝到 U 盘后插入到矽灵通上fdisk -l 查看找到 usb 设备,例如 /dev/sda1
执行挂载进行拷贝
```shell
mkdir -p /mnt/usb
mount /dev/sda1 /mnt/usb
```
复制 ssv6x5x/image/ssv6x5x-wifi.cfg 到板子文件系统下 /etc/firmware/ (若无 firmware 文件夹新建即可)
复制 ssv6x5x.ko 到板子任意目录下
加载驱动 ssv6x5x.ko
执行如下指令stacfgpath= 路径请根据实际路径填写)
```bash
insmod ssv6x5x.ko stacfgpath=/etc/firmware/ssv6x5x-wifi.cfg
```
insmod 结束:
![](https://s2.loli.net/2022/06/16/Kdx2VXQ5ujDOwFi.png)
insmod 完成后 wifi 可能会重复扫描周围网络,暂时不用管,接着执行下面步骤可以解决:
ifconfig -a 查看网卡名称,这边是 wlxa47d9fb5b922 (具体要看板子)
![](https://s2.loli.net/2022/05/31/rhaCVkpzPKJQyfn.png)
为了后续操作方便,可以对网卡重命名为 wlan0 (非必要)
```
ip link set wlxa47d9fb5b922 down
ip link set wlxa47d9fb5b922 name wlan0
ip link set wlan0 up
```
执行: ifconfig eth0 down && ifconfig wlan0 up
![](https://s2.loli.net/2022/05/31/m3czVTRvZPkQWu2.png)
> ### WIFI 网络连接
扫描周围无线网络:
```bash
iwlist wlan0 scan
```
![](https://s2.loli.net/2022/05/31/Fw2ND6pEYCQrZcB.png)
连接网络:
```bash
iwconfig wlan0 essid "AIIT-Guest"
```
![](https://s2.loli.net/2022/05/31/5z1HXichCDe4Ob2.png)
dhcp 获取 ip
```bash
udhcpc -i wlan0
```
![](https://s2.loli.net/2022/05/31/TGe6lEIkD4F1C7J.png)
ip 分配成功后,进行 ping 测试,需要 -I 指定网卡
```shell
ping 114.114.114.114 -I wlan0
ping www.baidu.com -I wlan0
```
![](https://s2.loli.net/2022/05/31/YVq9MC6fpPUjzNm.png)
## 5. USB 调试
首先通过 fdisk -l 查看插入的 usb 设备,如下我这里插入的 u 盘是 /dev/sda2
```shell
Device Boot Start End Sectors Size Id Type
/dev/sda2 2 15149055 15149054 7.2G c W95 FAT32 (LBA)
```
进行挂载
```shell
mkdir /root/udisk
mount /dev/sda2 udisk
```
![](https://s2.loli.net/2022/02/22/IWhXL2bw3GNi8pd.png)
## 6. SD 卡调试
首先通过 fdisk -l 查看插入的 SD 卡,如下我这里插入的 SD 卡是 /dev/mmcblk1p1
```shell
Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 8192 62333951 62325760 29.7G c W95 FAT32 (LBA)
```
进行挂载
```shell
mkdir /root/sdcard
mount /dev/mmcblk1p1 sdcard/
```
![](https://s2.loli.net/2022/02/24/81H9mMYicFCOash.png)
## 7. 显示图片
烧入 Debian 镜像后,把要显示的图片通过 SD 卡或者 U 盘拷贝进板子,点击打开后全屏幕显示即可。
## 8. emmc 扩容
rk3568 配置的是 16GB 的 emmc但初始只有 3.2GB
![](https://s2.loli.net/2022/04/22/HNKrfO43thWe78a.png)
为了充分利用剩余空间,需要修改烧录文件 rk356x_linux/rockdev/parameter.txt该文件实际上软连接到了(rk356x_linux/device/rockchip/rk356x/rk356x/parameter-buildroot-dlm3568.txt)。在生成 update.img 之前先修改 parameter 为以下内容,其中 rootfs 一项即对应文件系统所占大小,格式为 "size@LBA(rootfs)"
```
FIRMWARE_VER: 1.0
MACHINE_MODEL: RK3568
MACHINE_ID: 007
MANUFACTURER: RK3568
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: 0xffffffff
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
TYPE: GPT
CMDLINE: mtdparts=rk29xxnand:0x00002000@0x00004000(uboot),0x00002000@0x00006000(misc),0x00010000@0x00008000(boot),0x00010000@0x00018000(recovery),0x00010000@0x00028000(backup),0x017F6000@0x00038000(rootfs),0x00040000@0x0182E000(oem),0x0000A000@0x0186E000(userdata),-@0x01878000(data:grow)
uuid:rootfs=614e0000-0000-4b53-8000-1d28000054a9
```
然后重新打包生成整机镜像:
```
<SDK_PATH>$ sudo ./build.sh updateimg
```
**烧录完成后,此时配置可能并未刷新,需要更新下 blocks:**
```
resize2fs /dev/mmcblk0p6
```
![](https://s2.loli.net/2022/04/22/qX5RuLnDNJ9vSZk.png)
然后 df -h 可以看到文件系统大小已经扩容成为 12G:
![](https://s2.loli.net/2022/04/22/l5Otv6FydQf7xJB.png)
## 9. AIM16T 从模式烧录
由于出厂时 AIM16T 镜像烧录错误EP 模式烧成了 RC 模式,所以现在重新烧录,后盖有遮挡,需要去掉螺丝打开后盖。
使用 USB 转 TTL 串口,接入 AIM16T 烧录口(烧录口如下图所示的 JP4)
![USB-TTL](image/USB-TTL.jpg)
拨码开关拨到 on(拨码开关的位置如下图所示),拨码开关拨到 on 后需要重新上电
![](https://s2.loli.net/2022/04/21/idgKvlcH1xqMTkw.png)
解压 fwu_tool_mlu220.rar 文件,压缩包位于**XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Reference_Doc/AIM16T_EP_Burn**下,解压后更改文件目录权限
如果没有 rar 相关的命令,需要先安装,如果有这一步忽略
```shell
sudo apt-get install rar
sudo apt-get install unrar
```
把 fwu_tool_mlu220.rar 复制到 linux 环境下,进行解压
```
unrar x fwu_tool_mlu220.rar
chmod -R 777 fwu_tool_mlu220
```
进入目录,执行 EP 模式镜像烧录
```
cd fwu_tool_mlu220
sudo ./start_burn.sh 3
```
以下表示烧录完成
![](https://s2.loli.net/2022/04/21/qi4nmkzCxRHf6LO.png)
将拨码开关拨回 12重新上电在 rk3568 命令行中输入 lspci 命令,若能找到以下设备则表示 EP 模式烧录成功
![](https://s2.loli.net/2022/04/21/2cITg5NqYptUjVA.png)
接下来在 AIM16T 上运行 yolo_demo 来检验,这一步需要四个文件:
1firmware_sys.img、cambricon-drv.ko、cnmon 这三个文件位于 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Source_Code/AIM16T 下的 rk3568_aim16t.tar 压缩包内,从压缩包内取出
2yolo_demo_rk3568.tar.gz 位于 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Source_Code 下
这四个文件用 nfs 或 U 盘拷贝进板子(U 盘的挂载方式见第 4 节 USB 调试,如下 udisk 为挂载后的路径),把 AIM16T 驱动放在对应路径:
```
mkdir -p /lib/firmware/cambricon/mlu220
cp -a /root/udisk/firmware_sys.img /lib/firmware/cambricon/mlu220
```
加载 AIM16T 模组:
```
cp /root/udisk/cambricon-drv.ko /root
cd /root
insmod cambricon-drv.ko
```
以下表示模组加载成功:
![](https://s2.loli.net/2022/04/21/vn7FPZj3pqwMxYd.png)
此时运行 cnmon 脚本可以查看到 mlu220 设备的一些信息:
```
cp /root/udisk/cnmon /root
chmod 777 cnmon
./cnmon
```
![](https://s2.loli.net/2022/04/22/shWmv5SrBcGnb4A.png)
解压 yolo_demo 并运行推理测试:
```
mkdir -p /root/yolo
cp /root/udisk/yolo_demo_rk3568.tar.gz /root/yolo
cd /root/yolo
tar -zxf yolo_demo_rk3568.tar.gz
cd yolo_demo
source ./env.sh
./cambricon_demo
```
可以看到 demo 正常运行:
![](https://s2.loli.net/2022/04/22/X9Tytfaswhq5orI.png)
## 10.RISCV-K210 烧录、调试
烧录/调试RISCV 调试引脚同烧录引脚,均为 CO_CPU_ISP_TX/CO_CPU_ISP_RX。除了这两根线外还需要一根 GND。串口波特率均为 115200。
引脚图可以参考 2.2 节
![k210-boot](image/k210-boot.jpg)
用 K-Flash.exe 工具进行 bin 包的烧录。K-Flash.exe 工具位于 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Reference_Doc 目录下:
![K-Flash](image/K-Flash.jpg)
在 ① 选择串口 com 号
在 ② 处选择波特率,选择 115200
在 ③ 处选择编译出的 nuttx.bin 文件
设备在上电时确保 Boot 和 GND 短接,这是升级模式。
点击 ④ 处 Flash 开始烧录,显示烧录完成即可,中间有报错的话,重新 Flash。
烧写完毕重新上电,进入 shell。
![k210-shell](image/k210-shell.jpg)

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -2,7 +2,7 @@
* @Author: 龚祖望 573413756@qq.com
* @Date: 2022-05-16 09:16:41
* @LastEditors: 龚祖望 573413756@qq.com
* @LastEditTime: 2023-02-13 14:19:15
* @LastEditTime: 2023-03-08 15:57:02
* @FilePath: \dashengda\src\permission.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -17,7 +17,7 @@ import getPageTitle from '@/utils/get-page-title'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/login', '/home', '/product/M168', '/product/RV400', '/product/RV400-SR100', '/product/M168-SM100',
'/product/RV400-AR100', '/product/RV400-CR100', '/product/M528-CM100', '/product/edu-arm', '/product/edu-riscv64', '/product/M528',
'/product/RV400-AR100', '/product/RV400-AR100/instruction', '/product/RV400-CR100', '/product/M528-CM100', '/product/edu-arm', '/product/edu-riscv64', '/product/M528',
'/solution/shengda', '/solution/qianjiang', '/configuration/development', '/configuration/transferStation',
'/configuration/AiCity', '/configuration/bridgeMachine'] // no redirect whitelist

View File

@ -65,6 +65,11 @@ export const constantRoutes = [
component: () => import('@/views/product/RV400-AR100'),
hidden: true
},
{
path: '/product/RV400-AR100/instruction',
component: () => import('@/views/product/RV400-AR100/instruction.vue'),
hidden: true
},
{
path: '/product/RV400-CR100',
component: () => import('@/views/product/RV400-CR100'),

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,148 @@
<template>
<div class="demo-block">
<div class="demo-block-source">
<slot name="source" />
<span
v-if="!$slots.default"
class="demo-block-code-icon"
@click="showCode = !showCode"
><img
alt="expand code"
src="https://gw.alipayobjects.com/zos/rmsportal/wSAkBuJFbdxsosKKpqyq.svg"
class="code-expand-icon-show"
></span>
</div>
<div v-if="$slots.default" class="demo-block-meta">
<slot />
<span
v-if="$slots.default"
class="demo-block-code-icon"
@click="showCode = !showCode"
><img
alt="expand code"
src="https://gw.alipayobjects.com/zos/rmsportal/wSAkBuJFbdxsosKKpqyq.svg"
class="code-expand-icon-show"
></span>
</div>
<div v-show="showCode" class="demo-block-code">
<slot name="highlight" />
</div>
</div>
</template>
<script type="text/babel">
import 'highlight.js/styles/color-brewer.css'
export default {
data() {
return {
showCode: false
}
}
}
</script>
<style scoped>
@import '../../../styles/github-markdown.css';
.demo-block {
border: 1px solid #ebedf0;
border-radius: 2px;
display: inline-block;
width: 100%;
position: relative;
margin: 0 0 16px;
-webkit-transition: all 0.2s;
transition: all 0.2s;
border-radius: 2px;
}
.demo-block p {
padding: 0;
margin: 0;
}
.demo-block .demo-block-code-icon {
position: absolute;
right: 16px;
bottom: 14px;
cursor: pointer;
width: 18px;
height: 18px;
line-height: 18px;
text-align: center;
}
.demo-block .demo-block-code-icon img {
-webkit-transition: all 0.4s;
transition: all 0.4s;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
position: absolute;
left: 0;
top: 0;
margin: 0;
max-width: 100%;
width: 100%;
vertical-align: baseline;
-webkit-box-shadow: none;
box-shadow: none;
}
.demo-block .demo-block-source {
border-bottom: 1px solid #ebedf0;
padding: 20px 24px 20px;
color: #444;
position: relative;
margin-bottom: -1px;
}
.demo-block .demo-block-meta {
position: relative;
padding: 12px 50px 12px 20px;
border-radius: 0 0 2px 2px;
-webkit-transition: background-color 0.4s;
transition: background-color 0.4s;
width: 100%;
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-size: 14px;
color: #444;
font-size: 14px;
line-height: 2;
border-radius: 0;
border-bottom: 1px dashed #ebedf0;
margin-bottom: -1px;
}
.demo-block .demo-block-meta code {
color: #444;
background-color: #e6effb;
margin: 0 4px;
display: inline-block;
padding: 3px 7px;
border-radius: 3px;
height: 18px;
line-height: 18px;
font-family: Menlo, Monaco, Consolas, Courier, monospace;
font-size: 14px;
}
.demo-block .demo-block-code {
background-color: #f7f7f7;
font-size: 0;
}
.demo-block .demo-block-code code {
background-color: #f7f7f7;
font-family: Consolas, Menlo, Courier, monospace;
border: none;
display: block;
font-size: 14px;
padding: 16px 32px;
}
.demo-block .demo-block-code pre {
margin: 0;
padding: 0;
}
.sh-checkbox {
color: #444;
font-weight: 500;
font-size: 14px;
position: relative;
cursor: pointer;
display: inline-block;
white-space: nowrap;
user-select: none;
}
</style>

View File

@ -0,0 +1,67 @@
<template>
<div class="container">
<p><img src="@/assets/images/instruction_detail_logo.png">&nbsp;矽璓&nbsp;智能终端</p>
<P>M168-NPU4T-4G-SM100</P>
<img src="@/assets/images/instruction_detail_title.png">
<div class="markdown-body body-container" v-html="articalContent" />
</div>
</template>
<script>
import axios from 'axios'
export default {
data() {
return {
articalContent: ''
}
},
created() {
axios.get('/ar100.md').then(res => {
const Markdown = require('markdown-it')
const md = new Markdown()
console.log('res', res)
const htmlMD = md.render(res.data)
this.articalContent = htmlMD
})
}
}
</script>
<style lang="scss" scoped>
@import '~@/styles/github-markdown.css';
.container{
border-radius: 48px;
background: linear-gradient(181deg,#424D83,#7DADF3);
padding: 50px 30px 30px;
text-align: center;
color: #fff;
& > p{
font-size: 52px;
font-family: Poppins;
margin: 20px 0;
img{
vertical-align: middle;
height: 70px;
}
}
& > img {
height: 100px;
margin-bottom: 20px;
}
::v-deep .markdown-body{
border-radius: 48px;
background-color: #fff;
padding: 50px;
text-align: left;
h1,h2{
color: #46548C !important;
}
h3{
color:#7DADF3 !important;
text-indent: 2em;
}
}
}
</style>

View File

@ -0,0 +1,769 @@
# XiHuiTong_Linux_Support_Collaborate_With_XiUOS
## 1. 系统交叉编译
### 1.1、测试环境
- `Ubuntu 18.04` 及以上
- 16.04 在编译 debian 文件系统时会出错,暂时未解决,不建议使用
解压 sdk 基础包
在路径 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Source_Code/rk3568_linux/sdk/base/ 下,拷贝到 Ubuntu 环境下,执行如下命令
```
tar -xzvf som3568_base_0520.tar.gz
cd rk356x_linux
```
### 1.2、交叉编译工具链
已内置于 sdk prebuilts 和 buildroot 目录下,不用重新安装
- aarch64-linux-gcc (gcc version 6.3.1 20170404)
- aarch64-buildroot-linux-gnu-gcc (gcc version 9.3.0)
### 1.3、其他安装包
```
sudo apt-get install repo git ssh make gcc libssl-dev liblz4-tool
sudo apt-get install expect g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support
sudo apt-get install qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g++-multilib
sudo apt-get install unzip zlib1g-dev
sudo apt-get install device-tree-compiler python-pip ncurses-dev
pip install pyelftools
```
### 1.4、打 patch
将 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Source_Code/rk3568_linux/patch 下三个 patch 文件取出
**下文 SDK_PATH 指代 rk356x_linux 目录**
repo_20210520_DLM3568_device_95d7e1_435a6c_01.patch 放在 $SDK_PATH/device/rockchip 下
repo_20210520_DLM3568_kernel_4f736f_a7164d_01.patch 放在 $SDK_PATH/kernel 下
repo_20210520_DLM3568_buildroot_94742b_86ca23_01.patch 放在 $SDK_PATH/buildroot 下
在对应目录下运行 `patch -p1 < *.patch` 打包
```shell
cd device/rockchip
patch -p1 < *.patch
cd ../../kernel
patch -p1 < *.patch
cd ../buildroot
patch -p1 < *.patch
```
配置 deconfig 文件和设备树(在 SDK_PATH 目录下)
```shell
cd ../
source envsetup.sh //输入74代表选择 rockchip_rk3568_dlm3568
./build.sh lunch //输入3代表选择 BoardConfig-rk3568-dlm3568-ddr4-A1.mk配置文件
```
![envsetup ](../../../assets/images/envsetup.jpg)
`注:提前将 XiHuiTong_Linux_Support_Collaborate_With_XiUOS\Source_Code\rk3568_linux/dl目录拷贝到$SDK_PATH/buildroot/ 下,这个目录里是大量的压缩包,在编译内核时减少大量下载时间`
### 1.5、编译 Uboot
```
<SDK_PATH>$ ./build.sh uboot
```
### 1.6、编译 Kernel
编译 kernel 前把 5G 网卡驱动设置一下:
打开 $SDK_PATH/kernel/drivers/usb/serial/option.c ,在 option_probe 函数中 `unsigned long device_flags = id->driver_info;` 一行后面加入如下代码:
```cpp
if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2CB7) && serial->dev->descriptor.idProduct == cpu_to_le16(0x0104) && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
{
printk(KERN_INFO "Discover the 4th interface for fibocom\n");
return ENODEV;
}
if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2CB7) && serial->dev->descriptor.idProduct == cpu_to_le16(0x010A) && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 2)
{
printk(KERN_INFO "Discover the 4th interface for fibocom\n");
return ENODEV;
}
```
打开 SDK_PATH/build.sh (**该文件时间软连接到了 rk356x_linux/device/rockchip/common/build.sh**),在该文件的 build_kernel 函数中增加一行(函数起始位置大概在 481 行)
```makefile
make ARCH=$RK_ARCH menuconfig
```
![](https://s2.loli.net/2022/06/01/Eh9lbKqGtRDHXSU.png)
然后编译内核:
```
<SDK_PATH>$ ./build.sh kernel
```
menuconfig 时勾选上如下选项:(Device Drivers 下可以检索如下配置项 USB_SUPPORT、USB_SERIAL、USB_SERIAL_OPTION+回车可以快速找到 )
![](https://s2.loli.net/2022/06/01/G69cVg7BSLICQlr.png)
配置电源选项时,全部选择 3300000uV
![](https://s2.loli.net/2022/06/01/LTSJxhryAPOqupf.png)
如下表示配置成功:
![](https://s2.loli.net/2022/06/01/BfjzHt3ZWKe8Rk9.png)
最后显示 "Running build_kernel succeeded." 编译成功
### 1.7、编译 Recovery
```
<SDK_PATH>$ sudo ./build.sh recovery
```
需要特别注意 recovery.img 是包含 kernel.img所以每次 Kernel 更改后Recovery 是需要重新打包生成。如下:
```
<SDK_PATH>$ source envsetup.sh rockchip_芯片名称
<SDK_PATH>$ make recovery-rebuild
<SDK_PATH>$ sudo ./build.sh recovery
```
这一步需要从网上下载资源,比较耗时。
编译成功会显示"Running build_recovery succeeded."
### 1.8、编译 Debian
进入目录 ${SDK_PATH}
ubuntu16.04 及以后已不支持 `python-support`,需要手动安装:
```
wget http://launchpadlibrarian.net/109052632/python-support_1.0.15_all.deb
sudo dpkg -i python-support_1.0.15_all.deb
```
由于下载时可能因为被防火墙墙导致下载失败,在 ${SDK_PATH}/debian/ubuntu-build-service/buster-desktop-arm64/configure 文件中加入以下镜像网站配置
```
echo "I: create configuration"
export LB_BOOTSTRAP_INCLUDE="apt-transport-https gnupg"
lb config \
+ --mirror-bootstrap "http://mirrors.163.com/debian" \
+ --mirror-chroot "http://mirrors.163.com/debian" \
+ --mirror-chroot-security "http://mirrors.163.com/debian-security" \
+ --mirror-binary "http://mirrors.163.com/debian" \
+ --mirror-binary-security "http://mirrors.163.com/debian-security" \
--apt-indices false \
--apt-recommends false \
--apt-secure false \
```
编译文件系统:
```
<SDK_PATH>$ ./build.sh debian
```
若出现如下问题:
```
noexec or nodev issue /usr/share/debootstrap/functions: line 1450:
..../rootfs/ubuntu-build-service/buster-desktop-arm64/chroot/test-dev-null:
Permission denied E: Cannot install into target '/rootfs/ubuntu-buildservice/buster-desktop-arm64/chroot' mounted with noexec or nodev
```
解决方法:
```
sudo mount -o remount,exec,dev /home
```
若出现 live-build 相关的报错,尝试执行如下命令解决
![live-build-error1](image/live-build-error1.jpg)
考虑升级 live-build参考 http://t.zoukankan.com/cute-p-15185054.html
若又出现若现如下问题:
![live-build-error2](image/live-build-error2.jpg)
执行如下操作进行解决:
```shell
sudo apt-get install -f
sudo apt-get install python-apt
sudo dpkg -i debian/ubuntu-build-service/packages/*
```
编译完成会显示:
Running build_debian succeeded.
Running build_rootfs succeeded.
编译完成会在 debian/ 目录下生成linaro-buster-alip-xxxxx-1.tar.gzxxxxx 表示生成时间戳)。
### 1.9、生成镜像
```
<SDK_PATH>$ sudo ./mkfirmware.sh
<SDK_PATH>$ sudo ./build.sh updateimg
```
生成 img 在 $SDK_PATH/rockdev 中,`update.img` 为整机镜像。
![1](https://s2.loli.net/2022/02/17/mBZGDMxF1lprIqg.png)
## 2. 烧录镜像及调试
Micro USB 连接上电脑
![2](https://s2.loli.net/2022/02/17/YLrMIJxVG39Nlba.png)
### 2.1、安装驱动 DriverAssitant_v5.11.zip
该文件在路径 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Source_Code/rk3568_linux/sdk/base 下的 som3568_base_0520.tar.gz 压缩包里,在 1.1 节解压后的目录里去取即可(在 rk356x_linux/tools/windows 目录下)。取出到自己的 windows 环境下解压压缩包,点击 DriverInstall.exe 进行安装。
![3](https://s2.loli.net/2022/02/18/OLQcrioKnH4hsZe.png)
### 2.2、打开 RKDevTool.exe
在 2.1 节相同的路径下取出 RKDevTool_Release_v2.84.zip 到自己的 windows 环境下,解压压缩包找到 RKDevTool.exe。
**`注:若一直提示找不到设备,按住 "Update" 按键并重新上电,会提示"发现一个 LOADER 设备",此时直接烧录即可 `(不需要执行图片中第 3 步的切换)**
![4](https://s2.loli.net/2022/02/17/inrgvTpONhIuafW.png)
1、连接设备
2、在打开工具的界面点击"升级固件"→“固件”,选择 1.9 节里编译生成的 update.img 文件,在 rk356x_linux\rockdev\ 路径下选择固件后稍等片刻等待固件版本、Loader 版本、芯片信息等加载出来
3、点击“切换”等待切换完成
4、点击"升级",右侧会显示升级信息,等出现重启设备成功说明升级完成
**调试口在电源侧,从外向里分别为 `GND、TX、RX` 串口连接的波特率为 1500000**
板子的引脚图和实物图如下所示:
![xihuitong-pin](image/xihuitong-pin.bmp)
![5](https://s2.loli.net/2022/02/17/Tti6sEbgM8de7O4.jpg)
**注意这里使用的串口模块是这种黑色串口模块,实验室的另一种白色串口模块连接不上。**
![Serial-port-module](image/Serial-port-module.jpg)
然后可以使用系统了,同样为了防止被墙,先更换下 apt 源,接上网线后更新一下 apt 源
第一步:打开 sources.list 文件
```
sudo vim /etc/apt/sources.list
```
第二步:将以下内容复制到 sources.list 文件(复制后在 vi 模式 ctrl+shift+v 进行复制)
```
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
```
第三步:更新源和系统软件
```shell
sudo apt-get update
sudo apt-get upgrade
```
**git 仓上保存了一份包含了已经编译好且包含 emmc 扩容后的 update.img 文件,可以不用进行编译直接拿来烧录使用。可以免去编译这一过程,但依然建议初次使用该文档的开发人员,从头至尾编译一边以加深印象。**
**update.img 保存路径XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Reference_Doc/ 可直接烧录文件**
## 3. 5G 网卡调试
```
sudo apt-get install microcom
sudo apt-get install udhcpc
```
**`注:先把 micro usb 烧录线拔下,否则 5G 卡无法识别!`**
先执行 lsusb 确认系统识别到 5G 网卡:
![](https://s2.loli.net/2022/02/18/5MNWk2jEgbzUQRG.png)
如果没有 lsusb 命令先执行如下命令进行安装
```shell
sudo apt-get install usbutils
```
再执行 ls /dev/tty\* 查看 tty 设备:
![](https://s2.loli.net/2022/02/18/D1H4AaQjIof7KLJ.png)
先关闭以太网卡:
```
ifconfig eth0 down
```
进入串口工具:
```
microcom -s 115200 -p /dev/ttyUSB1
```
切换到 ECM 拨号模式:
```
at+gtusbmode=18
```
查询 sim 卡是否插入:
```
at+cpin?
```
查看 5G 网络注册状态:
```
at+cgreg?
```
拨号:
```
at+gtrndis=0,1
at+gtrndis=1,1
```
**在 AT 模式下退出该模式ctrl+\然后输入 quit 即可退出。**
拨号完成后退出串口工具,自动获取 ip
```
udhcpc -i usb0
ifconfig usb0 up
```
此时 ifconfig 应该能看到 usb0 网卡状态:
![](https://s2.loli.net/2022/02/18/Jui9AwMVEkP5fbY.png)
ping 测试成功
```shell
ping www.baidu.com
```
![](https://s2.loli.net/2022/02/18/lVPm62OKiXFoake.png)
## 5. wifi 模块调试
WIFI 模块为 USB 接口,采用南方硅谷 ssv6x5x 芯片。
总体参考《南方硅谷 ssv6x5x 驱动移植用户指南\_20200818》
> ### 驱动编译
需要的驱动文件为 Source Code\Wifi\Wifi Related Tools\6155.6152 驱动.zip 这个压缩文件里,有个压缩文件 L.SMAC.19Q3.2042.02_FH.tar.gz将该文件 copy 到 rk356x_linux/kernel/drivers/net/wireless/ 下,解压为 ssv6x5x 文件夹
```bash
cd rk356x_linux/kernel/drivers/net/wireless/
tar -zxvf L.SMAC.19Q3.2042.02_FH.tar.gz
mv L.SMAC.19Q3.2042.02 ssv6x5x
```
如果是移植到 Linux 平台,可参考 platforms 下 t20 平台的相关配置文件。
将以上平台相关文件 copy 到 ssv6x5x 目录,进入 ssv6x5x 目录下:
```bash
cd ssv6x5x
cp platforms/platform-config.mak .
cp platforms/t20.cfg ssv6x5x.cfg
cp platforms/t20-generic-wlan.c ssv6x5x-generic-wlan.c
cp platforms/t20-wifi.cfg image/ssv6x5x-wifi.cfg
cp platforms/t20-wifi.cfg ssv6x5x-wifi.cfg
```
根据平台类型 copy 出一份正确的 makefile, 因为 ssv6x5x/makefile 默认驱动目录带的是 ubuntu 环境的 makefile 文件,不能直接使用。
```bash
cp Makefile.cross_linux Makefile
```
将 ssv6x5x 驱动存放在内核目录 rk356x_linux/kernel/drivers/net/wireless/ 路径下。
修改 drivers/net/wireless 目录的 Makefile新增
```sh
obj-$(CONFIG_SSV6X5X) += ssv6x5x/
```
![](https://s2.loli.net/2022/03/11/9Aa8D7KzEGtBQbX.png)
以及 Kconfig 文件,新增
```sh
source "drivers/net/wireless/ssv6x5x/Kconfig"
```
![](https://s2.loli.net/2022/03/11/iktgJKjdTOvVqMl.png)
在 rk356x_linux/kernel 路径下重新配置内核 menuconfig:
```bash
sudo make ARCH=arm64 CROSS_COMPILE=aarch64-himix100-linux- menuconfig
```
networking support -> RF switch subsystem support ->下面的都选上(在 Networking support 中快速检索,搜索 RFKILL)
![](https://s2.loli.net/2022/03/11/QVUc9RZEbDdnpqf.png)
networking support -> wireless ->cfg80211 - wireless configuration API
networking support -> wireless ->Generic ...(mac80211)
![](https://s2.loli.net/2022/03/11/VxGBI6cHlmbSWT2.png)
然后就可以选上驱动:
Device Drivers -> Network device support -> Wireless LAN -> SSV6X5X Wireless driver
(可在 device drivers 中快速检索,依次搜索 NETDEVICES、WLAN、SSV6X5X
![](https://s2.loli.net/2022/06/16/p7guPtdqXoeOYJh.png)
在在 rk356x_linux 根目录下编译驱动,并重新编译一遍内核和 recovery, 编译生成的 ssv6x5x.ko 在 kernel/drivers/net/wireless/ssv6x5x 下
```bash
sudo ./build.sh modules
sudo ./build.sh kernel (如果又进入menuconfig那就检查一下上面几个项目是否全部勾选上了)
sudo ./build.sh recovery
```
同样,重新打包生成镜像文件:
```bash
sudo ./mkfirmware.sh
sudo ./build.sh updateimg
```
按照烧录流程重新烧录
> ### 驱动运行
确认系统是否识别到 wifi对于 usb wifi执行 lsusb 可以看到如下则确认识别 (for 6155/6255 型号的芯片)
```
Bus 005 Device 003: ID 8065:6000
```
接入以太网安装相关包:
```bash
sudo apt-get update && sudo apt-get install vim usbutils net-tools microcom udhcpc wireless-tools
```
复制相关文件到板子的文件系统中
复制可以用 U 盘复制,拷贝到 U 盘后插入到矽灵通上fdisk -l 查看找到 usb 设备,例如 /dev/sda1
执行挂载进行拷贝
```shell
mkdir -p /mnt/usb
mount /dev/sda1 /mnt/usb
```
复制 ssv6x5x/image/ssv6x5x-wifi.cfg 到板子文件系统下 /etc/firmware/ (若无 firmware 文件夹新建即可)
复制 ssv6x5x.ko 到板子任意目录下
加载驱动 ssv6x5x.ko
执行如下指令stacfgpath= 路径请根据实际路径填写)
```bash
insmod ssv6x5x.ko stacfgpath=/etc/firmware/ssv6x5x-wifi.cfg
```
insmod 结束:
![](https://s2.loli.net/2022/06/16/Kdx2VXQ5ujDOwFi.png)
insmod 完成后 wifi 可能会重复扫描周围网络,暂时不用管,接着执行下面步骤可以解决:
ifconfig -a 查看网卡名称,这边是 wlxa47d9fb5b922 (具体要看板子)
![](https://s2.loli.net/2022/05/31/rhaCVkpzPKJQyfn.png)
为了后续操作方便,可以对网卡重命名为 wlan0 (非必要)
```
ip link set wlxa47d9fb5b922 down
ip link set wlxa47d9fb5b922 name wlan0
ip link set wlan0 up
```
执行: ifconfig eth0 down && ifconfig wlan0 up
![](https://s2.loli.net/2022/05/31/m3czVTRvZPkQWu2.png)
> ### WIFI 网络连接
扫描周围无线网络:
```bash
iwlist wlan0 scan
```
![](https://s2.loli.net/2022/05/31/Fw2ND6pEYCQrZcB.png)
连接网络:
```bash
iwconfig wlan0 essid "AIIT-Guest"
```
![](https://s2.loli.net/2022/05/31/5z1HXichCDe4Ob2.png)
dhcp 获取 ip
```bash
udhcpc -i wlan0
```
![](https://s2.loli.net/2022/05/31/TGe6lEIkD4F1C7J.png)
ip 分配成功后,进行 ping 测试,需要 -I 指定网卡
```shell
ping 114.114.114.114 -I wlan0
ping www.baidu.com -I wlan0
```
![](https://s2.loli.net/2022/05/31/YVq9MC6fpPUjzNm.png)
## 5. USB 调试
首先通过 fdisk -l 查看插入的 usb 设备,如下我这里插入的 u 盘是 /dev/sda2
```shell
Device Boot Start End Sectors Size Id Type
/dev/sda2 2 15149055 15149054 7.2G c W95 FAT32 (LBA)
```
进行挂载
```shell
mkdir /root/udisk
mount /dev/sda2 udisk
```
![](https://s2.loli.net/2022/02/22/IWhXL2bw3GNi8pd.png)
## 6. SD 卡调试
首先通过 fdisk -l 查看插入的 SD 卡,如下我这里插入的 SD 卡是 /dev/mmcblk1p1
```shell
Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 8192 62333951 62325760 29.7G c W95 FAT32 (LBA)
```
进行挂载
```shell
mkdir /root/sdcard
mount /dev/mmcblk1p1 sdcard/
```
![](https://s2.loli.net/2022/02/24/81H9mMYicFCOash.png)
## 7. 显示图片
烧入 Debian 镜像后,把要显示的图片通过 SD 卡或者 U 盘拷贝进板子,点击打开后全屏幕显示即可。
## 8. emmc 扩容
rk3568 配置的是 16GB 的 emmc但初始只有 3.2GB
![](https://s2.loli.net/2022/04/22/HNKrfO43thWe78a.png)
为了充分利用剩余空间,需要修改烧录文件 rk356x_linux/rockdev/parameter.txt该文件实际上软连接到了(rk356x_linux/device/rockchip/rk356x/rk356x/parameter-buildroot-dlm3568.txt)。在生成 update.img 之前先修改 parameter 为以下内容,其中 rootfs 一项即对应文件系统所占大小,格式为 "size@LBA(rootfs)"
```
FIRMWARE_VER: 1.0
MACHINE_MODEL: RK3568
MACHINE_ID: 007
MANUFACTURER: RK3568
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: 0xffffffff
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
TYPE: GPT
CMDLINE: mtdparts=rk29xxnand:0x00002000@0x00004000(uboot),0x00002000@0x00006000(misc),0x00010000@0x00008000(boot),0x00010000@0x00018000(recovery),0x00010000@0x00028000(backup),0x017F6000@0x00038000(rootfs),0x00040000@0x0182E000(oem),0x0000A000@0x0186E000(userdata),-@0x01878000(data:grow)
uuid:rootfs=614e0000-0000-4b53-8000-1d28000054a9
```
然后重新打包生成整机镜像:
```
<SDK_PATH>$ sudo ./build.sh updateimg
```
**烧录完成后,此时配置可能并未刷新,需要更新下 blocks:**
```
resize2fs /dev/mmcblk0p6
```
![](https://s2.loli.net/2022/04/22/qX5RuLnDNJ9vSZk.png)
然后 df -h 可以看到文件系统大小已经扩容成为 12G:
![](https://s2.loli.net/2022/04/22/l5Otv6FydQf7xJB.png)
## 9. AIM16T 从模式烧录
由于出厂时 AIM16T 镜像烧录错误EP 模式烧成了 RC 模式,所以现在重新烧录,后盖有遮挡,需要去掉螺丝打开后盖。
使用 USB 转 TTL 串口,接入 AIM16T 烧录口(烧录口如下图所示的 JP4)
![USB-TTL](image/USB-TTL.jpg)
拨码开关拨到 on(拨码开关的位置如下图所示),拨码开关拨到 on 后需要重新上电
![](https://s2.loli.net/2022/04/21/idgKvlcH1xqMTkw.png)
解压 fwu_tool_mlu220.rar 文件,压缩包位于**XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Reference_Doc/AIM16T_EP_Burn**下,解压后更改文件目录权限
如果没有 rar 相关的命令,需要先安装,如果有这一步忽略
```shell
sudo apt-get install rar
sudo apt-get install unrar
```
把 fwu_tool_mlu220.rar 复制到 linux 环境下,进行解压
```
unrar x fwu_tool_mlu220.rar
chmod -R 777 fwu_tool_mlu220
```
进入目录,执行 EP 模式镜像烧录
```
cd fwu_tool_mlu220
sudo ./start_burn.sh 3
```
以下表示烧录完成
![](https://s2.loli.net/2022/04/21/qi4nmkzCxRHf6LO.png)
将拨码开关拨回 12重新上电在 rk3568 命令行中输入 lspci 命令,若能找到以下设备则表示 EP 模式烧录成功
![](https://s2.loli.net/2022/04/21/2cITg5NqYptUjVA.png)
接下来在 AIM16T 上运行 yolo_demo 来检验,这一步需要四个文件:
1firmware_sys.img、cambricon-drv.ko、cnmon 这三个文件位于 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Source_Code/AIM16T 下的 rk3568_aim16t.tar 压缩包内,从压缩包内取出
2yolo_demo_rk3568.tar.gz 位于 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Source_Code 下
这四个文件用 nfs 或 U 盘拷贝进板子(U 盘的挂载方式见第 4 节 USB 调试,如下 udisk 为挂载后的路径),把 AIM16T 驱动放在对应路径:
```
mkdir -p /lib/firmware/cambricon/mlu220
cp -a /root/udisk/firmware_sys.img /lib/firmware/cambricon/mlu220
```
加载 AIM16T 模组:
```
cp /root/udisk/cambricon-drv.ko /root
cd /root
insmod cambricon-drv.ko
```
以下表示模组加载成功:
![](https://s2.loli.net/2022/04/21/vn7FPZj3pqwMxYd.png)
此时运行 cnmon 脚本可以查看到 mlu220 设备的一些信息:
```
cp /root/udisk/cnmon /root
chmod 777 cnmon
./cnmon
```
![](https://s2.loli.net/2022/04/22/shWmv5SrBcGnb4A.png)
解压 yolo_demo 并运行推理测试:
```
mkdir -p /root/yolo
cp /root/udisk/yolo_demo_rk3568.tar.gz /root/yolo
cd /root/yolo
tar -zxf yolo_demo_rk3568.tar.gz
cd yolo_demo
source ./env.sh
./cambricon_demo
```
可以看到 demo 正常运行:
![](https://s2.loli.net/2022/04/22/X9Tytfaswhq5orI.png)
## 10.RISCV-K210 烧录、调试
烧录/调试RISCV 调试引脚同烧录引脚,均为 CO_CPU_ISP_TX/CO_CPU_ISP_RX。除了这两根线外还需要一根 GND。串口波特率均为 115200。
引脚图可以参考 2.2 节
![k210-boot](image/k210-boot.jpg)
用 K-Flash.exe 工具进行 bin 包的烧录。K-Flash.exe 工具位于 XiHuiTong_Linux_Support_Collaborate_With_XiUOS/Reference_Doc 目录下:
![K-Flash](image/K-Flash.jpg)
在 ① 选择串口 com 号
在 ② 处选择波特率,选择 115200
在 ③ 处选择编译出的 nuttx.bin 文件
设备在上电时确保 Boot 和 GND 短接,这是升级模式。
点击 ④ 处 Flash 开始烧录,显示烧录完成即可,中间有报错的话,重新 Flash。
烧写完毕重新上电,进入 shell。
![k210-shell](image/k210-shell.jpg)

View File

@ -61,7 +61,19 @@ module.exports = {
// before: require('./mock/mock-server.js')
},
configureWebpack: {
devtool: 'source-map'
devtool: 'source-map',
module: {
rules: [
// 配置读取 *.md 文件的规则
{
test: /\.md$/,
use: [
{ loader: 'html-loader' },
{ loader: 'markdown-loader', options: {}}
]
}
]
}
},
chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload
@ -80,6 +92,27 @@ module.exports = {
// set svg-sprite-loader
config.module.rule('svg').exclude.add(resolve('src/icons')).end()
// config.module
// .rule('md')
// .test(/\.md$/)
// .use('url-loader')
// .loader('url-loader')
// .options({
// limit: 10,
// generator: (content, mimetype, encoding, resourcePath) => {
// return ''
// }
// })
// .end()
config.module
.rule('md')
.test(/.md$/)
.use('html-loader')
.loader('html-loader')
.end()
.use('markdown-loader')
.loader('markdown-loader')
.end()
config.module
.rule('icons')
.test(/\.svg$/)