Chinaunix首页 | 论坛 | 博客
  • 博客访问: 133533
  • 博文数量: 12
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 337
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-12 17:41
个人简介

活到老,学到老

文章分类
我的朋友

分类: Android平台

2014-03-17 15:03:04

前段时间再开发一个展讯平台的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开机方式

点击(此处)折叠或打开

  1. int do_cboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
  2. {
  3.     uint32_t key_mode = 0;
  4.     uint32_t key_code = 0;
  5.     volatile int i;

  6.     if(argc > 2)
  7.       goto usage;

  8. #ifdef CONFIG_AUTOBOOT
  9.     normal_mode();
  10. #endif

  11.     boot_pwr_check();
  12.     
  13. #ifdef CONFIG_SC8800G
  14.     CHG_ShutDown();
  15.     if(charger_connected()){
  16.         mdelay(10);
  17.         CHG_TurnOn();
  18.     }else{
  19.         if(is_bat_low()){
  20.             printf("shut down again for low battery\n");
  21.             power_down_devices();
  22.             while(1)
  23.               ;
  24.         }
  25.     }
  26. #else
  27.     CHG_Init();
  28. #ifndef CONFIG_MACH_CORI
  29.     if(is_bat_low()){
  30.                 printf("shut down again for low battery\n");
  31.                 mdelay(10000);
  32.                 power_down_devices();
  33.                 while(1)
  34.                  ;
  35.     }
  36. #endif
  37. #endif    

  38.     boot_pwr_check();
  39.     board_keypad_init();
  40. #if defined (CONFIG_SP8825C1)
  41.     hw_reboot_init();
  42. #endif
  43.     boot_pwr_check();

  44.     int recovery_init(void);
  45.     int ret =0;
  46.     ret = recovery_init();
  47.     if(ret == 1){
  48.         DBG("func: %s line: %d\n", __func__, __LINE__);
  49.         recovery_mode_without_update();
  50.     }else if(ret == 2){
  51.      try_update_modem(); //update img from mmc
  52.      normal_mode();
  53.     }

  54.     unsigned check_reboot_mode(void);
  55.     unsigned rst_mode= check_reboot_mode();
  56.     if(rst_mode == RECOVERY_MODE){
  57.         DBG("func: %s line: %d\n", __func__, __LINE__);
  58.         recovery_mode();
  59.     }
  60.     else if(rst_mode == FASTBOOT_MODE){
  61.         DBG("func: %s line: %d\n", __func__, __LINE__);
  62.         fastboot_mode();
  63.     }else if(rst_mode == NORMAL_MODE){
  64.         normal_mode();
  65.     }else if(rst_mode == WATCHDOG_REBOOT){
  66.         watchdog_mode();
  67. #if defined (CONFIG_SP8825C1)
  68.     }else if(rst_mode == HWREBOOT_MODE){
  69.         hwreboot_mode();
  70. #endif
  71.     }else if(rst_mode == UNKNOW_REBOOT_MODE){
  72.         unknow_reboot_mode();
  73.     }else if(rst_mode == PANIC_REBOOT){
  74.         panic_reboot_mode();
  75.     }else if(rst_mode == ALARM_MODE){
  76.               int flag =alarm_flag_check();
  77.               if(flag == 1)
  78.             alarm_mode();
  79.               else if(flag == 2)
  80.             normal_mode();
  81.     }else if(rst_mode == SLEEP_MODE){
  82.         sleep_mode();
  83.     }else if(rst_mode == SPECIAL_MODE){
  84.         special_mode();
  85.     }
  86. #ifdef CONFIG_SC8810
  87. // normal_mode();
  88. #endif
  89.     DBG("func: %s line: %d\n", __func__, __LINE__);

  90.    if(charger_connected()){
  91.         DBG("%s: charger connected\n", __FUNCTION__);

  92. #if defined (CONFIG_SP8825C1)
  93.     calibration_detect(1);
  94. #endif

  95.         charge_mode();
  96.     }
  97.     //find the power up trigger
  98.     else if(boot_pwr_check() >= get_pwr_key_cnt()){
  99.         DBG("%s: power button press\n", __FUNCTION__);
  100.     DBG("boot_pwr_check=%d,get_pwr_key_cnt=%d\n",boot_pwr_check(),get_pwr_key_cnt());
  101.         //go on to check other keys
  102.         mdelay(50);
  103.         for(i=0; i<10;i++){
  104.             key_code = board_key_scan();
  105.             if(key_code != KEY_RESERVED)
  106.               break;
  107.         }
  108.         DBG("key_code %d\n", key_code);
  109.         key_mode = check_key_boot(key_code);

  110.         switch(key_mode){
  111.             case BOOT_FASTBOOT:
  112.                 fastboot_mode();
  113.                 break;
  114.             case BOOT_RECOVERY:
  115.                 recovery_mode();
  116.                 break;
  117.             case BOOT_CALIBRATE:
  118.                 engtest_mode();
  119.                 return 0; //back to normal boot
  120.                 break;
  121.             case BOOT_DLOADER:
  122.                 dloader_mode();
  123.                 break;
  124.             default:
  125.                 break;
  126.         }
  127.     }
  128.     else if(alarm_triggered() && alarm_flag_check()){
  129.         DBG("%s: alarm triggered\n", __FUNCTION__);
  130.         int flag =alarm_flag_check(); //此处判断是否是闹钟
  131.         if(flag == 1)
  132.         alarm_mode();
  133.         else if(flag == 2)
  134.               normal_mode();
  135.     }else{
  136. #if BOOT_NATIVE_LINUX_MODEM
  137.         *(volatile u32*)CALIBRATION_FLAG = 0xca;
  138. #endif

  139. #ifndef CONFIG_SP8825C1
  140.         calibration_detect(0);
  141. #endif

  142.         //if calibrate success, it will here
  143.         DBG("%s: power done again\n", __FUNCTION__);
  144.         power_down_devices();
  145.         while(1)
  146.           ;
  147.     }

  148.     if(argc == 1){
  149.     DBG("func: %s line: %d\n", __func__, __LINE__);
  150.         normal_mode();
  151.         return 1;
  152.     }

  153.     if(argc == 2){
  154.         DBG("func: %s line: %d\n", __func__, __LINE__);

  155.         if(strcmp(argv[1],"normal") == 0){
  156.             normal_mode();
  157.             return 1;
  158.         }
  159.         DBG("func: %s line: %d\n", __func__, __LINE__);

  160.         if(strcmp(argv[1],"recovery") == 0){
  161.             recovery_mode();
  162.             return 1;
  163.         }
  164.         DBG("func: %s line: %d\n", __func__, __LINE__);

  165.         if(strcmp(argv[1],"fastboot") == 0){
  166.             fastboot_mode();
  167.             return 1;
  168.         }
  169.         DBG("func: %s line: %d\n", __func__, __LINE__);

  170.         if(strcmp(argv[1],"dloader") == 0){
  171.             dloader_mode();
  172.             return 1;
  173.         }
  174.         DBG("func: %s line: %d\n", __func__, __LINE__);

  175.         if(strcmp(argv[1],"charge") == 0){
  176.             charge_mode();
  177.             return 1;
  178.         }
  179.         DBG("func: %s line: %d\n", __func__, __LINE__);

  180.         if(strcmp(argv[1],"caliberation") == 0){
  181.             calibration_detect(1);
  182.             return 1;
  183.         }
  184.         DBG("func: %s line: %d\n", __func__, __LINE__);
  185.     }
  186.     DBG("func: %s line: %d\n", __func__, __LINE__);

  187. usage:
  188.     cmd_usage(cmdtp);
  189.     return 1;
  190. }

