I'm trying to add DFU support to the u-boot I'm using in my project because I figured out that DFU support is not enabled in it.
我正在尝试将DFU支持添加到我的项目中,因为我发现DFU支持并没有在它中启用。
I'm using freescale u-boot (cloning from git://git.freescale.com/imx/uboot-imx.git) and I checked out the tag "rel_imx_4.1.15_1.1.0_ga" wich is the one I'm required to work on.
我使用的是freescale u-boot(来自git的克隆://git.freescale.com/imx/uboot-imx.git),我检查了标签“rel_imx_4.1.15_1.1.0_ga”,这是我需要做的工作。
The thing is that going through the u-boot documentation I can see that DFU have to be enabled. I added the following to my .h file
问题是,通过u-boot文档,我可以看到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
But I'm getting the following errors:
但我有以下错误:
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
I noticed that If I remove #define CONFIG_CMD_DFU from the .h file it compiles fine but if I enter => dfu in the u-boot shell it says:
我注意到,如果我从.h文件中删除了#define CONFIG_CMD_DFU,它会编译得很好,但是如果我在u-boot shell中输入=> dfu,它会说:
Unknown command 'dfu' - try 'help'
So the question is *Do you know what else do I need to add to enable DFU in the u-boot I'm using?
所以问题是*你知道我还需要添加什么来让DFU在我的u-boot中使用吗?
Thanks!!
谢谢! !
1 个解决方案
#1
0
-
To fix these linking errors:
修复这些链接错误:
undefined reference to
dfu_*
未定义的引用dfu_ *
enable the USB portion of the DFU USB class:
启用DFU USB类的USB部分:
#define CONFIG_DFU_FUNCTION
-
To fix this linking error:
修复连接错误:
undefined reference to
usb_gadget_handle_interrupts
未定义的引用usb_gadget_handle_interrupts
enable your UDC controller (I'm pretty sure your platform has ChipIdea UDC controller), and also enable USB gadget:
启用你的UDC控制器(我很确定你的平台有ChipIdea UDC控制器),并启用USB设备:
#define CONFIG_CI_UDC #define CONFIG_USBD_HS #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_USB_GADGET_VBUS_DRAW 2
-
To fix these linking errors:
修复这些链接错误:
undefined reference to
g_dnl_*
未定义的引用g_dnl_ *
enable and configure USB download gadget:
启用和配置USB下载小工具:
#define CONFIG_USBDOWNLOAD_GADGET #define CONFIG_G_DNL_VENDOR_NUM 0x18d1 #define CONFIG_G_DNL_PRODUCT_NUM 0x0d02 #define CONFIG_G_DNL_MANUFACTURER "FSL"
Now you should be able to build U-Boot successfully. Tested on configs/mx7dsabresd_defconfig
(with changes to include/configs/mx7dsabresd.h
). Configuration values for download gadget (G_DNL) were taken from include/configs/mx7dsabresdandroid.h
.
现在您应该能够成功地构建U-Boot。在configs/mx7dsabresd_defconfig上进行了测试(修改了包含/configs/mx7dsabresd.h)。下载gadget (G_DNL)的配置值来自include/configs/mx7dsabresdandroid.h。
Basically, linking problems can be solved next way. To find out what definition is missing, you can look where missing function is implemented, then look for Makefile
where corresponding source file is enabled for build, and from that Makefile
you can figure out which option to define, so that corresponding object-file is built and wanted function is in place at linking stage.
基本上,链接问题可以通过下面的方式解决。找出定义丢失,你可以把缺失的功能实现,然后寻找Makefile启用相应的源文件的构建,从那Makefile可以找出哪些选项来定义,因此相应的对象文件是建立在链接阶段和想要的功能。
#1
0
-
To fix these linking errors:
修复这些链接错误:
undefined reference to
dfu_*
未定义的引用dfu_ *
enable the USB portion of the DFU USB class:
启用DFU USB类的USB部分:
#define CONFIG_DFU_FUNCTION
-
To fix this linking error:
修复连接错误:
undefined reference to
usb_gadget_handle_interrupts
未定义的引用usb_gadget_handle_interrupts
enable your UDC controller (I'm pretty sure your platform has ChipIdea UDC controller), and also enable USB gadget:
启用你的UDC控制器(我很确定你的平台有ChipIdea UDC控制器),并启用USB设备:
#define CONFIG_CI_UDC #define CONFIG_USBD_HS #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_USB_GADGET_VBUS_DRAW 2
-
To fix these linking errors:
修复这些链接错误:
undefined reference to
g_dnl_*
未定义的引用g_dnl_ *
enable and configure USB download gadget:
启用和配置USB下载小工具:
#define CONFIG_USBDOWNLOAD_GADGET #define CONFIG_G_DNL_VENDOR_NUM 0x18d1 #define CONFIG_G_DNL_PRODUCT_NUM 0x0d02 #define CONFIG_G_DNL_MANUFACTURER "FSL"
Now you should be able to build U-Boot successfully. Tested on configs/mx7dsabresd_defconfig
(with changes to include/configs/mx7dsabresd.h
). Configuration values for download gadget (G_DNL) were taken from include/configs/mx7dsabresdandroid.h
.
现在您应该能够成功地构建U-Boot。在configs/mx7dsabresd_defconfig上进行了测试(修改了包含/configs/mx7dsabresd.h)。下载gadget (G_DNL)的配置值来自include/configs/mx7dsabresdandroid.h。
Basically, linking problems can be solved next way. To find out what definition is missing, you can look where missing function is implemented, then look for Makefile
where corresponding source file is enabled for build, and from that Makefile
you can figure out which option to define, so that corresponding object-file is built and wanted function is in place at linking stage.
基本上,链接问题可以通过下面的方式解决。找出定义丢失,你可以把缺失的功能实现,然后寻找Makefile启用相应的源文件的构建,从那Makefile可以找出哪些选项来定义,因此相应的对象文件是建立在链接阶段和想要的功能。