LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-11-2011, 10:19 AM   #1
radiodee1
Member
 
Registered: Oct 2006
Location: New York
Distribution: Debian
Posts: 675
Blog Entries: 11

Rep: Reputation: 36
dwc_otg.ko module on embedded 2.6.27 Parrot ARDrone kernel


I'm looking to cross compile a certain module for the linux kernel that's embedded in a Parrot ARDrone helicopter. The module runs a usb otg port as a serial terminal. Instructions for doing this are on the site below.

http://embedded-software.blogspot.co...drone-usb.html

I've got two challenges, one being the actual compiling of the module with the changes mentioned, and the other being compiling the same module for the arm processor on the ARDrone. I've downloaded the source and made the changes to the 'dwc_otg_driver.c' file but I've had trouble compiling it. The basic problem is that if I type 'make modules' a few kernel modules are built, but not the dwc_otg.ko module. (I have downloaded the arm cross-compiler, but have not had a chance to use it yet -- I thought I'd try regular compiling first.)

I went into the kernel configuration screens, typing 'make menuconfig'. I pretty much scoured the various menus but could not find the option for 'dwc_otg'. I tried out several things that I felt were close to the option I was looking for without any luck.

How do you compile a module that doesn't seem to exist in 'make menuconfig' ?? Is the menuconfig step somehting that you can get around? Thanks.
 
Old 03-13-2011, 05:33 AM   #2
radiodee1
Member
 
Registered: Oct 2006
Location: New York
Distribution: Debian
Posts: 675

Original Poster
Blog Entries: 11

Rep: Reputation: 36
more info

This is more about what I've tried. I Download the CodeSourcery-lite cross compiling software and install. Add the 'bin' directory for the CodeSourcery tools to the path variable. I Downloaded and untarred 'ARDrone_Version_20100809_1_2-linux-2.6.27.tar.bz2'

from:
https://projects.ardrone.org/attachm...2.6.27.tar.bz2

Downloaded and untarred 'ARDrone_Version_20100809_1_2-kernel.config'

from:
https://projects.ardrone.org/documents/show/18

Go to directory 'linux-2.6.27' and copy the 'ARDrone_Version_20100809_1_2-kernel.config' file to '.config'. Go to the directory 'linux-2.6.27/drivers/parrot/usb/dwc_otg/' and edit the 'dwc_otg_driver.c' file as described in the link below, changing three lines:

http://embedded-software.blogspot.co...drone-usb.html

Go back to 'linux-2.6.27' and execute the command below:

Code:
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
This builds the kernel and the modules. Here is some of the output at the end of the compile showing the zImage and the modules created.

Code:
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  Building modules, stage 2.
  MODPOST 4 modules
  CC      drivers/block/loop.mod.o
  LD [M]  drivers/block/loop.ko
  CC      drivers/block/nbd.mod.o
  LD [M]  drivers/block/nbd.ko
  CC      drivers/parrot/mmc/p6_sdhci.mod.o
  LD [M]  drivers/parrot/mmc/p6_sdhci.ko
  CC      drivers/scsi/scsi_wait_scan.mod.o
  LD [M]  drivers/scsi/scsi_wait_scan.ko
$
The problem is that no dwc_otg.ko module is created. I did notice in the 'drivers/parrot/usb/dwc_otg/' folder a new file called 'built-in.o'. Is there a way to get the dwc_otg.ko file that I need in this situation??

Last edited by radiodee1; 03-13-2011 at 05:34 AM.
 
Old 02-23-2012, 06:57 AM   #3
nikhiln51
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Rep: Reputation: Disabled
hi all,
"Add the 'bin' directory for the CodeSourcery tools to the path variable".I did not understand this line..i tried so many ways...im getting like this
nimmakal@wp-sata45:~/Desktop/Needed/linux-2.6.27$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi
make: arm-none-linux-gnueabigcc: Command not found
HOSTCC scripts/basic/fixdep
scripts/basic/fixdep.c: In function ‘traps’:
scripts/basic/fixdep.c:377:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
scripts/basic/fixdep.c:379:4: warning: dereferencing type-punned pointer will break strict-aliasing rules
HOSTCC scripts/basic/docproc
HOSTCC scripts/kconfig/conf.o
scripts/kconfig/conf.c: In function ‘conf_choice’:
scripts/kconfig/conf.c:306:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
scripts/kconfig/conf.c: In function ‘conf_askvalue’:
scripts/kconfig/conf.c:104:8: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
HOSTCC scripts/kconfig/kxgettext.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/arm/Kconfig
#
# configuration written to .config
#
make: arm-none-linux-gnueabigcc: Command not found
CHK include/linux/version.h
UPD include/linux/version.h
Generating include/asm-arm/mach-types.h
CHK include/linux/utsrelease.h
UPD include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CC kernel/bounds.s
/bin/sh: arm-none-linux-gnueabigcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2

pls plsssssssssssssssssssssss help me....
 
Old 02-23-2012, 07:23 AM   #4
radiodee1
Member
 
Registered: Oct 2006
Location: New York
Distribution: Debian
Posts: 675

Original Poster
Blog Entries: 11

Rep: Reputation: 36
so, this was for the ar drone usb port. I should say that even after getting the module compiled the drone's usb still didn't work. In fact we burned out part of the board trying to get it to work. I recommend against trying it. Anyway, with your compiling problem, the line you used to cross compile is wrong. Where you have 'CROSS_COMPILE=' and you have 'arm-none-linux-gnueabi' it really should read 'arm-none-linux-gnueabi-'. The last dash is important.
Quote:
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
I don't know if this will help you, but it's the first thing I noticed.
 
Old 02-23-2012, 08:03 AM   #5
nikhiln51
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Rep: Reputation: Disabled
Thumbs up

thank u veryyyyyyyyyyyyy much..... just a single dash i forgot...im suffering from this problem soooo many days...u solved this...thanks a lot... @radiodee1
 
Old 02-23-2012, 08:15 AM   #6
nikhiln51
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Rep: Reputation: Disabled
hi, hav u got solution to ur problem? got dwc_otg.ko file??? if u found out can u tell me plsssss @radiodee1
 
Old 02-23-2012, 08:33 AM   #7
nikhiln51
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Rep: Reputation: Disabled
yessss....got dwc_otg.ko file.....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Parrot 1.0 Said to Speak Your Virtual Language LXer Syndicated Linux News 0 03-20-2009 12:20 AM
LXer: Tiny module targets mobile, embedded apps LXer Syndicated Linux News 0 09-15-2007 07:20 AM
[Error] Kernel Module : No kernel module build environment saman007uk Debian 7 09-09-2006 06:34 PM
Dead parrot jolphil Debian 7 04-21-2005 06:48 PM
kernel module ignorant newbie looking for any one with kernel module knowledge cpoet Slackware 4 11-24-2003 09:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration