Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

usb build error! help me :)

http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif today i setup uclinux1.2 again,and modified kconfig files. but when i build the kernel ,here were so much errors :

Error drivers/built-in.o * In function `usb_buffer_map&#39;: undefined reference to `dma_map_single

Error drivers/built-in.o * In function `usb_buffer_unmap_sg&#39;: undefined reference to `dma_unmap_sg&#39;

Error drivers/built-in.o * In function `usb_buffer_unmap&#39;: undefined reference to `dma_unmap_single&#39;

Error drivers/built-in.o * In function `usb_hcd_giveback_urb&#39;: undefined reference to `dma_unmap_single&#39;

Error drivers/built-in.o * In function `usb_sg_init&#39;: undefined reference to `sg_dma_address&#39;

Error drivers/built-in.o * undefined reference to `dma_map_single&#39; undefined reference to `dma_map_single&#39;

Error drivers/built-in.o * undefined reference to `dma_unmap_single&#39; undefined reference to `dma_unmap_single&#39;

Error drivers/built-in.o * undefined reference to `sg_dma_address&#39; undefined reference to `sg_dma_len&#39;

Warning implicit declaration of CC drivers/usb/core/hub.o[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/core/usb.c]

Warning implicit declaration of function `dma_map_single&#39;[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/core/hcd.c]

Warning implicit declaration of function `dma_map_single&#39;[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/core/usb.c]

Warning implicit declaration of function `dma_unmap_sg&#39;[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/core/usb.c]

Warning implicit declaration of function `dma_unmap_single&#39;[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/core/hcd.c]

Warning implicit declaration of function `dma_unmap_single&#39;[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/core/usb.c]

Warning implicit declaration of function `sg_dma_address&#39;[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/core/message.c]

Warning implicit declaration of function `sg_dma_len&#39;[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/core/message.c]

Warning implicit declaration of function `usb_put_bus&#39;[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/host/hc_sl811.c]

10 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    i changed <*>USB support to <M>USB support. so its ok.

    i typed "mount -n nodev -t procfs /proc/bus/usb"in sdk shell.

    here was an error: mount : mount point /proc/bus/usb does not exist.

    and the folder /proc/bus was empty.

    why?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    (1) This is not a supported driver, and it&#39;s known to not work in 2.6.9. You should stop trying to use it and use the sl811-hcd driver from 2.6.10 following the instructions provided in a previous thread.

    (2) it doesn&#39;t do you any good to get around symbol not found errors by compiling something as a module, since the symbols will simply not be found once you try to load the module.

    (3) You can&#39;t mount the usb filesystem until the driver is in place to provide it. It must either be compiled in or if you load it as a module you have to actually load the module first (see# 2 since that won&#39;t work with this driver).

    So, in summary, if you want to do less work, switch to the sl811-hcd driver from 2.6.10 and follow the guidelines given to get it to work. If you want the fun of implementing the missing functions from dma-mapping.h and who knows what other kernel headers/files, go ahead, but when I asked around there was no indication that anyone ever got that working, though wentao was apparently close.

    Porting the sl811-hcd driver from 2.6.10 is pretty quick and faily easy if you follow the instructions I gave in a previous thread.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    When you copied over the driver, did you modify the Kconfig and Makefile so as to only build the new sl811-hcd driver? The old one will complain about the dma functions which aren&#39;t present, but if you don&#39;t try to compile the old one at all, no problems. :-)

    As for building sl811-hcd.o.d, I have no idea. Try posting the relevant portion of your modified Kconfig and Makefile files.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    yeah,i modefied the Kconfig and Makefile file in usb and usb/host.

    and deleted hc_sl811.c hc_simple.c ... in host folder.

    when i build the kernel,here was some error about sl811-hcd.c. such as:

    Kind Status Priority Description Resource In Folder Location

    Error error: `__force&#39; undeclared (first use in this function)[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/host/sl811-hcd.c] kernel_0504 line 1154

    Error error: `__le32&#39; undeclared (first use in this function)[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/host/sl811-hcd.c] kernel_0504 line 1322

    Error error: `ep&#39; undeclared (first use in this function)[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/host/sl811-hcd.c] kernel_0504 line 448

    Error error: `regs&#39; undeclared (first use in this function)[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/host/sl811-hcd.c] kernel_0504 line 456

    Error error: `req&#39; undeclared (first use in this function)[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/host/sl811-hcd.c] kernel_0504 line 441

    Error error: `sl811&#39; undeclared (first use in this function)[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/host/sl811-hcd.c] kernel_0504 line 455

    Error error: `status&#39; undeclared (first use in this function)[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/host/sl811-hcd.c] kernel_0504 line 452

    Error error: `usb_hcd_release&#39; undeclared (first use in this function)[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/host/sl811-hcd.c] kernel_0504 line 1751

    Error error: (Each undeclared identifier is reported only once[/cygdrive/d/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/usb/host/sl811-hcd.c] kernel_0504 line 441

    ...

    did you modify sl811-hcd.c before build it???
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yes, if you look over the thread where I gave the instructions, I pasted the modifications I made. However, they&#39;re not related to the problem that you&#39;re facing.

    Did you copy over the drivers/usb/host/sl811.h file as well as include/linux/usb_sl811.h files?

    The errors that you&#39;re getting sound a bit like you forgot to include them.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    i had been my hometown for few days.http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif

    i use altera cyclone board.

    and think here was some bug in software.

    i use quartusii 4.1 + uclinux1.2 + usb hcd(2.6.10), so i cannot build the kernel.

    hi,clansdown. do u use quartusii 4.2 + uclinux1.3?? can you email your usb hcd(3 files) to me???(gwb982@163.com). thank u !!!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yeah, I&#39;m using quartus 4.2sp1 & uClinux 1.3 -- I don&#39;t know whether this will work in the earlier version; 2.6.5 may be too far away from 2.6.10. Didn&#39;t I post the relevant portion of the driver in the earlier discussion? If not I&#39;ll go find my copy again and post it.