一.CubieTruck烧写说明
1.linux下用LiveSuit整机烧写
-
a.下载 LiveSuit
-
http://docs.cubieboard.org/tutorials/common/livesuit_installation_guide
-
b. 安装LiveSuit
-
cong@dell:/work/ct/ct-droid1/tools$ unzip ./LiveSuitV305_For_Linux64.zip
-
cong@dell:/work/ct/ct-droid1/tools/LiveSuit_For_Linux64$ chmod 777 LiveSuit.run
-
cong@dell:/work/ct/ct-droid1/tools/LiveSuit_For_Linux64$ ./LiveSuit.run
-
LiveSuit has been installed in /home/cong/Bin/LiveSuit
-
cong@dell:/work/ct/ct-droid1/tools/LiveSuit_For_Linux64$ cd /home/cong/Bin/LiveSuit
-
c. 用LiveSuit刷机
-
cong@dell:~/Bin/LiveSuit$ sudo ./LiveSuit.sh //运行LiveSuit并选择镜像
-
注意: 此处不加sudo 则会提示 "get device stage failed"
-
开发板开机时,不用插电源线,只插usb线,并按住FEL键,然后LiveSuit就会弹出对话框,选yes,然后等侍结束就可以了.
2. CubieTruck分区说明
3.烧boot.img
3.1 ct能进入android系统
在这种情况下只需用新编译出的boot.img更新nandc分区即可
-
cong@dell:/work/ct/android42$ vi out/target/product/sugar-cubietruck/root/init.rc //修改了init.rc
-
cong@dell:/work/ct/android42$ make bootimage //重新打包生成boot.img
-
cong@dell:/work/ct/android42$ adb push ./out/target/product/sugar-cubietruck/boot.img /mnt/sdcard/
-
cong@dell:/work/ct/android42$ adb shell sync
-
cong@dell:/work/ct/android42$ adb shell dd if=/mnt/sdcard/boot.img of=/dev/block/nandc
-
cong@dell:/work/ct/android42$ adb shell sync
-
cong@dell:/work/ct/android42$ adb shell reboot
3.1.1 boot.img的快速生成方法
-
cong@dell:/work/ct/android42$ out/host/linux-x86/bin/mkbootfs out/target/product/sugar-cubietruck/root | out/host/linux-x86/bin/minigzip > out/target/product/sugar-cubietruck/ramdisk.img
-
cong@dell:/work/ct/android42$ out/host/linux-x86/bin/mkbootimg --kernel out/target/product/sugar-cubietruck/kernel --ramdisk out/target/product/sugar-cubietruck/ramdisk.img --base 0x40000000 --output out/target/product/sugar-cubietruck/boot.img
3.1.2 kernel的快带生成方法
-
cong@dell:/work/ct/lichee$ ./build.sh -p sun7i_android -m kernel //编译生成kernel
-
cong@dell:/work/ct/android42$ out/host/linux-x86/bin/mkbootimg --kernel ../lichee/linux-3.3/bImage --ramdisk out/target/product/sugar-cubietruck/ramdisk.img --base 0x40000000 --output out/target/product/sugar-cubietruck/boot.img
所以在lichee目录下可以运行一个脚本就可以更新kernel,并烧写boot.img
cong@dell:/work/ct/lichee$ cat cp.sh
-
#!/bin/sh
-
echo "compile kernel and pack boot.img"
-
OUT=../android42/out/
-
./build.sh -p sun7i_android -m kernel
-
$OUT/host/linux-x86/bin/mkbootimg --kernel ./linux-3.3/bImage --ramdisk $OUT/target/product/sugar-cubietruck/ramdisk.img --base 0x40000000 --output $OUT/target/product/sugar-cubietruck/boot.img
-
-
echo "flash boot.img"
-
adb remount
-
adb push $OUT/target/product/sugar-cubietruck/boot.img /mnt/sdcard/
-
adb shell sync
-
adb shell dd if=/mnt/sdcard/boot.img of=/dev/block/nandc
-
adb shell sync
3.2 ct不能进入android系统
在这种情况下要用fastboot烧录新编出的boot.img即可
-
cong@dell:/work/ct$ sudo ./android42/out/host/linux-x86/bin/fastboot devices
-
20080411 fastboot
-
cong@dell:/work/ct$ sudo ./android42/out/host/linux-x86/bin/fastboot flash boot ./android42/out/target/product/sugar-cubietruck/boot.img
4.烧uboot
4.1 ct能进入android系统
-
/ # mkdir /mnt/temp
-
/ # mount -t vfat /dev/block/bootloader /mnt/temp ;;挂载bootloader分区,类型是vfat
-
/ # ls -l /mnt/temp/
-
-rwx------ root root 121524 1980-01-01 00:00 boot.axf
-
-rwx------ root root 106 1980-01-01 00:00 boot.ini
-
-rwx------ root root 222964 1980-01-01 00:00 drv_de.drv
-
-rwx------ root root 233932 1980-01-01 00:00 drv_hdmi.drv
-
-rwx------ root root 344813 1980-01-01 00:00 font24.sft
-
-rwx------ root root 357443 1980-01-01 00:00 font32.sft
-
drwx------ root root 1980-01-01 00:00 linux ;;linux目录
-
-rwx------ root root 512 1980-01-01 00:00 magic.bin
-
drwx------ root root 1980-01-01 00:00 os_show
-
-rwx------ root root 226576 1980-01-01 00:00 prvt.axf
-
-rwx------ root root 44640 1980-01-01 00:00 script.bin
-
-rwx------ root root 284320 1980-01-01 00:00 sprite.axf
-
/ # ls -l /mnt/temp/linux/
-
-rwx------ root root 57654 1980-01-01 00:00 linux.bmp
-
-rwx------ root root 214 1980-01-01 00:00 linux.ini
-
-rwx------ root root 310964 2000-01-04 11:51 u-boot.bin ;;就是这个u-boot.bin
发现u-boot.bin是放在了挂载后的linux目录下,所以更新uboot,就是把这个u-boot.bin替换.
4.2 ct不能进入android系统
烧写这个动作fastboot是可以的,但是不知道地址啊,等试出来再写.
二. android系统的编译
2.1 内核的编译
在编译内核时,需要把mkimage复制到PATH下
"mkimage" command not found - U-Boot images will not be built
cong@dell:/work/a31/lichee$ vi linux-3.3/scripts/mkuboot.sh
L7 #MKIMAGE=$(type -path "${CROSS_COMPILE}mkimage")
L8 MKIMAGE=/work/a31/lichee/u-boot/tools/mkimage
或者直接把mkimage 放在 /usr/local/bin目录下
-
$cd lichee/
-
$cp linux-3.3/arch/arm/configs/cubietruck_defconfig linux-3.3/arch/arm/configs/sun7ismp_android_defconfig
-
$./build.sh -p sun7i_android
2.1 编译出错
a. 编译 ./modules/mali/DX910-SW-99002-r3p2-01rel/目录时出错
-
arm-none-linux-gnueabi-gcc: directory: No such file or directory
-
arm-none-linux-gnueabi-gcc: directory
解决方法:
将mali目录中kbuild和makefile.common中的SVN_REV改为 SVN_REV := 1, (1后面有个逗号)
2.2 andorid的编译
2.2.1 工具的安装
-
cong@dell:/work/ct/ct-droid1/android42$ sudo apt-get install xsltproc
-
cong@dell:/work/ct/ct-droid1/android42$ sudo apt-get install bison
-
cong@dell:/work/ct/ct-droid1/android42$ sudo apt-get install flex
-
cong@dell:/work/ct/ct-droid1/android42$ sudo apt-get install gperf
-
-
a. gcc: error trying to exec 'cc1plus': execvp: No such file or directory
-
cong@dell:/work/ct/ct-droid1/android42$ sudo apt-get install g++
-
-
b. /usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
-
cong@dell:/work/ct/ct-droid1/android42$ sudo apt-get install gcc-multilib
-
-
c./bin/bash: xmllint: command not found
-
cong@dell:/work/ct/ct-droid1/android42$ sudo apt-get install libxml2-utils
2.2.2 编译的流程
-
$cd ../android42
-
$source build/envsetup.sh
-
$lunch 16 (select sugar_cubietruck-eng)
-
$extract-bsp
-
$make -j8
-
$pack
最后pack出的镜像文件: /work/ct/ct-droid1/lichee/tools/pack/sun7i_android_sugar-cubietruck.img
[参]http://docs.cubieboard.org/tutorials/ct1/installation/cb3_a20-compiling_android_image_for_cubietruck
三.硬件
3.1 串口的使用
接线: 白线插TX、绿线插RX、黑线插GND、红线不插
minicom的配置
-
configuration --> Serial port setup
-
Serial Device : /dev/ttyUSB0
-
Bps/Par/Bits : 115200 8N1
-
Hardware Flow Control : No
-
Software Flow Control : No
3.2 wifi不能使用
这是因为ct的wifi驱动bcmdhd没有装
//将驱动push到板子中
-
cong@dell:/work/ct/lichee$ adb push ./out/android/common/lib/modules/3.3/bcmdhd.ko /sdcard/
-
//执行insmod
-
cong@dell:/tmp$ adb shell
-
root@android: cd /sdcard/
-
root@android:/sdcard # insmod ./bcmdhd.ko
注意:修改make menuconfig之前需要,修改内核源码顶层Makefile
-
195 ARCH ?= arm
-
196 CROSS_COMPILE ?= arm-linux-gnueabi-
但是这样每次开机都需要insmod一下,简单的方法就是把驱动一起编译到内核中
-
在make menuconfig中
-
Device Drivers --->
-
[*] Network device support --->
-
[*] Wireless LAN --->
-
<*> Broadcom 4329/30 wireless cards support //由M-->*
3.3 关闭灯
blue:ph21:led1
green:ph07:led4
orange:ph20:led2
white:ph11:led3
a. 修改配置,理论上来说应该是,但没有起作用
修改sys_config.fex中[leds_para],将
-
leds_trigger_<1,2,3> = "heartbeat"
-
改为leds_trigger_<1,2,3> = "none"
将修改之后的sys_config.fex用fex2bin生成script.bin
-
script.bin的生成过程
-
cong@dell:/tmp$ /work/ct/bak/tools/sunxi/sunxi-tools/fex2bin ./sys_config.fex > script.bin
-
cong@dell:/tmp$ adb push ./script.bin /sdcard/nanda/script.bin
其中板子上的/sdcard/nanda是挂载的是nanda分区
-
板子上的nanda分区的挂载
-
root@android:/ # mkdir /sdcard/nanda
-
root@android:/ # mount -t vfat /dev/block/nanda /sdcard/nanda/
b. 只好使用方案b
取消LED的支持,配置内核取消led支持,然后编译并重烧.
-
Device Drivers --->
-
[ ] LED Support --->
注意:修改make menuconfig之前需要,修改内核源码顶层Makefile
c. 还有一个黄灯
没有找到在内核的哪个地方用,所以没有在内核中把这个黄灯关闭.
正好网上有一个应用程序是操作gpio的,只好用折中的方法把这个灯关了.
3.4 V2.0_A20编译出错
需要修改 ./lichee/linux-3.4/scripts/build_sun7i_android.sh中的build_modules函数
-
142 #export LANG=en_US.UTF-8
-
143 #unset LANGUAGE
-
144 #make -C modules/mali LICHEE_MOD_DIR=${LICHEE_MOD_DIR} LICHEE_KDIR=${LICHEE_KDIR} \
-
145 #install
阅读(1244) | 评论(0) | 转发(0) |