鸽子的折腾日记④丨Firefly ROC-RK3328-CC 折腾记

本文在2021年11月5日首发于个人网站【鸽子的小窝】。

前言

近期有了个攒一台Voron 2.4的想法,由于官方推荐使用Klipper固件,自然少不了一台上位机了。而因众所周知的原因,树莓派价格居高不下,囊中羞涩的我在某宝闲逛时偶然发现一家店铺以150块的超低价格售卖2GB内存版本的Firefly ROC-RK3328-CC开发板,且这块板子的孔位基本与树莓派兼容,意味着只要安装上合适版本的Linux与Python环境,我们就可以让他运行Klipper的上位机啦~


就是这块板子啦~

刷入系统

首先当然是准备一张用于刷入系统的至少16G大小的内存卡了~
然后去Firefly官方下载用于刷入固件的SD Firmware Tool软件和固件文件。

近期官方更新了Ubuntu 20.04的镜像,可以省去本文末尾的更新流程。因本文撰写完成时,官方仅提供了Ubuntu 16.04和Ubuntu 18.04的镜像,故本文以刷入Ubuntu 18.04系统为例。
2023.5.15更新:又删掉了……

下载并解压好固件后,打开SD Firmware Tool,按下图操作即可。



刷入完毕后会出现提示:


连接电脑

此时将内存卡插入开发板,使用USB转串口线将开发板连接到电脑。(板子上已经标注好了TXD、RXD等引脚,交叉连接到USB转串口线上即可。)


PuTTY连接

打开PuTTY软件,设置好串口和波特率后即可点击Open连接。

串口号因人而异,请按照自己情况设置~

MobaXTerm连接

首先点击软件左上角的Session按钮:



进入界面后,按下图设置好串口号(可以不设置,这样就是每次联机时手动选择)、波特率后点击OK保存。


图片.png

初步设置

上电后稍等片刻,等待系统启动完毕后,即可进行初步的设置。
启动完毕后的终端如下所示:


系统为我们创建了一个默认的账户firefly(密码也为firefly),可以输入su firefly来进入。

root@firefly:~# su firefly
To run a command as administrator (user "root"), use "sudo ".
See "man sudo_root" for details.

firefly@firefly:/root$ cd
firefly@firefly:~$

连接Wi-Fi(使用有线的小伙伴可以跳过这步)

由于这个开发板并没有Wi-Fi功能,所以需要准备一个支持Linux的USB无线网卡才能连接到Wi-Fi。
连接好无线网卡后,输入ip addr show来查看无线网卡是否被正常驱动。正常情况应该会出现一个以wl开头的设备,如下所示:

firefly@firefly:~$ ip addr show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 5e:9a:6b:**:**:** brd ff:ff:ff:ff:ff:ff
3: rename3:  mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 5c:f3:70:**:**:** brd ff:ff:ff:ff:ff:ff
4: wlx5cf370******:  mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 5c:f3:70:**:**:** brd ff:ff:ff:ff:ff:ff

其中wlx5cf370******为插入的USB无线网卡。
这时输入sudo nmcli d wifi connect "wifi名字" password "密码"即可连接Wi-Fi网络:

firefly@firefly:~$ sudo nmcli d wifi connect "HUAWEI-162-2" password "xiaoyao123456"
Device 'wlx5cf370******' successfully activated with '9586f28f-4d7c-49ba-8ded-b87c6277464a'.

更换docker-ce软件源

该版本系统已经配置阿里云源,一般情况下无需换源。但由于配置了官方docker-ce源,可能会导致更新极其缓慢。
打开/etc/apt/sources.list.d/docker.list后,将https://download.docker.com/linux/ubuntu更换为http://mirrors.aliyun.com/docker-ce/linux/ubuntu即可。

升级软件

升级软件前需要删除gstreamer1.0-rockchip1软件包,它会导致升级时出现如下错误:

dpkg: error processing archive /var/cache/apt/archives/gstreamer1.0-rockchip1_1.14.2firefly3_arm64.deb (--unpack):
 trying to overwrite '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstrkximage.la', which is also in package gstreamer1.0-rockchip1-extra 20191113-1firefly1
Errors were encountered while processing:
 /var/cache/apt/archives/gstreamer1.0-rockchip1_1.14.2firefly3_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

卸载后,运行sudo apt upgrade即可升级软件。
在升级系统的过程中,可能会出现如下替换文件的提示,按Y键确认替换即可(使用默认的不替换会导致部分功能出现问题)。

Configuration file '文件名'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** 文件名 (Y/I/N/O/D/Z) [default=N] 

升级系统到最新版本

虽然Ubuntu18.04依旧被官方支持,但如果需要一些新版本的软件(如Python),最简单的方式就是升级到最新的LTS版本。
使用sudo apt install ubuntu-release-upgrader-core命令安装升级工具。

升级系统到最新版本

使用do-release-upgrade命令升级系统。
因最新版本的Chromium浏览器仅通过Snap源提供,为了防止因无法连接到snap导致的翻车,可以使用sudo apt remove chromium-browser命令先将Chromium浏览器卸载。
若显示如下提示信息,则需要重启系统:

firefly@firefly:~$ do-release-upgrade
Checking for a new Ubuntu release
You have not rebooted after updating a package which requires a reboot. Please reboot before upgrading.

如果在国内,可能会出现无法连接到Snap软件源的情况。如出现以下提示,直接按Y继续即可。

Connection to Snap Store failed

Your system does not have a connection to the Snap Store. For the
best upgrade experience make sure that your system can connect to
api.snapcraft.io.
Do you still want to continue with the upgrade?

Continue [yN]

此时还会出现找不到镜像的提示,这是由于已经更换第三方镜像源所导致,按Y继续即可。

Updating repository information

No valid mirror found

While scanning your repository information no mirror entry for the
upgrade was found. This can happen if you run an internal mirror or
if the mirror information is out of date.

Do you want to rewrite your 'sources.list' file anyway? If you choose
'Yes' here it will update all 'bionic' to 'focal' entries.
If you select 'No' the upgrade will cancel.

Continue [yN]

RK版系统由于内置了一些其它软件源,升级前会被升级工具自动禁用,出现提示后按回车继续即可:

Third party sources disabled

Some third party entries in your sources.list were disabled. You can
re-enable them after the upgrade with the 'software-properties' tool
or your package manager.

To continue please press [ENTER]

最后会进行升级前的确认,确认无误的话按Y继续:

Do you want to start the upgrade?


5 installed packages are no longer supported by Canonical. You can
still get support from the community.

17 packages are going to be removed. 933 new packages are going to be
installed. 1206 packages are going to be upgraded.

You have to download a total of 1057 M. This download will take about
5 minutes with your connection.

Installing the upgrade can take several hours. Once the download has
finished, the process cannot be canceled.

 Continue [yN]  Details [d]

等待一两个小时即可升级完毕。期间可能有需要确认的替换操作,只需按Y确认即可。

你可能感兴趣的:(鸽子的折腾日记④丨Firefly ROC-RK3328-CC 折腾记)