Freescale iMx51开发

logcat -b radio &
 
#创建视频需要的节点
mknod /dev/null c 1 3
/bin/busybox mknod /dev/fb0 c 29 0
/bin/busybox mknod /dev/fb1 c 29 1
/bin/busybox mknod /dev/fb2 c 29 2
mknod /dev/video0 c 81 0
mknod /dev/video16 c 81 1
 
./mxc_v4l2_overlay.out -iw 800 -ih 480 -ow 800 -oh 480 -it 20 -il 140 -r 0 -fr 30 -fg -t 10
/unit_tests/mxc_v4l2_overlay.out -iw 800 -ih 480 -ow 720 -oh 480 -it 0 -il 0 -r 0 -fr 30 -fg -t 1200
 
rm /dev/tty
ln -s /dev/ttymxc0 /dev/tty
/data/t232
 
#初始化MCU
hffaa8001010a
hffaa8001010a
hffaa8101010a
 
#切换到DVD模式
hffaa8d01010a
hffaa8e00010a
 
hffaa8d05010a
 
#切换到ARM模式
hffaa8d0a010a
hffaa8e00010a
 
#调节功放音量
hffaa8b08180a
 
#蓝牙电源
echo 1 > /sys/class/rfkill/rfkill0/state
 
#调试摄像头
adb push \\192.168.40.248\work\zh\camera\rgb_4p\rgb_4p system/bin
chmod 777 /system/bin/rgb_4p
rgb_4p 320 240 16 0 0
 

\\192.168.40.248\work\zh\myandroid_R9\bootable\bootloader\uboot-imx-nand\u-boot.bin
\\192.168.40.248\work\zh\myandroid_R9\kernel_imx\arch\arm\boot\uImage
\\192.168.40.248\work\zh\myandroid_R9\out\target\product\imx51_bbg\android_root.img
\\192.168.40.248\work\zh\myandroid_R9\out\target\product\imx51_bbg\uramdisk.img
 
\\192.168.0.97\all\home\hui\myandroid_R9\trunk\kernel_imx\arch\arm\boot\uImage
\\192.168.0.97\all\home\hui\myandroid_R9\trunk\out\target\product\imx51_bbg\android_root.img
 
#用ATK工具烧写文件到nand
00000000 uboot
00300000 uImage
00600000 uramdisk
00800000 android_recovery //注意,有分2k page和4k page,打包方法如下介绍
01C00000 android_root //注意,有分2k page和4k page,打包方法如下介绍
 
#删除触摸屏校准文件,开机重新校准
rm /data/system/calibration
 
打包成uboot可识别的内核:
mkimage -A arm -O linux -T kernel -C none -a 0x90008000 -e 0x90008000 -n "Android Linux Kernel" -d arch/arm/boot/Image arch/arm/boot/uImage_nozip
 
在Android下打包uboot可识别的uramdisk:
out/host/linux-x86/bin/mkbootfs out/target/product/imx51_bbg/root | out/host/linux-x86/bin/minigzip > out/target/product/imx51_bbg/ramdisk.img
bootable/bootloader/uboot-imx-nand/tools/mkimage  -A arm -O linux -T ramdisk -C none -a 0x90308000 -n "Android Root Filesystem" -d out/target/product/imx51_bbg/ramdisk.img out/target/product/imx51_bbg/uramdisk.img
 
在Android下打包UBI文件系统android_root.img,android_recovery.img:
#2K page:
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/system -o out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img -m 2048 -e 129024 -c 2048 -x none
out/host/linux-x86/bin/acp -fpt out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img out/target/product/imx51_bbg/system.img
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/data -o out/target/product/imx51_bbg/userdata.img -m 2048 -e 129024 -c 2048 -x none
out/host/linux-x86/bin/ubinize -o out/target/product/imx51_bbg/android_root.img -m 2048 -p 128KiB -s 512 -O 512 out/target/product/imx51_bbg/ubinize.ini
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/recovery/root -o out/target/product/imx51_bbg/recovery.img -m 2048 -e 129024 -c 2048 -x none
out/host/linux-x86/bin/ubinize -o out/target/product/imx51_bbg/android_recovery.img -m 2048 -p 128KiB -s 512 -O 512 out/target/product/imx51_bbg/ubinize_reco.ini
 
