|
本帖最后由 conway 于 2015-6-9 14:52 编辑
平台:MYD-SAMA5D3X
版本:android4.4.2
1、获取android源码:
[mw_shl_code=applescript,true]$ mkdir android4sam_v4.4
$ cd android4sam_v4.4
$ repo init -u git://github.com/Android4SAM/platform_sammanifest.git -b android4sam_v4.4
$ repo sync[/mw_shl_code]
2、配置android:
[mw_shl_code=applescript,true]$ . build/envsetup.sh
$ lunch sama5d3-eng
$ make[/mw_shl_code]
3、生成android镜像:
[mw_shl_code=applescript,true]$ mkubi_image -b sama5d3[/mw_shl_code]
如果一切顺利,当前目录下会生成system_ubifs-SAMA5D3-ANDROID-4.4.2_r2.img 和userdata_ubifs-SAMA5D3-ANDROID-4.4.2_r2.img
如果当中出现任何错误,请到make_android_ubifs.log查看详细信息。
4、烧写到开发板:
将上面生成的img文件拷贝到烧写镜像Android-image其中的一个目录下,修改烧写控制文件flash_all.tcl:
……
……
## Files to load
set bootstrapFile "boot.bin"
set ubootFile "u-boot.bin"
set kernelFile "uImage"
append dtbFile $variant_name $board_suffix ".dtb"
set rootfsFile "rootfs.ubi"
set ubootEnvFile "ubootEnv.bin"
set systemfsFile "system_ubifs-SAMA5D3-ANDROID-4.4.2_r2.img"
set datafsFile "userdata_ubifs-SAMA5D3-ANDROID-4.4.2_r2.img"
if {! [file exists $dtbFile]} {
puts "-E- === Unknown $variant_name + board $board_suffix combination ==="
exit
}
## NandFlash Mapping
set bootStrapAddr 0x00000000
set ubootAddr 0x00040000
set ubootEnvAddr 0x000c0000
set dtbAddr 0x00180000
set kernelAddr 0x00200000
set systemfsAddr 0x01000000
set datafsAddr 0x0A000000
……
……
puts "-I- === Enable trimffs ==="
NANDFLASH::NandSetTrimffs 1
puts "-I- === Load the android system file system ==="
send_file {NandFlash} "$systemfsFile" $systemfsAddr 0
puts "-I- === Load the android data file system ==="
send_file {NandFlash} "$datafsFile" $datafsAddr 0
puts "-I- === DONE. ==="
5、启动android:
烧写完后要启动android还需要修改uboot环境变量。
[mw_shl_code=applescript,true]U-Boot> setenv filesys_env 'ubi.mtd=1 ubi.mtd=2 root=ubi0:system rootfstype=ubifs init=/init androidboot.hardware=sama5-ek androidboot.console=ttyS0'
U-Boot> setenv nand_args 'run bootargs_defaults
U-Boot> setenv bootargs ${bootargs} no_console_suspend mtdparts=atmel_nand:8M(bootstrap/uboot/kernel)ro,144M(system),80M(userdata) ${filesys_env}'
U-Boot> saveenv
U-Boot> boot
[/mw_shl_code]
|
|