目的
体验starfive开发板基础功能,方便烧录和调试OpenHarmony。
准备工作
接线usb
针脚 板子 连接线 2 ==== (GND) === GND 4 ==== (TXD) === RXD 6 ==== (RXD) === TXD
电源
插上type c口供电
安装串口工具
wget https://the.earth.li/~sgtatham/putty/0.75/putty-0.75.tar.gz
tar -xvf putty-0.75.tar.gz
cd putty-0.75
./configure --prefix=/usr
make
sudo make install
sudo usermod -a -G dialout username
sudo apt install picocom
picocom -b 115200 /dev/ttyUSB0
#Serial:/dev/ttyUSB0
#Speed:115200
#Connection types:Serial
准备磁盘
sd卡,U盘均可,分区与格式自定,如果用efi分区必须fat sd卡 分区名字显示mmcblk0pN U盘 分区名字显示sdaN
自定义debian
安装组件
sudo apt install mmdebstrap qemu-user-static binfmt-support debian-ports-archive-keyring
下载key
wget -O - https://www.ports.debian.org/archive_2022.key | sudo apt-key add -
制作riscv-debian
sudo mmdebstrap --architectures=riscv64 --include="debian-ports-archive-keyring" sid /mnt/debian "deb http://deb.debian.org/debian-ports sid main" "deb http://deb.debian.org/debian-ports unreleased main"
更新组件
sudo cp /usr/bin/qemu-arm-static /mnt/debian/usr/bin/
sudo chroot /mnt/debian
echo "debian-riscv64" >/etc/hostname
echo "127.0.0.1 localhost" >/etc/hosts
echo "127.0.0.1 debian-riscv64" >/etc/hosts
echo "nameserver 8.8.8.8" >/etc/resolv.conf
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
apt update
passwd root
复制文件
mkdir temp
sudo mount /dev/sdc3 /temp
cp -rv /mnt/debian/* /temp
sudo umount /temp
引导启动
安装tftp服务
sudo apt install tftpd-hpa
sudo vi /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"
#重启tftp服务
sudo service tftpd-hpa restart
u-boot参数
setenv ipaddr 192.168.1.88;
setenv serverip 192.168.1.1;
setenv netmask 255.255.255.0;
setenv gatewayip 192.168.1.1;
setenv dnsip 114.114.114.144;
saveenv;
fatinfo mmc 1:1
fatls mmc 1:1
fstype mmc 1:0
fatload mmc 1:1 80800000 zImage
part list mmc 1
part uuid mmc 0
part uuid mmc 0:2
ext4ls mmc 0:2
ext4load mmc 0:2 0x80800000 uImage;
ext4load mmc 0:2 0x88000000 ramdisk.img;
ext4load mmc 0:2 0x80800000 uImage;
ext4load mmc 0:2 0x9f000000 jh7100-starfive-visionfive-v1.dtb;
bootm 0x80800000 0x9f000000;
booti 0x80800000 0x9f000000;
开始测试
tftp引导测试->正常
#正在测试ohos,启动文件直接拿来用了,原始编译的为Image Image.gz jh7100-starfive-visionfive-v1.dtb,可以自行配置
#将启动文件放致tftp目录
;setenv bootargs 'console=ttyS0,115200n8 earlycon=sbi stmmaceth=chain_mode:1 loglevel=7 root=/dev/sda1 rootfstype=ext4 rw rootwait init=/sbin/init ip=dhcp';tftpboot 0x80200000 hdf-uImage;tftpboot 0x90200000 hdf.dtb;bootm 0x80200000 - 0x90200000;
配置源
vi /etc/apt/sources.list
deb http://ftp.ports.debian.org/debian-ports/ sid main
deb http://ftp.ports.debian.org/debian-ports/ unreleased main
deb https://mirror.sjtu.edu.cn/debian-ports/ sid main
deb https://mirror.sjtu.edu.cn/debian-ports/ unreleased main
deb https://mirror.sjtu.edu.cn/debian-ports/ unstable main
deb http://ftp.kr.debian.org/debian-ports/ sid main
deb http://ftp.kr.debian.org/debian-ports/ unreleased main
deb http://deb.debian.org/debian-ports sid main
deb http://deb.debian.org/debian-ports unreleased main
测试wifi
apt install iw wpasupplicant
iw dev
ip link show wlan0
ip link set wlan0 up
iw wlan0 scan | grep SSID
wpa_supplicant -B -i wlan0 -c <(wpa_passphrase "ChinaNet" "12345678")
dhclient wlan0
测试桌面->正常
apt install xfce4
startx
测试声音->正常
apt install alsa-utils
aplay demo.wav
#hdmi 接口貌似不能发音?暂未深入测试
测试drm->正常
apt install libdrm-tests
systemctl disable lightdm.service
modetest -M starfive -s 34@32:1920x1080 -P 31@32:1024x768 -F tiles -C
测试weston->正常
weston --tty=2 --drm-device=card0 --continue-without-input --use-pixman
测试图形工具->基本正常
apt-get install glmark2
glmark2
apt-get install mesa-utils
glxgears
apt install kmscube
kmscube -D /dev/dri/card0 -M smooth
kmscube -D /dev/dri/card0 -M rgba
|