一、
android编译环境要求是4.4。原编译环境是
zlb@zlb-System-Product-Name:~$ cat /proc/version
Linux version 3.19.0-61-generic (buildd@lgw01-34) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) ) #69~14.04.1-Ubuntu SMP Thu Jun 9 09:09:13 UTC 2016
编译到83%左右报错:
Fault message:
/bin/bash: 行 1: 30586 已放弃 (核心已转储) ( out/host/linux-x86/bin/dex2oatd --runtime-arg -Xms64m --runtime-arg -Xmx64m --compiler-filter=speed-profile --profile-file=out/target/product/k37mv1_bsp/dex_bootjars/system/framework/boot.prof --dex-file=out/target/common/obj/JAVA_LIBRARIES/core-oj_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/legacy-test_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/voip-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LLinux version 4.4.1-040401-generic (kernel@gomeisa) (gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) ) #201601311534 SMP Sun Jan 31 20:36:43 UTC 2016
zlb@zlb-System-Product-Name:~$
IBRARIES/ims-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy.boot_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/android.hidl.base-V1.0-java_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/android.hidl.manager-V1.0-java_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-framework_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-telephony-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-telephony-base_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-ims-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-telecom-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-cta_intermediates/javalib.jar --dex-location=/system/framework/core-oj.jar --dex-location=/system/framework/core-libart.jar --dex-location=/system/framework/conscrypt.jar --dex-location=/system/framework/okhttp.jar --dex-location=/system/framework/bouncycastle.jar --dex-location=/system/framework/apache-xml.jar --dex-location=/system/framework/legacy-test.jar --dex-location=/system/framework/ext.jar --dex-location=/system/framework/framework.jar --dex-location=/system/framework/telephony-common.jar --dex-location=/system/framework/voip-common.jar --dex-location=/system/framework/ims-common.jar --dex-location=/system/framework/org.apache.http.legacy.boot.jar --dex-location=/system/framework/android.hidl.base-V1.0-java.jar --dex-location=/system/framework/android.hidl.manager-V1.0-java.jar --dex-location=/system/framework/mediatek-common.jar --dex-location=/system/framework/mediatek-framework.jar --dex-location=/system/framework/mediatek-telephony-common.jar --dex-location=/system/framework/mediatek-telephony-base.jar --dex-location=/system/framework/mediatek-ims-common.jar --dex-location=/system/framework/mediatek-telecom-common.jar --dex-location=/system/framework/mediatek-cta.jar --oat-symbols=out/target/product/k37mv1_bsp/symbols/system/framework/arm/boot.oat --oat-file=out/target/product/k37mv1_bsp/dex_bootjars/system/framework/arm/boot.oat --oat-location=/system/framework/arm/boot.oat --image=out/target/product/k37mv1_bsp/dex_bootjars/system/framework/arm/boot.art --base=0x70000000 --instruction-set=arm --instruction-set-variant=cortex-a53 --instruction-set-features=default --android-root=out/target/product/k37mv1_bsp/system --runtime-arg -Xnorelocate --compile-pic --no-generate-debug-info --generate-build-id --multi-image --no-inline-from=core-oj.jar --generate-mini-debug-info )
[ 83% 67008/80088] link out/soong/.bootstrap/soong_javac_wrapper/obj/a.out
[ 83% 67009/80088] link out/soong/.bootstrap/soong_zip/obj/a.out
[ 83% 67010/80088] //frameworks/compile/slang:llvm-rs-cc link llvm-rs-cc [linux]
ninja: build stopped: subcommand failed.
13:02:19 ninja failed with: exit status 1
二、
1:查看当前安装的内核
dpkg -l|grep linux-image
2:查看可以更新的内核版本:看了也没用
sudo apt-cache search linux-image
3:安装新内核/先要下载安装包
sudo apt-get install linux-image-3.13.0-74-generic linux-image-extra-3.13.0-74-generic
4:卸载不要的内核
sudo apt-get purge linux-image-3.13.0-xx-generic linux-image-extra-3.13.0-xx-generic
5:更新 grub引导
sudo update-grub
重启系统查看。
升级:
http://www.linuxidc.com/Linux/2016-02/128289.htm
安装包:
http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.4.1-wily/
选择: linux-image-4.4.1-040401-generic_4.4.1-040401.201601311534_amd64.deb
下载完成之后请使用如下命令安装 Kernel 4.4.1:
sudo dpkg -i *.deb
安装完成之后使用如下命令更新 Grub boot loader:
sudo update-grub
升级完之后请重启系统。
Ubuntu卸载Linux Kernel 4.4.1
如果你不想用 Linux Kernel 4.4.1 了,可以随时使用如下命令删除:
sudo apt-get remove linux-headers-4.4* linux-image-4.4*
sudo update-gru
三、切换内核
查看已安装的linux内核
grep menuentry /boot/grub/grub.cfg
切换:
sudo vim /boot/grub/grub.cfg
3.19.0-61:为系统使用的内核版本
252 linux /boot/vmlinuz-3.19.0-61-generic root=UUID=7e665914-8452-499c-86e9-60ae7b5b7e89 ro recovery nomodeset
253 echo '载入初始化内存盘...'
254 initrd /boot/initrd.img-3.19.0-61-generic
更新内核:
sudo update-grub
重启
四、开机后没有串口log打印信息问题
kernel-3.18/kernel/printk/printk.c
void mt_disable_uart(void)
{
if (mt_need_uart_console == 0)
- printk_disable_uart = 1;
+ printk_disable_uart = 0; // 改为0
}
void mt_enable_uart(void)
{
五、内存大小
device/mediateksample/k80hd_bsp_fwv_512m/ProjectConfig.mk
CUSTOM_CONFIG_MAX_DRAM_SIZE = 0x40000000 // 1G
vendor/mediatek/proprietary/bootable/bootloader/preloader/custom/k80hd_bsp_fwv_512m/k80hd_bsp_fwv_512m.mk
CUSTOM_CONFIG_MAX_DRAM_SIZE=0x40000000
六、git log 生成补丁 及打补丁
http://blog.csdn.net/liuhaomatou/article/details/54410361
七、kernel-4.4 dws打开工具位置
./vendor/mediatek/proprietary/scripts/dct/DrvGen.exe
八、查看线程和cpu
cat /proc/cpuinfo | grep physical | uniq -c
1 address sizes : 46 bits physical, 48 bits virtual
1 physical id : 1
1 address sizes : 46 bits physical, 48 bits virtual
1 physical id : 1
1 address sizes : 46 bits physical, 48 bits virtual
1 physical id : 1
1 address sizes : 46 bits physical, 48 bits virtual
1 physical id : 1
1 address sizes : 46 bits physical, 48 bits virtual
1 physical id : 1
1 address sizes : 46 bits physical, 48 bits virtual
一个1 physical id : 1,表示有一颗1核的cpu
查看CPU 信息lscpu
zlb@zlb-System-Product-Name:~$ lscpu
Architecture: x86_64
CPU 运行模式: 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
每个核的线程数:1
每个座的核数: 4
Socket(s): 1
NUMA 节点: 1
厂商 ID: GenuineIntel
CPU 系列: 6
型号: 42
步进: 7
CPU MHz: 1678.601
BogoMIPS: 5799.79
虚拟化: VT-x
L1d 缓存: 32K
L1i 缓存: 32K
L2 缓存: 256K
L3 缓存: 6144K
NUMA node0 CPU(s): 0-3
zlb@zlb-System-Product-Name:~$
还可以查看全面一些的cpu信息
cat /proc/cpuinfo
九、lcm的驱动没问题,在另一个平台项目中ok,line等都ok,闪屏,
分辨率不对。
分辨率,一个是
BOOT_LOGO:=fwvga //控制显示图片的,有对应的分辨率要求
LCM_HEIGHT = 960 // 控制整屏
LCM_WIDTH = 480
十、ubuntu wine安装的软件出现乱码现象,是wine中没有字体Fonts
解决:从windos中的Fonts拷贝到wine的Fonts目录下
十一、驱动直接控制GPIO
int mt_set_gpio_dir(unsigned long pin, unsigned long dir);
int mt_set_gpio_out(unsigned long pin, unsigned long output);
int mt_set_gpio_mode(unsigned long pin, unsigned long mode);
mt_set_gpio_mode(3,0); // 选择gpio的模式,可以根据dws选择模式
mt_set_gpio_dir(3,1); // 选择gpio的输入还是输出模式
mt_set_gpio_out(3,0); // 选择gpio的高低点平
十二、ubuntu 查看那串口打印信息
dmesg | grep ttyS* //查看是接入那个串口
sudo chmod 666 /dev/ttyUSB0 // 给对应串加权限
cutecom //打开窗口
十三、flash 下载问题
1、读id问题,flash下载工具中下载flash log可以找到对应的下载的emmc id,下载串口log中都可以找到emmc id
flash下载工具:BROM_DLL_V5.log (注意:这边的id和xls表格中的id是反的)
DEBUG: DA_Download_Init(): Get the emmc id (0x45030188,0x30314250,0xD70E3930,0x8BD8602F). (da_download_base.cpp:118)
下载串口log:
dump CID: 88010345, dump CID: 50423130, dump CID: 30390ED7, dump CID: 2F60348B, 88010345, 50423130, 30390ED7, 2F60348B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, EMMC ID 45030188 30314250 D70E3930 8BD8602F
十四、文件权限
444 r--r--r--
600 drw-------
644 drw-r--r--
666 drw-rw-rw-
700 drwx------
744 drwxr--r--
755 drwxr-xr-x
777 drwxrwxrwx
十五、ubuntu 自带的截图
gnome-screenshot -a :可以选择区域截图
gnome-screenshot : 全屏截图
十六、充电相关
充不了电问题:硬件是否有快充,软件是否配置了快充ic。如果还是充不了电,需要看一下其他需要用到usb的驱动如otg。最好是能重log中看出问题。
本次现象是硬件加了快充,软件未配置(开机充不了电,关机状态可以充电);配置了快充ic(lk和关机可以充电进入kernel后不充电),问题最终找到是OTG的dws里的gpio配置有问题,otg的配置正确后,充电问题解决。
十七、从服务器更新代码下来的方式一:
git fetch origin xxx
git rebase origin/xxx
十八、//查找调用所在函数的函数,可以往上几层
dump_stack();
十九、重启问题-温度过高。处理修改温度策略,或硬件方面降温
log:
[ 28.716140] Backtrace:
[ 28.717285] <1>-(1)[331:thermal_manager][
[ 28.720064] <1>-(1)[331:thermal_manager][
[ 28.722521] r10:00000000 r9:00000000 r8:db3289dc r7:c0fd3690
[ 28.724814] <1>-(1)[331:thermal_manager][
[ 28.727186] r7:00000000 r6:db328800 r5:c0f26348 r4:db1a7900
.....
[ 36.931238] Rebooting in 5 seconds..
二十、中断触发方式
request_irq(accdet_irq, accdet_eint_func, IRQF_TRIGGER_NONE, "accdet-eint", NULL); // 注册中断(中断处理,触发方式)
irq_set_irq_type(accdet_irq, IRQ_TYPE_LEVEL_HIGH); // 修改中断触发方式
中断的触发方式设置:
#define IRQF_TRIGGER_NONE 0x00000000 //无触发中断(采用默认的或之前设置的触发方式)
#define IRQF_TRIGGER_RISING 0x00000001 //指定中断触发类型:上升沿有效
#define IRQF_TRIGGER_FALLING 0x00000002 //中断触发类型:下降沿有效
#define IRQF_TRIGGER_HIGH 0x00000004 //指定中断触发类型:高电平有效
#define IRQF_TRIGGER_LOW 0x00000008 //指定中断触发类型:低电平有效
#define IRQF_TRIGGER_MASK (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | \
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)
#define IRQF_TRIGGER_PROBE 0x00000010 //触发式检测中断
中断的属性设置:
#define IRQF_DISABLED 0x00000020 //中断禁止
#define IRQF_SAMPLE_RANDOM 0x00000040 //供系统产生随机数使用
#define IRQF_SHARED 0x00000080 //在设备之间可共享
#define IRQF_PROBE_SHARED 0x00000100 //探测共享中断
#define IRQF_TIMER 0x00000200 //专用于时钟中断
#define IRQF_PERCPU 0x00000400 //每CPU周期执行中断
#define IRQF_NOBALANCING 0x00000800 //复位中断
#define IRQF_IRQPOLL 0x00001000 //共享中断中根据注册时间判断
#define IRQF_ONESHOT 0x00002000 //硬件中断处理完后触发
二十二、烧录报错 userdata报空间不足,修改userdata的大小
device/mediatek/build/build/tools/ptgen/MT6739/partition_table_MT6739.xls