点击(此处)折叠或打开

  1. int alarm_flag_check(void)
  2. {

  3.     int ret = -1,ret1 = -1;
  4.     long time = 0;
  5.     long time1 = 0;
  6.     unsigned long time_rtc= 0;
  7.     unsigned long time_rtc1= 0;
  8.     unsigned long now_rtc = 0;
  9.     int time_lead = 0;

  10.     block_dev_desc_t *p_block_dev = NULL;

  11.     int factoryalarmret1 = 1, factoryalarmret2 = 1,factorypowerret1 = 1, factorypowerret2 = 1;
  12.     unsigned long factoryalarmcnt1, factoryalarmcnt2,factorypowercnt1, factorypowercnt2;
  13.     unsigned char factoryalarmarray1[PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE];
  14.     unsigned char factoryalarmarray2[PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE];
  15.     unsigned char factorypowerarray1[PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE];
  16.     unsigned char factorypowerarray2[PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE];
  17.     
  18.     p_block_dev = get_dev("mmc", 1);
  19.     if(NULL == p_block_dev)
  20.         ret = 0;
  21.     if (ret == -1) {
  22.         memset((unsigned char *)factoryalarmarray1, 0xff, PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE);
  23.         factoryalarmret1 = prodinfo_read_partition(p_block_dev, PARTITION_PROD_INFO1, 8 * 1024, (char *)factoryalarmarray1, PRODUCTINFO_SIZE + 8);
  24.         memset((unsigned char *)factoryalarmarray2, 0xff, PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE);
  25.         factoryalarmret2 = prodinfo_read_partition(p_block_dev, PARTITION_PROD_INFO2, 8 * 1024, (char *)factoryalarmarray2, PRODUCTINFO_SIZE + 8);

  26.         memset((unsigned char *)factorypowerarray1, 0xff, PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE);
  27.         factorypowerret1 = prodinfo_read_partition(p_block_dev, PARTITION_PROD_INFO1, 12 * 1024, (char *)factorypowerarray1, PRODUCTINFO_SIZE + 8);
  28.         memset((unsigned char *)factorypowerarray2, 0xff, PRODUCTINFO_SIZE + EMMC_SECTOR_SIZE);
  29.         factorypowerret2 = prodinfo_read_partition(p_block_dev, PARTITION_PROD_INFO2, 12 * 1024, (char *)factorypowerarray2, PRODUCTINFO_SIZE + 8);
  30.     }

  31.     if ((factoryalarmret1 == 0) && (factoryalarmret2 == 0)) {
  32.         factoryalarmcnt1 = char2u32(factoryalarmarray1, 3 * 1024 + 4);
  33.         factoryalarmcnt2 = char2u32(factoryalarmarray2, 3 * 1024 + 4);
  34.         if (factoryalarmcnt2 >= factoryalarmcnt1)
  35.             ret = move2timebuf(factoryalarmarray2, (unsigned char *)time_buf);
  36.         else
  37.             ret = move2timebuf(factoryalarmarray1, (unsigned char *)time_buf);
  38.     } else if ((factoryalarmret1 == 0) && (factoryalarmret2 == 1)) {
  39.         ret = move2timebuf(factoryalarmarray1, (unsigned char *)time_buf);
  40.     } else if ((factoryalarmret1 == 1) && (factoryalarmret2 == 0)) {
  41.         ret = move2timebuf(factoryalarmarray2, (unsigned char *)time_buf);
  42.     } else if ((factoryalarmret1 == 1) && (factoryalarmret2 == 1)) {
  43.         printf("alarm_flag are all empty or wrong\n");
  44.         ret = -1;
  45.     }
  46.     if(ret > 0){
  47.         printf("file: alarm_flag exist\n");    
  48.         printf("time get %s", time_buf);
  49.         time = simple_strtol(time_buf, NULL, 10);
  50.         time_rtc = time;
  51.     }
  52.     if ((factorypowerret1 == 0) && (factorypowerret2 == 0)) {
  53.         factorypowercnt1 = char2u32(factorypowerarray1, 3 * 1024 + 4);
  54.         factorypowercnt2 = char2u32(factorypowerarray2, 3 * 1024 + 4);
  55.         if (factorypowercnt2 >= factorypowercnt1)
  56.             ret1 = move2timebuf(factorypowerarray2, (unsigned char *)time_buf1);
  57.         else
  58.             ret1 = move2timebuf(factorypowerarray1, (unsigned char *)time_buf1);
  59.     } else if ((factorypowerret1 == 0) && (factorypowerret2 == 1)) {
  60.         ret1 = move2timebuf(factorypowerarray1, (unsigned char *)time_buf1);
  61.     } else if ((factorypowerret1 == 1) && (factorypowerret2 == 0)) {
  62.         ret1 = move2timebuf(factorypowerarray2, (unsigned char *)time_buf1);
  63.     } else if ((factorypowerret1 == 1) && (factorypowerret2 == 1)) {
  64.         printf("poweron_timeinmillis are all empty or wrong\n");
  65.         ret1 = -1;
  66.     }

  67.     if(ret1 > 0){
  68.         printf("file: poweron_timeinmillis exist\n");     
  69.         printf("time get %s", time_buf1);
  70.         time1 = simple_strtol(time_buf1, NULL, 10);
  71.         time_rtc1 = time1;
  72.     }
  73.     sprd_rtc_init();
  74.     now_rtc = sprd_rtc_get_sec();
  75.     printf("now rtc %lu\n", now_rtc);
  76.     time_lead = get_alarm_lead_set();
  77.     time = time - now_rtc;
  78.     time1 = time1 - now_rtc;
  79.     if((time < time_lead +180) && (time > time_lead -10))
  80.     {
  81.         if((time1 < time_lead +180) && (time1 > time_lead -10)&& (time -time1>50))
  82.             ret = 2;
  83.         else
  84.             ret = 1;
  85.     }
  86.     else if((time1 < time_lead +180) && (time1 > time_lead -10))
  87.         ret =2;
  88.     else{
  89.         if (ret == -1&& ret1== -1) {
  90.             printf("file: all not found\n");
  91.         }else if(ret1== -1){
  92.             uboot_rtc_set_alarm_sec(time_rtc);
  93.         }else if(ret== -1){
  94.             uboot_rtc_set_alarm_sec(time_rtc1);
  95.         }else{
  96.             if(time_rtc1 > time_rtc){
  97.                 uboot_rtc_set_alarm_sec(time_rtc);
  98.             }else{
  99.                 uboot_rtc_set_alarm_sec(time_rtc1);
  100.             }
  101.         }
  102.         ret = 0;
  103.     }

  104.     return ret;
  105. }