#4K page:
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/system -o out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img -m 4096 -e 516096 -c 4096 -x none
out/host/linux-x86/bin/acp -fpt out/target/product/imx51_bbg/obj/PACKAGING/systemimage_unopt_intermediates/system.img out/target/product/imx51_bbg/system.img
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/data -o out/target/product/imx51_bbg/userdata.img -m 4096 -e 516096 -c 4096 -x none
out/host/linux-x86/bin/ubinize -o out/target/product/imx51_bbg/android_root.img -m 4096 -p 512KiB out/target/product/imx51_bbg/ubinize.ini
out/host/linux-x86/bin/mkfs.ubifs -d out/target/product/imx51_bbg/recovery/root -o out/target/product/imx51_bbg/recovery.img -m 4096 -e 516096 -c 40 -x none
out/host/linux-x86/bin/ubinize -o out/target/product/imx51_bbg/android_recovery.img -m 4096 -p 512KiB out/target/product/imx51_bbg/ubinize_reco.ini
 
编译内核要编译成uImage:
make uImage -j2 ARCH=arm CROSS_COMPILE=arm-linux-
 
生成uboot能识别的uramdisk:
~/work/android_r9/myandroid_R9/bootable/bootloader/uboot-imx/tools/mkimage  -A arm -O linux -T ramdisk -C none -a 0x70308000 -n "Android Root Filesystem" -d ./ramdisk.img ./uramdisk.img
 
\\192.168.40.248\work\android_r9\myandroid_R9\kernel_imx\arch\arm\boot\uImage
 
kernel启动命令行的一些设置:
noinitrd console=ttymxc0,115200 root=/dev/mtdblock2 rw rootfstype=jffs2 ip=off
root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs/rootfs ip=192.168.1.100 console=ttymxc0,115200 fbcon=rotate:1
root=/dev/mtdblock2 rw rootfstype=ubifs noinitrd mtdparts=nand_mtd:0x300000@0x300000(uImage),0x1c00000@0x10000000(rootfs) rw console=ttymxc0,115200 fbcon=rotate:1
 
U-Boot环境变量设置:
setenv nand_read_kernel 'nand read ${loadaddr} 0x300000 0x290000'
setenv nand_read_rd 'nand read ${rd_loadaddr} 0x600000 0x4B000'
setenv bootcmd_nand 'run bootargs_base bootargs_android bootargs_nand; run nand_read_kernel; run nand_read_rd; bootm ${loadaddr} ${rd_loadaddr}'
setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'
setenv bootargs_nand 'setenv bootargs ${bootargs} ubi.mtd=3'
setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0'
setenv loadaddr 0x90800000
setenv rd_loadaddr 0x90B00000
 
#busybox启动
setenv bootargs_android 'setenv bootargs ${bootargs} init=/linuxrc androidboot.console=ttymxc0'
 
#如果停留在Touchscreen Calibration界面,意思即校准触摸屏.如果不想校正,可去掉wvga calibration,跳过此界面
setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 console=tty0'
saveenv
#串口3(ttymxc2)用来做调试控制台
setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc2 console=tty0 wvga calibration'
setenv bootargs_base 'setenv bootargs console=ttymxc2,115200'
saveenv
 
NSF启动环境变量设置:
setenv bootargs_android 'setenv bootargs ${bootargs} root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs/rootfs ip=192.168.1.100 console=ttymxc0,115200 console=tty0 wvga calibration fbcon=rotate:1'
setenv bootargs_android 'setenv bootargs ${bootargs} root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs/rootfs ip=192.168.1.100 console=ttymxc0,115200 fbcon=rotate:1 video=mxcdi0fb:RGB565,800x480M-16@60 di0_primary wvga calibration'
setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB24,800x480M@60 video=mxcdi1fb:RGB24,800x480M@60 di0_primary calibration'
 
setenv bootargs_android 'setenv bootargs ${bootargs} init=/init androidboot.console=ttymxc0 video=mxcdi0fb:RGB24,800x480M@60 video=mxcdi1fb:YUV444,720P60 tve calibration'
 
mxcdi1fb:TV-PAL

svn import --no-ignore uboot-imx-nand svn://192.168.0.97/iMx51_Android/Android2.2/trunk/bootable/bootloader/uboot-imx-nand -m "iMx51 android r9 nand uboot for ZhongHong" --username hui --password
svn import --no-ignore kernel_imx svn://192.168.0.97/iMx51_Android/Android2.2/trunk/ -m "iMx51 android r9 Linux-2.6.31 kernel for ZhongHong" --username hui --password
svn import --no-ignore kernel_imx svn://192.168.0.97/iMx51_Android/imx-android-r9.2/trunk  -m "iMx51 android r9.2 Linux-2.6.31 kernel for ZhongHong" --username hui --password
svn import --no-ignore kernel_imx svn://192.168.0.97/iMx51_Android/imx-android-r10/trunk  -m "iMx51 android2.3 (BSP r10) Linux-2.6.35 kernel for ZhongHong" --username hui --password
svn import --no-ignore luvcview_port https://192.168.0.121:8443/svn/BSP/Android/iMX51/Base/trunk/luvcview_port -m "quick camera preview project. add by hui" --username liuyh --password ***
 

