我试图在我的项目中使用的u引导中添加DFU支持,因为我发现在其中没有启用DFU支持。
我使用的是飞思卡尔-引导(从git://git.freescale.com/imx/uboot-imx.git)克隆出来的"rel_imx_4.1.15_1.1.0_ga“标记是我需要做的。
问题是,通过u引导文档,我可以看到DFU必须启用。我将以下内容添加到我的.h文件中
#define CONFIG_USB_FUNCTION_DFU
#define CONFIG_CMD_DFU
#define CONFIG_DFU_MMC
#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
#define DFU_DEFAULT_POLL_TIMEOUT 300但我得到了以下错误:
common/built-in.o: In function `do_dfu':
/home/m4l490n/uboot-imx/common/cmd_dfu.c:29: undefined reference to `dfu_init_env_entities'
/home/m4l490n/uboot-imx/common/cmd_dfu.c:35: undefined reference to `dfu_show_entities'
/home/m4l490n/uboot-imx/common/cmd_dfu.c:41: undefined reference to `g_dnl_clear_detach'
/home/m4l490n/uboot-imx/common/cmd_dfu.c:42: undefined reference to `g_dnl_register'
/home/m4l490n/uboot-imx/common/cmd_dfu.c:44: undefined reference to `g_dnl_detach'
/home/m4l490n/uboot-imx/common/cmd_dfu.c:50: undefined reference to `dfu_usb_get_reset'
/home/m4l490n/uboot-imx/common/cmd_dfu.c:67: undefined reference to `usb_gadget_handle_interrupts'
/home/m4l490n/uboot-imx/common/cmd_dfu.c:70: undefined reference to `g_dnl_unregister'
/home/m4l490n/uboot-imx/common/cmd_dfu.c:72: undefined reference to `dfu_free_entities'
/home/m4l490n/uboot-imx/common/cmd_dfu.c:77: undefined reference to `g_dnl_clear_detach'
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.24 assertion fail ../../bfd/elf32-arm.c:7696
arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not found in the linker script
arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation
make: *** [u-boot] Error 1我注意到,如果从文件中删除CONFIG_CMD_DFU #,它会编译得很好,但是如果我在u引导shell中输入=> dfu,它会说:
Unknown command 'dfu' - try 'help'因此,问题是*您知道我还需要添加什么才能在我使用的u引导中启用DFU吗?
谢谢!!
发布于 2016-07-07 23:42:26
dfu_*的未定义引用启用DFU USB类的USB部分:
#定义CONFIG_DFU_FUNCTION
usb_gadget_handle_interrupts的未定义引用启用您的UDC控制器(我非常肯定您的平台有ChipIdea UDC控制器),还启用了USB:
#定义CONFIG_CI_UDC #定义CONFIG_USBD_HS #定义CONFIG_USB_GADGET #定义CONFIG_USB_GADGET_DUALSPEED #定义CONFIG_USB_GADGET_VBUS_DRAW 2
g_dnl_*的未定义引用启用和配置USB下载小工具:
# CONFIG_USBDOWNLOAD_GADGET #定义CONFIG_G_DNL_VENDOR_NUM 0x18d1 #定义CONFIG_G_DNL_PRODUCT_NUM 0x0d02 #定义CONFIG_G_DNL_MANUFACTURER "FSL“
现在您应该能够成功地构建U了。在configs/mx7dsabresd_defconfig上进行测试(更改为include/configs/mx7dsabresd.h)。下载小工具(G_DNL)的配置值取自include/configs/mx7dsabresdandroid.h。
从根本上说,连接问题可以通过下一种方式解决。要找出缺少什么定义,您可以查看缺少函数的实现位置,然后查找Makefile,其中启用了相应的源文件进行构建,从该Makefile中可以找到要定义的选项,以便在链接阶段构建相应的对象文件和希望函数。
https://stackoverflow.com/questions/37888264
复制相似问题