Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    麻雀d1s编译修复adb和phoenixsuit连接问题

    MR Series
    2
    2
    1482
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • q1215200171
      budbool LV 9 last edited by

      • 修复pc连接电脑掉电问题;
      • 修复phoenixsuit连接问题;

      修复pc连接电脑后掉电问题

      官方的tina编译出来之后,连接电脑,如果使用了otg口,会导致这个开发板不断的断开和重连.

      而且串口不断地打印断连重连的信息.有这个报错信息:

      WARN: get power supply failed\n
      

      看起来是和供电有关的问题,我在网上找到这个文章.

      作者说这是因为开发板连接usb之后会把某个电流限制到500ma.我们可以改一下

      在文件tina-d1-open/lichee/linux-5.4/drivers/usb/sunxi_usb/udc/sunxi_udc.c中,修改函数sunxi_set_cur_vol_work.

      void sunxi_set_cur_vol_work(struct work_struct *work)
      {
      #if !defined(SUNXI_USB_FPGA) && defined(CONFIG_POWER_SUPPLY)
              struct power_supply *psy = NULL;
              union power_supply_propval temp;
      
              if (of_find_property(g_udc_pdev->dev.of_node, "det_vbus_supply", NULL))
                      psy = devm_power_supply_get_by_phandle(&g_udc_pdev->dev,
                                                           "det_vbus_supply");
      
              if (!psy || IS_ERR(psy)) {
                      DMSG_PANIC("%s()%d WARN: get power supply failed\n",
                                 __func__, __LINE__);
              } else {
                      temp.intval = 2500; //改为2500ma
      
                      power_supply_set_property(psy,
                                              POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &temp);
              }
      #endif
      }
      

      改完之后编译打包,这个现象不会出现了.

      修复phoenixsuit连接问题

      修改文件tina-d1-open/lichee/brandy-2.0/u-boot-2018/drivers/sunxi_flash/mmc/sdmmc.c中的sunxi_sprite_mmc_probe函数:

      int sunxi_sprite_mmc_probe(void)
      {
      #ifndef CONFIG_MACH_SUN50IW11
              return sdmmc_init_for_sprite(0, 0); //修改了这里.
      #else
              int workmode = uboot_spare_head.boot_data.work_mode;
              if (workmode == WORK_MODE_CARD_PRODUCT)
                      return -1;
              else
                      return sdmmc_init_for_sprite(0, 0);
      #endif
      }
      

      改了之后就可以直接用phoenixsuit来刷机.而不需要使用读卡器.

      文章作者: zzidun pavo
      文章链接: https://zzidun.github.io/2022/02/08/ma-que-d1s-bian-yi-xiu-fu-adb-he-phoenixsuit-lian-jie-wen-ti/

      1 Reply Last reply Reply Quote Share 1
      • DAIZEBIN
        DAIZEBIN LV 7 last edited by

        在SDK中修改了对应的内容后,也还是会报该错误,
        错误log如下:

        root@TinaLinux:/# [   29.232076] sunxi_vbus_det_work()3356 WARN: get power supply failed
        [   29.250472] android_work: sent uevent USB_STATE=DISCONNECTED
        [   29.272172] sunxi_set_cur_vol_work()397 WARN: get power supply failed
        [   29.294535] android_work: sent uevent USB_STATE=CONNECTED
        [   29.312027] configfs-gadget gadget: high-speed config #1: c
        [   29.318466] android_work: sent uevent USB_STATE=CONFIGURED
        [   29.324950] regulator-dummy: Underflow of regulator enable count
        [   29.332456] read descriptors
        [   29.335711] read strings
        [   29.342970] android_work: sent uevent USB_STATE=DISCONNECTED
        [   29.519967] sunxi_set_cur_vol_work()397 WARN: get power supply failed
        [   29.566921] android_work: sent uevent USB_STATE=CONNECTED
        [   29.583202] configfs-gadget gadget: high-speed config #1: c
        [   29.589905] android_work: sent uevent USB_STATE=CONFIGURED
        [   33.012012] sunxi_vbus_det_work()3356 WARN: get power supply failed
        [   33.019804] android_work: sent uevent USB_STATE=DISCONNECTED
        [   33.026274] sunxi_set_cur_vol_work()397 WARN: get power supply failed
        [   33.070338] android_work: sent uevent USB_STATE=CONNECTED
        [   33.086732] configfs-gadget gadget: high-speed config #1: c
        [   33.093222] regulator-dummy: Underflow of regulator enable count
        [   33.100748] android_work: sent uevent USB_STATE=DISCONNECTED
        [   33.107276] read descriptors
        [   33.110499] read strings
        

        修改之后的SDK文件如下:

        
        void sunxi_set_cur_vol_work(struct work_struct *work)
        {
        #if !defined(SUNXI_USB_FPGA) && defined(CONFIG_POWER_SUPPLY)
        	struct power_supply *psy = NULL;
        	union power_supply_propval temp;
        
        	if (of_find_property(g_udc_pdev->dev.of_node, "det_vbus_supply", NULL))
        		psy = devm_power_supply_get_by_phandle(&g_udc_pdev->dev,
        											   "det_vbus_supply");
        	if (!psy || IS_ERR(psy)) {
        		DMSG_PANIC("%s()%d WARN: get power supply failed\n",
        				   __func__, __LINE__);
        	} else {
        		temp.intval = 2500;
        
        		power_supply_set_property(psy,
        								  POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &temp);
        	}
        #endif
        }
        
        
        1 Reply Last reply Reply Quote Share 0
        • 1 / 1
        • First post
          Last post

        Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

        行为准则 | 用户协议 | 隐私权政策