前段时间再开发一个展讯平台的android智能机项目,系统测试发现手机正常关机后第二天早上来长按POWER键无法开机,后来验证电池电压为2.1v, 此电压无法正常开机(关机前电池说与充满状态),但是还有另外一台机器也无法开机,测量电压也为3.9V,此机器重新拔掉电池后就能正常开机。以上故障机器手机中都没有这只自动开机和关机闹钟相关功能。
以上面的显现来判断,大致怀疑是手机在关机后又自动重启,但是在重启过程中没有重启成功,并以死机状态一直保持耗并最终电池电压降到无法维持正常开机电压。
基于以上的现象和大致分析,初步怀疑系统在boot过程中出现异常而导致死机。于是在平台的bootloader部分(展讯平台使用u-boot)打开uart log,进行复现问题并通过UART抓取log分析。
在不断的尝试后终于复现故障,并且在相连的稳压源上看到复现故障的时候手机端出现140MA大电流并保持,从此显现判定为异常机器死机。以下是通过uart log分析结果
1)正常关机后再起来大电流导致按电源键无法再开机问题原因分析:
正常关机后手机收到了ANA_RTC_INT_RSTS,启动uboot后做了alarm_flag_check动作,在alarm_flag_check()函数中做了如下动作(文件位置u-boot/property/alarm_mode.c u-boot/property/cmd_cboot.c):
a)u-boot启动代码中会check种种开机原因,其中需要check是否是alarm开机方式
-
int do_cboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
-
{
-
uint32_t key_mode = 0;
-
uint32_t key_code = 0;
-
volatile int i;
-
-
if(argc > 2)
-
goto usage;
-
-
#ifdef CONFIG_AUTOBOOT
-
normal_mode();
-
#endif
-
-
boot_pwr_check();
-
-
#ifdef CONFIG_SC8800G
-
CHG_ShutDown();
-
if(charger_connected()){
-
mdelay(10);
-
CHG_TurnOn();
-
}else{
-
if(is_bat_low()){
-
printf("shut down again for low battery\n");
-
power_down_devices();
-
while(1)
-
;
-
}
-
}
-
#else
-
CHG_Init();
-
#ifndef CONFIG_MACH_CORI
-
if(is_bat_low()){
-
printf("shut down again for low battery\n");
-
mdelay(10000);
-
power_down_devices();
-
while(1)
-
;
-
}
-
#endif
-
#endif
-
-
boot_pwr_check();
-
board_keypad_init();
-
#if defined (CONFIG_SP8825C1)
-
hw_reboot_init();
-
#endif
-
boot_pwr_check();
-
-
int recovery_init(void);
-
int ret =0;
-
ret = recovery_init();
-
if(ret == 1){
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
recovery_mode_without_update();
-
}else if(ret == 2){
-
try_update_modem(); //update img from mmc
-
normal_mode();
-
}
-
-
unsigned check_reboot_mode(void);
-
unsigned rst_mode= check_reboot_mode();
-
if(rst_mode == RECOVERY_MODE){
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
recovery_mode();
-
}
-
else if(rst_mode == FASTBOOT_MODE){
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
fastboot_mode();
-
}else if(rst_mode == NORMAL_MODE){
-
normal_mode();
-
}else if(rst_mode == WATCHDOG_REBOOT){
-
watchdog_mode();
-
#if defined (CONFIG_SP8825C1)
-
}else if(rst_mode == HWREBOOT_MODE){
-
hwreboot_mode();
-
#endif
-
}else if(rst_mode == UNKNOW_REBOOT_MODE){
-
unknow_reboot_mode();
-
}else if(rst_mode == PANIC_REBOOT){
-
panic_reboot_mode();
-
}else if(rst_mode == ALARM_MODE){
-
int flag =alarm_flag_check();
-
if(flag == 1)
-
alarm_mode();
-
else if(flag == 2)
-
normal_mode();
-
}else if(rst_mode == SLEEP_MODE){
-
sleep_mode();
-
}else if(rst_mode == SPECIAL_MODE){
-
special_mode();
-
}
-
#ifdef CONFIG_SC8810
-
// normal_mode();
-
#endif
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
-
if(charger_connected()){
-
DBG("%s: charger connected\n", __FUNCTION__);
-
-
#if defined (CONFIG_SP8825C1)
-
calibration_detect(1);
-
#endif
-
-
charge_mode();
-
}
-
//find the power up trigger
-
else if(boot_pwr_check() >= get_pwr_key_cnt()){
-
DBG("%s: power button press\n", __FUNCTION__);
-
DBG("boot_pwr_check=%d,get_pwr_key_cnt=%d\n",boot_pwr_check(),get_pwr_key_cnt());
-
//go on to check other keys
-
mdelay(50);
-
for(i=0; i<10;i++){
-
key_code = board_key_scan();
-
if(key_code != KEY_RESERVED)
-
break;
-
}
-
DBG("key_code %d\n", key_code);
-
key_mode = check_key_boot(key_code);
-
-
switch(key_mode){
-
case BOOT_FASTBOOT:
-
fastboot_mode();
-
break;
-
case BOOT_RECOVERY:
-
recovery_mode();
-
break;
-
case BOOT_CALIBRATE:
-
engtest_mode();
-
return 0; //back to normal boot
-
break;
-
case BOOT_DLOADER:
-
dloader_mode();
-
break;
-
default:
-
break;
-
}
-
}
-
else if(alarm_triggered() && alarm_flag_check()){
-
DBG("%s: alarm triggered\n", __FUNCTION__);
-
int flag =alarm_flag_check(); //此处判断是否是闹钟
-
if(flag == 1)
-
alarm_mode();
-
else if(flag == 2)
-
normal_mode();
-
}else{
-
#if BOOT_NATIVE_LINUX_MODEM
-
*(volatile u32*)CALIBRATION_FLAG = 0xca;
-
#endif
-
-
#ifndef CONFIG_SP8825C1
-
calibration_detect(0);
-
#endif
-
-
//if calibrate success, it will here
-
DBG("%s: power done again\n", __FUNCTION__);
-
power_down_devices();
-
while(1)
-
;
-
}
-
-
if(argc == 1){
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
normal_mode();
-
return 1;
-
}
-
-
if(argc == 2){
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
-
if(strcmp(argv[1],"normal") == 0){
-
normal_mode();
-
return 1;
-
}
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
-
if(strcmp(argv[1],"recovery") == 0){
-
recovery_mode();
-
return 1;
-
}
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
-
if(strcmp(argv[1],"fastboot") == 0){
-
fastboot_mode();
-
return 1;
-
}
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
-
if(strcmp(argv[1],"dloader") == 0){
-
dloader_mode();
-
return 1;
-
}
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
-
if(strcmp(argv[1],"charge") == 0){
-
charge_mode();
-
return 1;
-
}
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
-
if(strcmp(argv[1],"caliberation") == 0){
-
calibration_detect(1);
-
return 1;
-
}
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
}
-
DBG("func: %s line: %d\n", __func__, __LINE__);
-
-
usage:
-
cmd_usage(cmdtp);
-
return 1;
-
}
-
int alarm_flag_check(void)
-
{
-
-
int ret = -1,ret1 = -1;
-
long time = 0;
-
long time1 = 0;
-
unsigned long time_rtc= 0;
-
unsigned long time_rtc1= 0;
-
unsigned long now_rtc = 0;
-
int time_lead = 0;
-
-
block_dev_desc_t *p_block_dev = NULL;
-
-
int factoryalarmret1 = 1, factoryalarmret2 = 1,factorypowerret1 = 1, factorypowerret2 = 1;
-
unsigned long factoryalarmcnt1, factoryalarmcnt2,factorypowercnt1, factorypowercnt2;
-
unsigned char factoryalarmarray1[PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE];
-
unsigned char factoryalarmarray2[PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE];
-
unsigned char factorypowerarray1[PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE];
-
unsigned char factorypowerarray2[PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE];
-
-
p_block_dev = get_dev("mmc", 1);
-
if(NULL == p_block_dev)
-
ret = 0;
-
if (ret == -1) {
-
memset((unsigned char *)factoryalarmarray1, 0xff, PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE);
-
factoryalarmret1 = prodinfo_read_partition(p_block_dev, PARTITION_PROD_INFO1, 8 * 1024, (char *)factoryalarmarray1, PRODUCTINFO_SIZE + 8);
-
memset((unsigned char *)factoryalarmarray2, 0xff, PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE);
-
factoryalarmret2 = prodinfo_read_partition(p_block_dev, PARTITION_PROD_INFO2, 8 * 1024, (char *)factoryalarmarray2, PRODUCTINFO_SIZE + 8);
-
-
memset((unsigned char *)factorypowerarray1, 0xff, PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE);
-
factorypowerret1 = prodinfo_read_partition(p_block_dev, PARTITION_PROD_INFO1, 12 * 1024, (char *)factorypowerarray1, PRODUCTINFO_SIZE + 8);
-
memset((unsigned char *)factorypowerarray2, 0xff, PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE);
-
factorypowerret2 = prodinfo_read_partition(p_block_dev, PARTITION_PROD_INFO2, 12 * 1024, (char *)factorypowerarray2, PRODUCTINFO_SIZE + 8);
-
}
-
-
if ((factoryalarmret1 == 0) && (factoryalarmret2 == 0)) {
-
factoryalarmcnt1 = char2u32(factoryalarmarray1, 3 * 1024 + 4);
-
factoryalarmcnt2 = char2u32(factoryalarmarray2, 3 * 1024 + 4);
-
if (factoryalarmcnt2 >= factoryalarmcnt1)
-
ret = move2timebuf(factoryalarmarray2, (unsigned char *)time_buf);
-
else
-
ret = move2timebuf(factoryalarmarray1, (unsigned char *)time_buf);
-
} else if ((factoryalarmret1 == 0) && (factoryalarmret2 == 1)) {
-
ret = move2timebuf(factoryalarmarray1, (unsigned char *)time_buf);
-
} else if ((factoryalarmret1 == 1) && (factoryalarmret2 == 0)) {
-
ret = move2timebuf(factoryalarmarray2, (unsigned char *)time_buf);
-
} else if ((factoryalarmret1 == 1) && (factoryalarmret2 == 1)) {
-
printf("alarm_flag are all empty or wrong\n");
-
ret = -1;
-
}
-
if(ret > 0){
-
printf("file: alarm_flag exist\n");
-
printf("time get %s", time_buf);
-
time = simple_strtol(time_buf, NULL, 10);
-
time_rtc = time;
-
}
-
if ((factorypowerret1 == 0) && (factorypowerret2 == 0)) {
-
factorypowercnt1 = char2u32(factorypowerarray1, 3 * 1024 + 4);
-
factorypowercnt2 = char2u32(factorypowerarray2, 3 * 1024 + 4);
-
if (factorypowercnt2 >= factorypowercnt1)
-
ret1 = move2timebuf(factorypowerarray2, (unsigned char *)time_buf1);
-
else
-
ret1 = move2timebuf(factorypowerarray1, (unsigned char *)time_buf1);
-
} else if ((factorypowerret1 == 0) && (factorypowerret2 == 1)) {
-
ret1 = move2timebuf(factorypowerarray1, (unsigned char *)time_buf1);
-
} else if ((factorypowerret1 == 1) && (factorypowerret2 == 0)) {
-
ret1 = move2timebuf(factorypowerarray2, (unsigned char *)time_buf1);
-
} else if ((factorypowerret1 == 1) && (factorypowerret2 == 1)) {
-
printf("poweron_timeinmillis are all empty or wrong\n");
-
ret1 = -1;
-
}
-
-
if(ret1 > 0){
-
printf("file: poweron_timeinmillis exist\n");
-
printf("time get %s", time_buf1);
-
time1 = simple_strtol(time_buf1, NULL, 10);
-
time_rtc1 = time1;
-
}
-
sprd_rtc_init();
-
now_rtc = sprd_rtc_get_sec();
-
printf("now rtc %lu\n", now_rtc);
-
time_lead = get_alarm_lead_set();
-
time = time - now_rtc;
-
time1 = time1 - now_rtc;
-
if((time < time_lead +180) && (time > time_lead -10))
-
{
-
if((time1 < time_lead +180) && (time1 > time_lead -10)&& (time -time1>50))
-
ret = 2;
-
else
-
ret = 1;
-
}
-
else if((time1 < time_lead +180) && (time1 > time_lead -10))
-
ret =2;
-
else{
-
if (ret == -1&& ret1== -1) {
-
printf("file: all not found\n");
-
}else if(ret1== -1){
-
uboot_rtc_set_alarm_sec(time_rtc);
-
}else if(ret== -1){
-
uboot_rtc_set_alarm_sec(time_rtc1);
-
}else{
-
if(time_rtc1 > time_rtc){
-
uboot_rtc_set_alarm_sec(time_rtc);
-
}else{
-
uboot_rtc_set_alarm_sec(time_rtc1);
-
}
-
}
-
ret = 0;
-
}
-
-
return ret;
-
}
如上面的alarm_flag_check()函数中有如下代码
if (ret == -1) {
memset((unsigned char *)factoryalarmarray1, 0xff, PRODUCTINFO_SIZE +
EMMC_SECTOR_SIZE);
factoryalarmret1 = prodinfo_read_partition(p_block_dev, PARTITION_PROD_INFO1, 8
* 1024, (char *)factoryalarmarray1, PRODUCTINFO_SIZE + 8);
memset((unsigned char *)factoryalarmarray2, 0xff, PRODUCTINFO_SIZE +
EMMC_SECTOR_SIZE);
factoryalarmret2 = prodinfo_read_partition(p_block_dev, PARTITION_PROD_INFO2, 8
* 1024, (char *)factoryalarmarray2, PRODUCTINFO_SIZE + 8);
}
b)
然后通过move2timebuf(factoryalarmarray2, (unsigned char *)time_buf);将factoryalarmarray2中的数据放入到time_buf中,由于factoryalarmarray2中的数据全部是oxFF,直接导致time_buf[200]中200个字节的数据全部为0Xff, 这些数据可以从附件今天复现问题抓取Log中打印time_buf看出来。
-
U-Boot 2010.12-svn (Oct 19 2013 - 14:03:13)
-
-
-
-
DRAM: 256 MiB
-
-
NAND: 00 00 00 00 00
-
-
No NAND device
-
-
0 MiB
-
-
Using default environment
-
-
-
-
[sc8810fb_probe]
-
-
[lcdc_mcu_init] LCDC_CTRL: 0x13
-
-
[lcdc_calc_lcm_timing] ahb_clk: 0xfa
-
-
[lcdc_calc_lcm_timing] ahb_clk: 0xfa
-
-
[lcdc_lcm_configure] LCM_CTRL: 0x11600
-
-
[lcdc_update_lcm_timing] LCM_PARAMETER1: 0x4ff0398
-
-
[lcdc_calc_lcm_timing] ahb_clk: 0xfa
-
-
[lcdc_calc_lcm_timing] ahb_clk: 0xfa
-
-
[lcdc_lcm_configure] LCM_CTRL: 0x11600
-
-
[lcdc_update_lcm_timing] LCM_PARAMETER1: 0x4ff0398
-
-
[set_lcdc_layers] LCDC_OSD1_CTRL: 0x12d
-
-
[set_lcdc_layers] LCDC_OSD1_ALPHA: 0xff
-
-
[set_lcdc_layers] LCDC_OSD1_SIZE_XY: 0x1e00140
-
-
[set_lcdc_layers] LCDC_OSD1_DISP_XY: 0x0
-
-
[set_lcdc_layers] LCDC_OSD1_PITCH: 0x140
-
-
[set_lcdsize] LCDC_DISP_SIZE: 0x1e00140
-
-
[set_lcmrect] LCDC_LCM_START: 0x0
-
-
[set_lcmrect] LCDC_LCM_SIZE: 0x1e00140
-
-
In: serial
-
-
Out: serial
-
-
Err: serial
-
-
sci_efuse_calibration data:0
-
-
is_bat_low adc_value:843,comp_vbat:3500
-
-
mingwei uboot vol:3814,adc4200:928,adc3600:796
-
-
GEN0 1d382360
-
-
func: do_cboot line: 101
-
-
Device nand0 not
-
-
mtdparts init error 1
-
-
ANA_RTC_INT_RSTS is 0x820000b4
-
-
value of it 0x11
-
-
alarm_flag_check factoryalarmret1 = 0,factoryalarmret2=0alarm_flag file is exist
-
-
time_buf[0]=255
-
-
time_buf[1]=255
-
-
time_buf[2]=255
-
-
time_buf[3]=255
-
-
time_buf[4]=255
-
-
time_buf[5]=255
-
-
time_buf[6]=255
-
-
time_buf[7]=255
-
-
time_buf[8]=255
-
-
time_buf[9]=255
-
-
time_buf[10]=255
-
-
time_buf[11]=255
-
-
time_buf[12]=255
-
-
time_buf[13]=255
-
-
time_buf[14]=255
-
-
time_buf[15]=255
-
-
time_buf[16]=255
-
-
time_buf[17]=255
-
-
time_buf[18]=255
-
-
time_buf[19]=255
-
-
time_buf[20]=255
-
-
time_buf[21]=255
-
-
time_buf[22]=255
-
-
time_buf[23]=255
-
-
time_buf[24]=255
-
-
time_buf[25]=255
-
-
time_buf[26]=255
-
-
time_buf[27]=255
-
-
time_buf[28]=255
-
-
time_buf[29]=255
-
-
time_buf[30]=255
-
-
time_buf[31]=255
-
-
time_buf[32]=255
-
-
time_buf[33]=255
-
-
time_buf[34]=255
-
-
time_buf[35]=255
-
-
time_buf[36]=255
-
-
time_buf[37]=255
-
-
time_buf[38]=255
-
-
time_buf[39]=255
-
-
time_buf[40]=255
-
-
time_buf[41]=255
-
-
time_buf[42]=255
-
-
time_buf[43]=255
-
-
time_buf[44]=255
-
-
time_buf[45]=255
-
-
time_buf[46]=255
-
-
time_buf[47]=255
-
-
time_buf[48]=255
-
-
time_buf[49]=255
-
-
time_buf[50]=255
-
-
time_buf[51]=255
-
-
time_buf[52]=255
-
-
time_buf[53]=255
-
-
time_buf[54]=255
-
-
time_buf[55]=255
-
-
time_buf[56]=255
-
-
time_buf[57]=255
-
-
time_buf[58]=255
-
-
time_buf[59]=255
-
-
time_buf[60]=255
-
-
time_buf[61]=255
-
-
time_buf[62]=255
-
-
time_buf[63]=255
-
-
time_buf[64]=255
-
-
time_buf[65]=255
-
-
time_buf[66]=255
-
-
time_buf[67]=255
-
-
time_buf[68]=255
-
-
time_buf[69]=255
-
-
time_buf[70]=255
-
-
time_buf[71]=255
-
-
time_buf[72]=255
-
-
time_buf[73]=255
-
-
time_buf[74]=255
-
-
time_buf[75]=255
-
-
time_buf[76]=255
-
-
time_buf[77]=255
-
-
time_buf[78]=255
-
-
time_buf[79]=255
-
-
time_buf[80]=255
-
-
time_buf[81]=255
-
-
time_buf[82]=255
-
-
time_buf[83]=255
-
-
time_buf[84]=255
-
-
time_buf[85]=255
-
-
time_buf[86]=255
-
-
time_buf[87]=255
-
-
time_buf[88]=255
-
-
time_buf[89]=255
-
-
time_buf[90]=255
-
-
time_buf[91]=255
-
-
time_buf[92]=255
-
-
time_buf[93]=255
-
-
time_buf[94]=255
-
-
time_buf[95]=255
-
-
time_buf[96]=255
-
-
time_buf[97]=255
-
-
time_buf[98]=255
-
-
time_buf[99]=255
-
-
time_buf[100]=255
-
-
time_buf[101]=255
-
-
time_buf[102]=255
-
-
time_buf[103]=255
-
-
time_buf[104]=255
-
-
time_buf[105]=255
-
-
time_buf[106]=255
-
-
time_buf[107]=255
-
-
time_buf[108]=255
-
-
time_buf[109]=255
-
-
time_buf[110]=255
-
-
time_buf[111]=255
-
-
time_buf[112]=255
-
-
time_buf[113]=255
-
-
time_buf[114]=255
-
-
time_buf[115]=255
-
-
time_buf[116]=255
-
-
time_buf[117]=255
-
-
time_buf[118]=255
-
-
time_buf[119]=255
-
-
time_buf[120]=255
-
-
time_buf[121]=255
-
-
time_buf[122]=255
-
-
time_buf[123]=255
-
-
time_buf[124]=255
-
-
time_buf[125]=255
-
-
time_buf[126]=255
-
-
time_buf[127]=255
-
-
time_buf[128]=255
-
-
time_buf[129]=255
-
-
time_buf[130]=255
-
-
time_buf[131]=255
-
-
time_buf[132]=255
-
-
time_buf[133]=255
-
-
time_buf[134]=255
-
-
time_buf[135]=255
-
-
time_buf[136]=255
-
-
time_buf[137]=255
-
-
time_buf[138]=255
-
-
time_buf[139]=255
-
-
time_buf[140]=255
-
-
time_buf[141]=255
-
-
time_buf[142]=255
-
-
time_buf[143]=255
-
-
time_buf[144]=255
-
-
time_buf[145]=255
-
-
time_buf[146]=255
-
-
time_buf[147]=255
-
-
time_buf[148]=255
-
-
time_buf[149]=255
-
-
time_buf[150]=255
-
-
time_buf[151]=255
-
-
time_buf[152]=255
-
-
time_buf[153]=255
-
-
time_buf[154]=255
-
-
time_buf[155]=255
-
-
time_buf[156]=255
-
-
time_buf[157]=255
-
-
time_buf[158]=255
-
-
time_buf[159]=255
-
-
time_buf[160]=255
-
-
time_buf[161]=255
-
-
time_buf[162]=255
-
-
time_buf[163]=255
-
-
time_buf[164]=255
-
-
time_buf[165]=255
-
-
time_buf[166]=255
-
-
time_buf[167]=255
-
-
time_buf[168]=255
-
-
time_buf[169]=255
-
-
time_buf[170]=255
-
-
time_buf[171]=255
-
-
time_buf[172]=255
-
-
time_buf[173]=255
-
-
time_buf[174]=255
-
-
time_buf[175]=255
-
-
time_buf[176]=255
-
-
time_buf[177]=255
-
-
time_buf[178]=255
-
-
time_buf[179]=255
-
-
time_buf[180]=255
-
-
time_buf[181]=255
-
-
time_buf[182]=255
-
-
time_buf[183]=255
-
-
time_buf[184]=255
-
-
time_buf[185]=255
-
-
time_buf[186]=255
-
-
time_buf[187]=255
-
-
time_buf[188]=255
-
-
time_buf[189]=255
-
-
time_buf[190]=255
-
-
time_buf[191]=255
-
-
time_buf[192]=255
-
-
time_buf[193]=255
-
-
time_buf[194]=255
-
-
time_buf[195]=255
-
-
time_buf[196]=255
-
-
time_buf[197]=255
-
-
time_buf[198]=255
-
-
time_buf[199]=255
-
-
alarm_flag_check,sprd_rtc_init() enter
-
-
sprd_rtc_get_sec insprd_rtc_get_sec,sec=20 get_sec() oksprd_rtc_get_sec,min=39 get_min() oksprd_rtc_get_sec,hour=6 get_hour() okspr_rtc_get_sec,day=292 get_day() ok sprd_rtc_get_sec insprd_rtc_get_sec,sec=20 get_sec() oksprd_rtc_get_sec,min=39 get_min() oksprd_rtc_get_sec,hour=6 get_hour() okspr_rtc_get_sec,day=292 get_day() ok now rtc 25252760
-
-
usb calibrate detecting
-
-
usb calibrate configuration timeout
-
-
do_cboot: power done again
c)
然后
if (ret == -1) {
printf("alarm_flag file is not found\n");
ret = 0;
} else {
printf("alarm_flag file is exist\n");
printf("time get %s",
time_buf); //通过该函数将time_buf中的数据打印出来,问题就是出在这里导致手机一直处于140MA的电流不下去,其实是printf出现问题,很明显printf函数的time_buf[200]全部都是0xFF,没有作为字符串的结束符的“\0”。
解决问题途径:
在printf("time get %s", time_buf);语句之前,直接将time_buf最后加入"\0"结束符。
直接将printf("time
get %s", time_buf);语句取消,或者直接将time_buf[199]=0;加在printf("time get %s", time_buf);前面就可以了 或者将前面a)中代码给factoryalarmarray1/
factoryalarmarray2赋值为0而不是0XFF
2)正常关机后偶现电流再起来,但是过一段时间后电流又重新回到0,再按电源键也能开机。但是为什么关机电流降到0后,有时候还会再有起来又降下去的情况?也就是为什么会上来ANA_RTC_INT_RSTS,仍然没有查出原因,不解决该问题,仍然会留有后患。从do_cboot()函数中打印的log可以产出出现ANA_RTC_INT_RSTS时开机原因rst_mode并不是ALARM_MODE,所以可以判定不是因为设置了alarm关机后再由于alarm时间到而触发开机。
3)问题2)复现概率比较高的操作条件:正常开机,设置一个闹钟,闹钟时间到响铃后关闭闹钟(或者选择延时再响,等到再响铃的时候后关闭闹钟),然后正常关机,等待关机电流到0后再起来到120ma左右然后又降到0的现象
遗留隐患问题:
2)中提到的问题,正常关机电流到0后,为什么过一段时间还会有电流起来然后又降到0的动作,也就是查明ANA_RTC_INT_RSTS(value = 0x11)上来的原因,如何触发的,这还需要深入研究
阅读(3472) | 评论(0) | 转发(0) |