2021年9月

sudo apt-get install -y bluez-tools pulseaudio-module-bluetooth
sudo nano /etc/bluetooth/audio.conf
[General] Disable=Socket Enable=Media,Source,Sink,Gateway
sudo systemctl restart bluetooth pactl unload-module module-bluetooth-discover pactl load-module module-bluetooth-discover

sudo apt-get -y install build-essential git mercurial cmake curl screen unzip device-tree-compiler libncurses-dev ppp cu linux-image-extra-virtual u-boot-tools android-tools-fastboot android-tools-fsutils python-dev python-pip libusb-1.0-0-dev g++-arm-linux-gnueabihf pkg-config libacl1-dev zlib1g-dev liblzo2-dev uuid-dev libc6-i386 lib32stdc++6 lib32z1

git clone https://github.com/xue-fei/CHIP-buildroot.git

cd CHIP-buildroot
git checkout -b 4.4.13-ntc-mlc origin/4.4.13-ntc-mlc
make chip_defconfig
make

错误0
要以不安全的方式连接至 releases.linaro.org,使用“--no-check-certificate”
make menuconfig
load
在wget命令中加入--no-check-certificate的参数
Build options --->Commands --->(wget --passive-ftp -nd -t 3 --no-check-certificate) Wget command

用Ubuntu14.04无以下错误
错误1
Please port gnulib freadahead.c to your platform
cd output/build/host-m4-1.4.17
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h

错误2
gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral]

nano output/build/host-libglib2-2.44.1/glib/gdate.c
头部添加(不包含@)
@#pragma GCC diagnostic ignored "-Wformat-nonliteral"

错误3
gdbusmessage.c:2698:30: error: '%s' directive argument is null [-Werror=format-overflow=]

nano output/build/host-libglib2-2.44.1/gio/gdbusmessage.c
2698行 signature_str判空一下

if (signature_str == NULL)
{

goto out;

}
nano output/build/host-libglib2-2.44.1/gio/gdbusauth.c
1295行 line提前判空
if (line == NULL)
{

goto out;

}

错误4
lib/fseterr.c:77:3: error: #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."

cd output/build/host-bison-3.0.4
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h

未完待续

我这里用的是Ubuntu20.04
sudo apt install device-tree-compiler
wget https://github.com/xue-fei/CHIP-u-boot/archive/refs/tags/production-v1.2.zip
unzip production-v1.2.zip
cd CHIP-u-boot-production-v1.2
nano Makefile
头部添加
export CROSS_COMPILE=arm-linux-gnueabihf-
export ARCH=arm

另外 mv include/linux/compiler-gcc7.h include/linux/compiler-gcc9.h
Ubuntu14.04上不用处理
最后
make CHIP_defconfig
make

最后说明,生成的文件还未测试,等测试后贴出结果

sendpix1.jpg
sendpix4.jpg

从Ubuntu18.04升级到20.04后,chip刷机提示usb_bulk_send() ERROR -7: Operation timed out
解决方法
wget http://ftp.br.debian.org/debian/pool/main/s/sunxi-tools/sunxi-tools_1.4.1-1_amd64.deb
sudo dpkg -i sunxi-tools_1.4.1-1_amd64.deb
然后

sudo apt-mark hold sunxi-tools

参考链接
https://steward-fu.github.io/website/umpc/pocketchip/fix_usb.htm
https://github.com/Thore-Krug/Flash-CHIP/issues/21