偶然间在淘宝上发现了20块钱的a20行车记录仪的主板,
淘宝链接:https://item.taobao.com/item.htm?spm=a230r.1.14.91.6de65a756h4Fsi&id=594462933314&ns=1&abbucket=8#detail
到手后发现运行camdroid,通过bootlogo来看是凌度的机子,
先将bananapi的官方系统写入,成功启动,但是无法使用usb,
bananian系统下载地址:
https://mirrors.tuna.tsinghua.edu.cn/bananian/releases/bananian-latest.zip
从原系统无法获取到scripts.bin,
于是就想编译a20的lichee来使用usb。
全志官方下载地址:http://dl.linux-sunxi.org/SDK/A20-SDK-2.0/aw.tar.bz2
有5个G,但是真正使用的是里面的lichee-2.0.tar.gz,
但是在github上找到了相应项目,https://github.com/dwlinux/Armcore_a20_V30_lichee
参考晕哥的这篇教程:https://whycan.cn/t_1522.html
注意,一定要使用ubuntu-14.04,不然的话遇到的坑是无法填的,
首先安装依赖
sudo apt-get install -y libncurses-dev lib32z1 lib32ncurses5 lib32stdc++6 u-boot-tools make g++ gettext python unzip fakeroot bison texinfo bc flex gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf
cd /opt
git clone --depth=1 https://github.com/dwlinux/Armcore_a20_V30_lichee
这里可以将github.com换成github.com.cnpmjs.org提高克隆速度。
然后直接编译就行了
cd Armcore_a20_V30_lichee
./build.sh -m all
其中会遇到几个坑,
1.host-m4-1.4.15
In file includedfrom clean-temp.h:22:0,
from clean-temp.c:23:
./stdio.h:456:1:error: 'gets' undeclared here (not in a function)
_GL_WARN_ON_USE(gets, "gets is a security hole - use fgets instead");
对host-m4-1.4.15/lib/stdio.in.h文件根据补丁内容自行修改
<span style="font-family:Arial;font-size:12px;"># Begin patch
=== modified file 'grub-core/gnulib/stdio.in.h'
--- grub-core/gnulib/stdio.in.h 2010-09-20 10:35:33 +0000
+++ grub-core/gnulib/stdio.in.h 2012-07-04 15:18:15 +0000
@@ -140,8 +140,10 @@
/* It is very rare that the developer ever has full control of stdin,
so any use of gets warrants an unconditional warning. Assume it is
always declared, since it is required by C89. */
+#if defined gets
#undef gets
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
2.host-autoconf-2.65
conftest.c:14625:must be after `@defmac' to use `@defmacx'
make[3]: ***[autoconf.info] Error 1
make[3]: Leavingdirectory`/opt/Armcore_a20_V30_lichee/out/linux/common/buildroot/build/host-autoconf-2.65/doc'
make[2]: ***[install-recursive] Error 1
make[2]: Leavingdirectory`/opt/Armcore_a20_V30_lichee/out/linux/common/buildroot/build/host-autoconf-2.65'
make[1]: ***[install] Error 2
make[1]: Leavingdirectory`/opt/Armcore_a20_V30_lichee/out/linux/common/buildroot/build/host-autoconf-2.65'
make: ***[/opt/Armcore_a20_V30_lichee/out/linux/common/buildroot/build/host-autoconf-2.65/.stamp_host_installed]Error 2
应用以下补丁
--- autoconf-2.65/doc/autoconf.texi 2009-11-05 10:42:15.000000000 +0800
+++ autoconf-2.65/doc/autoconf.texi.new 2013-05-28 05:41:09.243770263 +0800
@@ -15,7 +15,7 @@
@c The ARG is an optional argument. To be used for macro arguments in
@c their documentation (@defmac).
@macro ovar{varname}
-@r{[}@var{\varname\}@r{]}@c
+@r{[}@var{\varname\}@r{]}
@end macro
@c @dvar(ARG, DEFAULT)
@@ -23,7 +23,7 @@
@c The ARG is an optional argument, defaulting to DEFAULT. To be used
@c for macro arguments in their documentation (@defmac).
@macro dvar{varname, default}
-@r{[}@var{\varname\} = @samp{\default\}@r{]}@c
+@r{[}@var{\varname\} = @samp{\default\}@r{]}
@end macro
@c Handling the indexes with Texinfo yields several different problems.
根据这个补丁文件修改即可,直接修改源代码包,下次编译就不会再提示这个错误了。
3.host-makedevs
/opt/Armcore_a20_V30_lichee/out/linux/common/buildroot/build/host-makedevs/makedevs.c:374:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
int ret = EXIT_SUCCESS;
^
cc1: all warnings being treated as errors
直接修改/opt/Armcore_a20_V30_lichee/out/linux/common/buildroot/build/host-makedevs/makedevs.c文件:
最后一行,return 0;
修改为:return ret;
我给板子上换了一个8GB的nand flash,所以去内核里面勾选nand flash的驱动后再编译
最后打包,选择sun7i_linux_evb-v10
./build.sh pack
最后打包好的文件在tools/pack/sun7i_linux_evb-v10.img
使用PhoenixSuit烧录,要提前进入fel模式,可以通过烧录fel-boot.sunxi到sd卡来进入,
wget http://www.hno.se/code/A10/OLD/fel-boot.sunxi
dd if=fel-boot.sunxi of=/dev/sdX bs=1024 seek=8
离线
但是遇到的问题是,第一次启动的log如下
HELLO! BOOT0 is starting!
boot0 version : 2.0.0▒
read dram para.
dram driver version: 1.15
dram size =256MB
0xffffffff
super_standby_flag = 0
Succeed in opening nand flash.
block from 2 to 6
deal block 2
Succeed in reading Boot1 file head.
The size of Boot1 is 0x00068000.
The file stored in 0x00000000 of block 2 is perfect.
Check is correct.
Ready to disable icache.
Succeed in loading Boot1.
Jump to Boot1.
[ 0.147] boot1 version : 2.0.0
[ 0.147] script installed early ok
[ 0.148] pmu type = 3
[ 0.253] bat vol = 1936 mv
[ 0.266] axi:ahb:apb=4:2:2
[ 0.266] set dcdc2=1400mv, clock=912M successed
[ 0.269] key
[ 0.281] no key found
[ 0.281] flash init start
[ 0.281] NB1 : enter NFB_Init
[ 0.284] NB1 : enter phy init
[ 0.287] [NAND] nand driver(A20) version: 0x0x00000002, 0x0x00000012, data: 0x426fff64 1111692733
[ 0.296] get the good blk ratio from hwscan : 870
[ 0.301] NB1 : nand phy init ok
[ 0.359] NB1 : init ok
[ 0.359] flash init finish
[ 0.361] fs init ok
[ 0.362] fattype FAT16
[ 0.364] fs mount ok
[ 0.368] nand good_block_ratio=870
[ 0.370] storage_type=0
[ 0.383] 0
[ 0.383] set pc
[ 0.383] usbdc_vol = 4000, usbdc_cur = 0
[ 0.385] usbpc_vol = 4200, usbpc_cur = 0
[ 0.389] init to usb pc
[ 0.392] set pc
[ 0.475] battery enough
[ 0.475] power_start=0x00000000
[ 0.475] power trigger
[ 0.795] power start detect
[ 0.795] power enter detect
[ 0.797] vbus insert
[ 0.798] usb start detect
[ 0.801] usb enter detect
[ 0.804] USB Device!!
[ 0.806] usb start detect
[ 0.932] base bat_cal = 0
[ 1.204] usb set dc
[ 1.204] set dc
[ 5.267] extenal power low go high startup
[ 5.267] usb start detect
[ 5.268] usb enter detect
[ 5.271] USB Device!!
[ 5.671] usb set dc
[ 5.671] set dc
[ 5.875] usb exit detect
[ 5.875] power exit detect
[ 5.875] usb exit detect
[ 5.878] enter standby
卡在这里不会动了,按一下板子上的reset键,又卡在了Starting kernel ...
HELLO! BOOT0 is starting!
boot0 version : 2.0.0▒
read dram para.
dram driver version: 1.15
dram size =256MB
0xffffffff
super_standby_flag = 0
Succeed in opening nand flash.
block from 2 to 6
deal block 2
Succeed in reading Boot1 file head.
The size of Boot1 is 0x00068000.
The file stored in 0x00000000 of block 2 is perfect.
Check is correct.
Ready to disable icache.
Succeed in loading Boot1.
Jump to Boot1.
[ 0.147] boot1 version : 2.0.0
[ 0.147] script installed early ok
[ 0.148] pmu type = 3
[ 0.252] bat vol = 0 mv
[ 0.265] axi:ahb:apb=4:2:2
[ 0.265] set dcdc2=1400mv, clock=912M successed
[ 0.267] key
[ 0.280] no key found
[ 0.280] flash init start
[ 0.280] NB1 : enter NFB_Init
[ 0.283] NB1 : enter phy init
[ 0.286] [NAND] nand driver(A20) version: 0x0x00000002, 0x0x00000012, data: 0x426fff64 1111692733
[ 0.295] get the good blk ratio from hwscan : 870
[ 0.300] NB1 : nand phy init ok
[ 0.358] NB1 : init ok
[ 0.358] flash init finish
[ 0.360] fs init ok
[ 0.361] fattype FAT16
[ 0.363] fs mount ok
[ 0.367] nand good_block_ratio=870
[ 0.369] storage_type=0
[ 0.382] 0
[ 0.382] set pc
[ 0.382] usbdc_vol = 4000, usbdc_cur = 0
[ 0.384] usbpc_vol = 4200, usbpc_cur = 0
[ 0.388] init to usb pc
[ 0.391] set pc
[ 0.473] battery enough
[ 0.474] power_start=0x00000000
[ 0.474] pre boot mode
[ 0.794] power start detect
[ 0.794] power enter detect
[ 0.795] usb start detect
[ 0.797] usb enter detect
[ 0.800] USB Device!!
[ 0.923] no battery exist
[ 0.923] power exit detect
[ 0.924] usb exit detect
[ 0.927] key value = 0
[ 0.929] recovery key high 40, low 4
[ 1.032] show pic finish
[ 1.032] load kernel start
[ 1.051] load kernel successed
[ 1.051] start address = 0x4a000000
[ 1.679] power exit detect
[ 1.679] usb exit detect
[ 1.679
U-Boot 2011.09-rc1-00000-g556d5c7-dirty (Sep 03 2020 - 03:52:29) Allwinner Technology
CPU: SUNXI Family
Board: SUN7I-EVB
DRAM: 256 MiB
NAND: NB1 : enter NFB_Init
[NAND] nand driver(A20) version: 0x2, 0x12, data: 12 1207571896
[NAND] set nand_good_block_ratio 870
NB1 : nand phy init ok
NB1 : init ok
2864 MiB
MMC: SUNXI SD/MMC: 0
In: serial
Out: serial
Err: serial
--------fastboot partitions--------
-total partitions:5-
-name- -start- -size-
bootloader : 8000 10000
env : 18000 8000
boot : 20000 8000
rootfs : 28000 100000
UDISK : 128000 470000
-----------------------------------
no misc partition is found
Card did not respond to voltage select!
MMC: block number 0x1 exceeds max(0x0)
** Can't read from device 0 **
** Unable to use mmc 0:0 for fatload **
MMC: block number 0x1 exceeds max(0x0)
** Can't read from device 0 **
** Unable to use mmc 0:1 for fatload **
Hit any key to stop autoboot: 0
[NAND]dumy read,chip 0
Starting kernel ...
离线
CPU已经非常烫了,
而且这个板子的DRAM也不是256MB,而是128MB
离线
发一下已经编译好的固件
sun7i_linux_evb-v10.zip
离线
感谢楼主分享! 因为本站钱包功能还在开发中, 麻烦加下我的微信 whycan_cn, 发个小红包感谢一下。
不用了,人人为我我为人人,我这里还有坑等着大家一起解决呢。。
离线