objdump -x libmedia_jni.so | grep NEEDED
 
logcat Vold:* *:S&
logcat SerialPort:* *:S&
logcat bluedroid:* *:S&
logcat glgpsd:* *:S&
 
chmod u+r /system/lib/*
ls -l /system/lib/*

SMDKC110:
 
dnw 40000000
 
U-Boot
onenand erase 0 80000;onenand  write 40000000 0 80000
 
zImage
dnw 40000000;onenand erase 600000 500000;onenand write 40000000 600000 500000;re
 
ramdisk
onenand erase b00000 300000;onenand write 40000000 b00000 300000
 
system.img
onenand erase e00000 7800000;onenand write.yaffs2 40000000 e00000 5A00000
 
userdata.img
onenand erase b800000 14800000;onenand write.yaffs 40000000 b800000 1080
 

onenand erase 0 10000000
 
onenand write 57e00000 0 40000
 
onenand erase 0 40000;onenand write c0008000 0 40000
 
当你uboot跑起来之后再用仿真器或者USB下载到c0008000 再用如下命令烧写.
 
SMDK6410:
Clean
onenand erase 04600000 02800000
 
U-Boot
onenand erase 0 40000;onenand write c0008000 0 40000
       测试:onenand erase 80000 80000;onenand write c0008000 80000 80000
 
zImage
dnw;onenand erase 600000 300000;onenand write c0008000 600000 300000;re
 
ramdisk
onenand erase 900000 100000;onenand write c0008000 900000 100000
 
system.img
onenand erase a00000 4300000;onenand write.yaffs2 c0008000 a00000  377F040
 
userdata.img
####onenand erase A000000 5E00000;onenand write.yaffs2 c0008000 A000000 2559C0
onenand erase A000000 5E00000;onenand write.yaffs2 c0008000 A000000      2559C0
 
onenand erase 4d00000 5300000
 

SMDKC100:
U-Boot
nand erase 0 40000;nand  write c0000000 0 40000
onenand erase 0 40000;onenand  write c0008000 0 40000
 
zImage
dnw;nand erase 600000 300000;nand write c0000000 600000 300000
dnw;onenand erase 600000 300000;onenand write c0008000 600000 300000;re
 
ramdisk
nand erase 900000 100000;nand write c0000000 900000 100000
onenand erase 900000 100000;onenand write c0008000 900000 100000
 
system.img
nand erase a00000 4300000;nand write.yaffs2 c0000000 a00000 352f980
onenand erase a00000 4300000;onenand write.yaffs2 c0008000 a00000 ?
 
userdata.img
nand erase 9000000 7000000;nand write.yaffs c0000000 9000000 840
onenand erase 9000000 7000000;onenand write.yaffs c0008000 9000000 840

root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs ip=192.168.1.100 console=ttySAC2,115200 no_console_suspend=1
root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs ip=192.168.1.100 console=ttySAC2,115200
console=ttySAC2,115200,mem=256M
nfs cdc
root=/dev/nfs init=/init nfsroot=192.168.1.10://nfsroot/rootfs ip=192.168.1.100 console=ttySAC2,115200 fbcon=rotate:1
 

root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs ip=192.168.1.100 console=tty0 console=ttySAC2,115200 fbcon=rotate:3
root=/dev/nfs init=/linuxrc nfsroot=192.168.1.10:/nfs ip=192.168.1.100 console=tty0 console=ttySAC2,115200 fbcon=rotate:3
 
#邱俊涛svn linux-2.6.27-android
init=/init console=ttySAC2,115200 root=/dev/nfs nfsroot=192.168.1.110:/home/win_share/root ip=192.168.1.100:192.168.1.110:192.168.1.110:255.255.255.0:ubuntu9.04:usb0:off
init=/init console=ttySAC2,115200 root=/dev/nfs nfsroot=192.168.1.10:/nfs ip=192.168.1.100:192.168.1.1:192.168.1.1:255.255.255.0:ubuntu9.04:usb0:off
 
#linux2.6.24 onenand 配置
root=/dev/mtdblock2 rw rootfstype=jffs2 init=/linuxrc console=ttySAC2,115200
root=/dev/mtdblock3 rw rootfstype=jffs2 init=/linuxrc console=ttySAC2,115200
init=/linuxrc console=ttySAC2,115200
 
sudo smbmount //192.168.16.99/开发部/ /mnt/ -o iocharset=utf8,codepage=cp936,username=liuyihui,password=lyh2009
sudo smbmount //192.168.16.248/all/ ./mnt -o iocharset=utf8,codepage=cp936,username=lyh,password=23456
sudo smbmount //172.16.10.248/all/ ./mnt -o iocharset=utf8,codepage=cp936,username=hui,password=linux
sudo smbmount //192.168.0.97/Share/ /mnt -o iocharset=utf8,codepage=cp936,username=svn,password=
 
sudo smbmount //192.168.16.247/samsung  /mnt/ -o username=hui%yihui8
sudo smbmount //192.168.16.247/android-1.5  /mnt/ -o username=hui%yihui8
 

将luther_ramdisk.img打包成u-boot下载格式
mkimage -A arm -O linux -T ramdisk -C none -a 0x50800000 -n "ramdisk" -d luther_ramdisk.img luther_ramdisk.img-uboot.img
 
#在当前目录及其子目录下查找*.txt文件,并将查找到的文件信息显示出来。注意:{}和\之间有空格;不要少了最后的分号
find ./ -name "*.mk" -exec grep "apns" {} -nH \;
find . -type d -iname ".svn" -exec rm -rf {} \;
 
改变控制台debug消息显示级别,可以打印printk(DEBUG ...)信息
echo > /proc/sys/kernel/printk "8"
 
把system.img挂载区重新挂到可写
mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
 
echo "at">/dev/ttyspi0
 
./memdmp E0200E00 182
 
md e0200f00

./configure --with-linux=/home/hui/work/zh/myandroid_R9/kernel_imx --host=arm-linux
 
#有的编译器没有arm-linux-,编译某些代码需要arm-linux-,因此需要链接
ln -s arm-eabi-addr2line arm-linux-addr2line
ln -s arm-eabi-ar arm-linux-ar
ln -s arm-eabi-as arm-linux-as
ln -s arm-eabi-c++ arm-linux-c++
ln -s arm-eabi-c++filt arm-linux-c++filt
ln -s arm-eabi-cpp arm-linux-cpp
ln -s arm-eabi-g++ arm-linux-g++
ln -s arm-eabi-gcc arm-linux-gcc
ln -s arm-eabi-gccbug arm-linux-gccbug
ln -s arm-eabi-gcov arm-linux-gcov
ln -s arm-eabi-gdb arm-linux-gdb
ln -s arm-eabi-gdbtui arm-linux-gdbtui
ln -s arm-eabi-gprof arm-linux-gprof
ln -s arm-eabi-ld arm-linux-ld
ln -s arm-eabi-nm arm-linux-nm
ln -s arm-eabi-objcopy arm-linux-objcopy
ln -s arm-eabi-objdump arm-linux-objdump
ln -s arm-eabi-ranlib arm-linux-ranlib
ln -s arm-eabi-readelf arm-linux-readelf
ln -s arm-eabi-run arm-linux-run
ln -s arm-eabi-size arm-linux-size
ln -s arm-eabi-strings arm-linux-strings
ln -s arm-eabi-strip arm-linux-strip

export TARGET_TYPE=%MISSING%
export cross_stack_direction=-1
export cross_signum=64
export cross_linuxthreads=0
 
#启动停止svn服务
sudo svnserve -d  -r /home/root/
killall svnserve
 

不同3G模块移植
【1】
打开:out\target\product\imx51_bbg\root\init.rc
根据不同模块修改:
#ZTE C100, add by hui
service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyUSB0 -u /dev/ttyUSB2
#WCDMA U6300V, add by hui
#service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyUSB1 -u /dev/ttyUSB2
【2】
打开:out\target\product\imx51_bbg\system\etc\init.gprs-pppd
根据不同模块修改:
#below is config for U6300 WCDMA modem
/system/bin/pppd  /dev/ttyUSB2 9600 mru 1280 mtu 1280 nodetach debug dump defaultroute usepeerdns novj novjccomp noipdefault ipcp-accept-local ipcp-accept-remote connect-delay 5000 linkname ppp0
#below is config for ZTE CDMA modem
#/system/bin/pppd  /dev/ttyUSB0 115200 mru 1280 mtu 1280 nodetach debug dump defaultroute usepeerdns novj novjccomp noipdefault ipcp-accept-local ipcp-accept-remote connect-delay 5000 linkname ppp0 name "card" password "card"

转自:http://www.61ic.com/MCU/Freescale/MCU/201104/33805.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值