分类 pocketchip 下的文章

1、下载所有文件
链接:https://pan.baidu.com/s/16qNNe7W6GfXwJy0LFG-KKw?pwd=oiho
提取码:oiho

2、跳线连接GND-FEL,插电脑,装驱动 zadig-2.8.exe
9aca69dc5532f090e33464375b1bb3f8.jpg
https://linux-sunxi.org/FEL/USBBoot#Using_sunxi-fel_on_Windows
Zadig-fel-winusb-instructions.png
--来自百度网盘超级会员V5的分享

3、打开下载文件夹,输入cmd 回车
1.png

4、执行以下命令,等有空再写批处理吧……

sunxi-fel spl sunxi-spl.bin 
sunxi-fel -p write 0x4a000000 u-boot-dtb-temporary.bin 
sunxi-fel -p write 0x42000000 sunxi-spl-with-ecc-toshiba.bin
sunxi-fel -p write 0x43000000 sunxi-spl-with-ecc-hynix.bin 
sunxi-fel -p write 0x43400000 u-boot-dtb-perm.img 
sunxi-fel -p write 0x44300000 flash_bootloader_erase_nand.scr 
sunxi-fel -p write 0x44400000 bootimage_swupdate.itb 
sunxi-fel exe 0x4a000000

执行完毕,等待一段时间后chip会自动关闭
然后再去掉跳线,重新插上usb
长按chip上的小按键亮灯开机,或者是pocketchip按到开机,等一段时间,设备管理器里会出现串口,如果没有就装一下串口驱动
zadig-2.8.exe
2955932512.jpg

5、装RNDIS驱动
QQ截图20230625112426.png
选RNDIS那个文件夹
然后在浏览器里打开http://chip.local/或者http://10.10.10.10/
选ntc-chip_2022.02.25.swu等刷完
80a0ca4c72bc07f6f70b6c97dfbd76b3.jpg

c09965fb622415cfcc0052f422e3653c.jpg

感谢网友@777提供的刷机图

ubuntu22.04

sudo apt install fakeroot git kernel-wedge quilt ccache flex bison libssl-dev dh-exec rsync libelf-dev bc crossbuild-essential-armhf
sudo apt install dpkg-dev fakeroot gcc-arm-linux-gnueabihf dh-make libncurses-dev gcc-10-arm-linux-gnueabihf

git clone https://github.com/macromorgan/chip-debroot.git
cd chip-debroot
git clone -n https://salsa.debian.org/kernel-team/linux.git debian-kernel
cd debian-kernel
git checkout debian/5.15.15-2_bpo11+1
git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable ../linux-stable
debian/bin/genorig.py ../linux-stable
ARCH=armhf
FEATURESET=none
FLAVOUR=armmp
export $(dpkg-architecture -a$ARCH)
export DEB_BUILD_PROFILES="cross nopython nodoc pkg.linux.notools"
export MAKEFLAGS="-j$(($(nproc)*2))"
export DEBIAN_KERNEL_DISABLE_DEBUG=yes
fakeroot make -f debian/rules clean
fakeroot make -f debian/rules orig
fakeroot make -f debian/rules source
fakeroot make -f debian/rules.gen setup_${ARCH}_${FEATURESET}_${FLAVOUR}
cd debian/build/build_armhf_none_armmp
cp /home/xuefei/chip-debroot/kernel_files/debian.config /home/xuefei/chip-debroot/debian-kernel/debian/build/build_armhf_none_armmp/.config
cd ~
cd chip-debroot/debian-kernel
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C debian/build/build_armhf_none_armmp
fakeroot make -f debian/rules.gen binary-arch_${ARCH}_${FEATURESET}_${FLAVOUR}

暂未应用补丁,且待验证……

make[2]: Entering directory '/home/xuefei/pocketchip/debian-kernel'
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol -- 
dh_md5sums
dh_builddeb -- -Zxz 
dpkg-deb: building package 'linux-image-5.15.0-0.bpo.3-armmp' in '../linux-image-5.15.0-0.bpo.3-armmp_5.15.15-2~bpo11+1_armhf.deb'.
make[2]: Leaving directory '/home/xuefei/pocketchip/debian-kernel'
make[1]: 离开目录“/home/xuefei/pocketchip/debian-kernel”

sendpix0.jpg

ubuntu16.04
仓库的地址换成ntc-chip-revived的
https://github.com/ntc-chip-revived/CHIP-linux/tree/a58ccbc30da8f1d9bcb4770af79bbbc41023908b
https://github.com/ntc-chip-revived/CHIP-u-boot/tree/c23364e2cd21ef74f7405fa03e537582f062c4c0
https://github.com/ntc-chip-revived/RTL8723BS/tree/1b4af26d8754150e420ba4a642610e97d904b8da

遇到的一些错误

bash: ./build.sh: /bin/env: 解释器错误: 没有那个文件或目录
删除#!/bin/env bash

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: dtc: 未找到
sudo apt-get install device-tree-compiler

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: fastboot: 未找到
ERROR: fastboot not found!
sudo apt-get install android-tools-adb android-tools-fastboot

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: sunxi-fel: 未找到
ERROR: sunxi-fel not found!
sudo apt-get install sunxi-tools

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: ubinize:未找到
ERROR: ubinize not found!
sudo apt install mtd-utils

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: img2simg:未找到
ERROR: img2simg not found!
sudo apt install img2simg
sudo apt install android-tools-fsutils

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: arm-linux-gnueabihf-gcc: 未找到
ERROR: arm-linux-gnueabihf-gcc not found!
sudo apt install gcc-arm-linux-gnueabihf

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: arm-none-eabi-gcc:未找到
sudo apt install gcc-arm-none-eabi

/home/xuefei/chip-arch-build/scripts/check_prereqs.sh: 第 20 行: hash: mkimage: 未找到
ERROR: mkimage not found!
sudo apt-get install u-boot-tools

正在解析主机 de7.mirror.archlinuxarm.org (de7.mirror.archlinuxarm.org)... 失败:未知的名称或服务。
wget: 无法解析主机地址 “de7.mirror.archlinuxarm.org”
Entering fakeroot and making image
^Cubinize: error!: cannot stat "ubifs.img" referred from section "ubifs"
         error 2 (No such file or directory)
Cannot open input file ubi.img
Downloading generic armv7 image
--2022-05-06 23:23:44--  http://de7.mirror.archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz
正在解析主机 de7.mirror.archlinuxarm.org (de7.mirror.archlinuxarm.org)... 失败:未知的名称或服务。
wget: 无法解析主机地址 “de7.mirror.archlinuxarm.org”
Entering fakeroot and making image
修改scripts下make_rootfs.sh第10行文件地址为http://mirror.archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz
估计需要科学上网

整理相关依赖

sudo apt-get install device-tree-compiler android-tools-adb android-tools-fastboot sunxi-tools mtd-utils android-tools-fsutils gcc-arm-linux-gnueabihf gcc-arm-none-eabi u-boot-tools

Entering fakeroot and making image
ubinize: error!: error in section "ubifs": size of the image file "ubifs.img" is 598671360, which is larger than volume size 524288000
Cannot open input file ubi.img
configs文件夹下ubinize.cfg中vol_size=500MiB改成生成的ubifs.img的实际大小
我这里是598.7M,所以我改为600M