Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • 社区主页

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

    D1-H/D1s
    1
    1
    112
    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 7 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
      • 1 / 1
      • First post
        Last post

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

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