mtk平台调试FAQ

1.指示灯功能打开
工厂模式添加:VANZO_FEATURE_FACTORYMODE_STATUSLIGHT=yes
手机菜单中添加:VANZO_REMOVE_INDICATION_LEDS=yes

2.arm/arm64区分
怎么看6.0平台是用的arm 还是arm64?
在 alpsdevice/vanzo/$project/ProjectConfig.mk下macro:MTK_BUILD_VERNO = alps-mp-m0.mp1-V2.84_vz6737m.35.i.m0_P23看是不是35还是65;

3.重力传感器方向反了问题:
file:$project.dts
modify .direction值,有0-7共八个值

4.添加hotknot功能
电容屏通信,MTK_HOTKNOT_SUPPORT=yes

5.手机屏幕下滑出现虚拟按键
添加VANZO_INNER_CUSTOM_OVERRIDE_PROP_ADDED= 0

6.贴脸灭屏功能宏
CUSTOM_KERNEL_ALSPS= touch_ps;

7.如何读取及设置PMIC registers
1)进入工程模式,读取和设置
拨号界面 ----------输入*#*#3646633#*#* 进入工程模式 power ------ pmu ------ pmu register或者hardware testing ----- power ------ pmu ------ pmu register,所有读写都是16进制
2)程序运行时,如何通过ADB cmd获取及设置pmic registers?
adb shell cd /sys/devices/platform/mt-pmic

8.时钟周期和时钟频率的换算问题
F代表频率,单位是Hz; T代表周期,单位是s;频率等于一除以周期, 写成公式就是: F (Hz) = 1 / T (s) ,所以倒过来就有周期等于一除以频率,写成公式就是:T = 1 / F
执行时间/时钟周期 = 周期数
执行时间*时钟频率 = 周期数
时钟周期 = 1/时钟频率
举例说明:
dws中的Keypress_Perio是消抖周期,基准时钟是32K。如果是1024个周期,则消抖时间是32ms;即:消抖时间 =(1/32000)*1024 s =0.032s =32ms

9.I2C传输数据速率设定方式:
在进行i2c 传输前设置,i2c_client->timing = timing_number;
备注:
1.当设备不支持快速mode timing_number <= 100;
2.当设备支持快速mode timing_number <= 400;

10.怎样添加一个自定义的LED灯
1. 修改如下两个文件:
m path:alps/kernel-3.18/drivers/misc/mediatek/leds/$platform
file:leds_sw.h
enum mt65xx_led_type {
MT65XX_LED_TYPE_RED = 0,
MT65XX_LED_TYPE_GREEN,
MT65XX_LED_TYPE_BLUE,
MT65XX_LED_TYPE_JOGBALL,
MT65XX_LED_TYPE_KEYBOARD,
MT65XX_LED_TYPE_BUTTON, //add a new type
MT65XX_LED_TYPE_LCD,
MT65XX_LED_TYPE_TOTAL,
};

file:leds.c
char *leds_name[MT65XX_LED_TYPE_TOTAL] = {
"red",
"green",
"blue",
"jogball-backlight",
"keyboard-backlight",
"button-backlight",
"lcd-backlight",
};

11.如何在c/c++代码里引用自定义ProjectConfig.mk宏开关
AUTO_ADD_GLOBAL_DEFINE_BY_NAME
AUTO_ADD_GLOBAL_DEFINE_BY_VALUE
AUTO_ADD_GLOBAL_DEFINE_BY_NAME_VALUE

12.省晶振与不省晶振设定
path:alps/vanzo/$board/WMT_SOC.cfg
co_clock_flag=0 不省晶振
co_clock_flag=1 省晶振

13.黑板白板卡死alps/vendor_mediatek_proprietary_hardware_mtkcam_legacy_platform_mt6580_core_camshot_SingleShot_SingleShot.cpp 类queryJpegImgBufInfo()中将if (0 != mRawMem.size)改为if (0 != mRawMem.size && mRawMem.size>=queryImgBufSize(eImgFmt_JPEG, u4Width, u4Height))

14.SIM卡反了
modem/driver/storage/sim/src/icc_switchControl_al.c,把kal_bool sim_physicalSlotChanged 改为kal_bool sim_physicalSlotChanged=KAL_TRUE

15.耳机有噪音解决方法
常开mic bias:打开项目主板对应的dts配置文件,作如下修改:
headset-mode-setting = <0x500 0x200 1 0x1F0 0x800 0x800 0x20>; 改为 headset-mode-setting = <0x500 0x500 1 0x1F0 0x800 0x800 0x20>;

16.免提模式通话关闭主麦,默认打开副麦通话
修改alps/vendor/mediatek/proprietary/custom/$project/hal/audioflinger/audio/Audio_Customization_Common.h,开启如下宏
#define USE_REFMIC_IN_LOUDSPK 1

17.删除开机向导
1)adb remount
2)adb shell
3)cd system/priv-app
4)rm SetupWizard

18.判断呼吸灯是否存在
1)adb shell
2)查看/sys/devices/virtual/breathlightdrv/breathlight是否存在

19.省晶振与不省晶振设定
path:alps/vanzo/$board/WMT_SOC.cfg
co_clock_flag=0 不省晶振
co_clock_flag=1 省晶振
阅读更多
换一批

没有更多推荐了,返回首页