如上面的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看出来。 


点击(此处)折叠或打开

  1. U-Boot 2010.12-svn (Oct 19 2013 - 14:03:13)



  2. DRAM: 256 MiB

  3. NAND: 00 00 00 00 00

  4. No NAND device

  5. 0 MiB

  6. Using default environment



  7. [sc8810fb_probe]

  8. [lcdc_mcu_init] LCDC_CTRL: 0x13

  9. [lcdc_calc_lcm_timing] ahb_clk: 0xfa

  10. [lcdc_calc_lcm_timing] ahb_clk: 0xfa

  11. [lcdc_lcm_configure] LCM_CTRL: 0x11600

  12. [lcdc_update_lcm_timing] LCM_PARAMETER1: 0x4ff0398

  13. [lcdc_calc_lcm_timing] ahb_clk: 0xfa

  14. [lcdc_calc_lcm_timing] ahb_clk: 0xfa

  15. [lcdc_lcm_configure] LCM_CTRL: 0x11600

  16. [lcdc_update_lcm_timing] LCM_PARAMETER1: 0x4ff0398

  17. [set_lcdc_layers] LCDC_OSD1_CTRL: 0x12d

  18. [set_lcdc_layers] LCDC_OSD1_ALPHA: 0xff

  19. [set_lcdc_layers] LCDC_OSD1_SIZE_XY: 0x1e00140

  20. [set_lcdc_layers] LCDC_OSD1_DISP_XY: 0x0

  21. [set_lcdc_layers] LCDC_OSD1_PITCH: 0x140

  22. [set_lcdsize] LCDC_DISP_SIZE: 0x1e00140

  23. [set_lcmrect] LCDC_LCM_START: 0x0

  24. [set_lcmrect] LCDC_LCM_SIZE: 0x1e00140

  25. In: serial

  26. Out: serial

  27. Err: serial

  28. sci_efuse_calibration data:0

  29. is_bat_low adc_value:843,comp_vbat:3500

  30. mingwei uboot vol:3814,adc4200:928,adc3600:796

  31. GEN0 1d382360

  32. func: do_cboot line: 101

  33. Device nand0 not

  34. mtdparts init error 1

  35. ANA_RTC_INT_RSTS is 0x820000b4

  36. value of it 0x11

  37. alarm_flag_check factoryalarmret1 = 0,factoryalarmret2=0alarm_flag file is exist

  38. time_buf[0]=255

  39. time_buf[1]=255

  40. time_buf[2]=255

  41. time_buf[3]=255

  42. time_buf[4]=255

  43. time_buf[5]=255

  44. time_buf[6]=255

  45. time_buf[7]=255

  46. time_buf[8]=255

  47. time_buf[9]=255

  48. time_buf[10]=255

  49. time_buf[11]=255

  50. time_buf[12]=255

  51. time_buf[13]=255

  52. time_buf[14]=255

  53. time_buf[15]=255

  54. time_buf[16]=255

  55. time_buf[17]=255

  56. time_buf[18]=255

  57. time_buf[19]=255

  58. time_buf[20]=255

  59. time_buf[21]=255

  60. time_buf[22]=255

  61. time_buf[23]=255

  62. time_buf[24]=255

  63. time_buf[25]=255

  64. time_buf[26]=255

  65. time_buf[27]=255

  66. time_buf[28]=255

  67. time_buf[29]=255

  68. time_buf[30]=255

  69. time_buf[31]=255

  70. time_buf[32]=255

  71. time_buf[33]=255

  72. time_buf[34]=255

  73. time_buf[35]=255

  74. time_buf[36]=255

  75. time_buf[37]=255

  76. time_buf[38]=255

  77. time_buf[39]=255

  78. time_buf[40]=255

  79. time_buf[41]=255

  80. time_buf[42]=255

  81. time_buf[43]=255

  82. time_buf[44]=255

  83. time_buf[45]=255

  84. time_buf[46]=255

  85. time_buf[47]=255

  86. time_buf[48]=255

  87. time_buf[49]=255

  88. time_buf[50]=255

  89. time_buf[51]=255

  90. time_buf[52]=255

  91. time_buf[53]=255

  92. time_buf[54]=255

  93. time_buf[55]=255

  94. time_buf[56]=255

  95. time_buf[57]=255

  96. time_buf[58]=255

  97. time_buf[59]=255

  98. time_buf[60]=255

  99. time_buf[61]=255

  100. time_buf[62]=255

  101. time_buf[63]=255

  102. time_buf[64]=255

  103. time_buf[65]=255

  104. time_buf[66]=255

  105. time_buf[67]=255

  106. time_buf[68]=255

  107. time_buf[69]=255

  108. time_buf[70]=255

  109. time_buf[71]=255

  110. time_buf[72]=255

  111. time_buf[73]=255

  112. time_buf[74]=255

  113. time_buf[75]=255

  114. time_buf[76]=255

  115. time_buf[77]=255

  116. time_buf[78]=255

  117. time_buf[79]=255

  118. time_buf[80]=255

  119. time_buf[81]=255

  120. time_buf[82]=255

  121. time_buf[83]=255

  122. time_buf[84]=255

  123. time_buf[85]=255

  124. time_buf[86]=255

  125. time_buf[87]=255

  126. time_buf[88]=255

  127. time_buf[89]=255

  128. time_buf[90]=255

  129. time_buf[91]=255

  130. time_buf[92]=255

  131. time_buf[93]=255

  132. time_buf[94]=255

  133. time_buf[95]=255

  134. time_buf[96]=255

  135. time_buf[97]=255

  136. time_buf[98]=255

  137. time_buf[99]=255

  138. time_buf[100]=255

  139. time_buf[101]=255

  140. time_buf[102]=255

  141. time_buf[103]=255

  142. time_buf[104]=255

  143. time_buf[105]=255

  144. time_buf[106]=255

  145. time_buf[107]=255

  146. time_buf[108]=255

  147. time_buf[109]=255

  148. time_buf[110]=255

  149. time_buf[111]=255

  150. time_buf[112]=255

  151. time_buf[113]=255

  152. time_buf[114]=255

  153. time_buf[115]=255

  154. time_buf[116]=255

  155. time_buf[117]=255

  156. time_buf[118]=255

  157. time_buf[119]=255

  158. time_buf[120]=255

  159. time_buf[121]=255

  160. time_buf[122]=255

  161. time_buf[123]=255

  162. time_buf[124]=255

  163. time_buf[125]=255

  164. time_buf[126]=255

  165. time_buf[127]=255

  166. time_buf[128]=255

  167. time_buf[129]=255

  168. time_buf[130]=255

  169. time_buf[131]=255

  170. time_buf[132]=255

  171. time_buf[133]=255

  172. time_buf[134]=255

  173. time_buf[135]=255

  174. time_buf[136]=255

  175. time_buf[137]=255

  176. time_buf[138]=255

  177. time_buf[139]=255

  178. time_buf[140]=255

  179. time_buf[141]=255

  180. time_buf[142]=255

  181. time_buf[143]=255

  182. time_buf[144]=255

  183. time_buf[145]=255

  184. time_buf[146]=255

  185. time_buf[147]=255

  186. time_buf[148]=255

  187. time_buf[149]=255

  188. time_buf[150]=255

  189. time_buf[151]=255

  190. time_buf[152]=255

  191. time_buf[153]=255

  192. time_buf[154]=255

  193. time_buf[155]=255

  194. time_buf[156]=255

  195. time_buf[157]=255

  196. time_buf[158]=255

  197. time_buf[159]=255

  198. time_buf[160]=255

  199. time_buf[161]=255

  200. time_buf[162]=255

  201. time_buf[163]=255

  202. time_buf[164]=255

  203. time_buf[165]=255

  204. time_buf[166]=255

  205. time_buf[167]=255

  206. time_buf[168]=255

  207. time_buf[169]=255

  208. time_buf[170]=255

  209. time_buf[171]=255

  210. time_buf[172]=255

  211. time_buf[173]=255

  212. time_buf[174]=255

  213. time_buf[175]=255

  214. time_buf[176]=255

  215. time_buf[177]=255

  216. time_buf[178]=255

  217. time_buf[179]=255

  218. time_buf[180]=255

  219. time_buf[181]=255

  220. time_buf[182]=255

  221. time_buf[183]=255

  222. time_buf[184]=255

  223. time_buf[185]=255

  224. time_buf[186]=255

  225. time_buf[187]=255

  226. time_buf[188]=255

  227. time_buf[189]=255

  228. time_buf[190]=255

  229. time_buf[191]=255

  230. time_buf[192]=255

  231. time_buf[193]=255

  232. time_buf[194]=255

  233. time_buf[195]=255

  234. time_buf[196]=255

  235. time_buf[197]=255

  236. time_buf[198]=255

  237. time_buf[199]=255

  238. alarm_flag_check,sprd_rtc_init() enter

  239. 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

  240. usb calibrate detecting

  241. usb calibrate configuration timeout

  242. 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_RSTSvalue = 0x11上来的原因,如何触发的,这还需要深入研究

 

阅读(3488) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~