building custom modules for beagleboard

Hi
I am trying to get a camera Starlight Xpress MX716 working with
beagleboard. For that I have to compile the drivers and build kernel
modules ccd.ko, sx_usb.ko and insert them into the kernel.

How do I cross compile these modules from the C code for beagleboard?

I am sorry, this might be a silly query, but I have just begun to use
beagleboard a few weeks back.

Any help is appreciated.

Thanks,
Regards,
Chhavi Goenka

This sounds like a general linux kernel module question. Anyway AFAIK
this camera is not supported in the kernel tree (i may be wrong), so
are you
planning to write the driver yourself?

There are a lot of howtos available on how to compile and insert
modules.

-Deepak

http://deepak.dk

Hi Deepak,
Thank you for the response.
The driver is already written for kernel 2.6. I have successfully
tried it on a linux desktop.
I want to cross compile the driver for the beagleboard, running
angstrom linux.
I am searching for the howtos. Also thought of just posting this
question on this group, in case anyone had come across a good howto,
and would want to share.

Thanks,
Regards,
Chhavi

also, is it possible to compile the modules onboard itself? or they
have to be cross compiled and then inserted?

I am booting kernel from Nand and i followed steps as mentioned in below link

http://elinux.org/BeagleBoardNAND#Writing_kernel_with_kernel

after booting it from Nand it is stoped, here is the log

40T �H�H�U���ᅁInstruments X-Loader 1.4.2 (Feb 19 2009 - 12:01:24)
Loading u-boot.bin from nand


U-Boot 2009.01-dirty (Feb 19 2009 - 12:22:31)

I2C: ready
OMAP3503-GP rev 2, CPU-OPP2 L3-165MHz
OMAP3 Beagle board + LPDDR/NAND
DRAM: 128 MB
NAND: 256 MiB
MUSB: using high speed
In: serial
Out: serial
Err: serial
Board revision Ax/Bx
Serial #55ba0002000000000403193412013014
Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x280000, size 0x400000
4194304 bytes read: OK
## Booting kernel from Legacy Image at 80000000 …
Image Name: Linux-2.6.29-rc3-omap1
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1787480 Bytes = 1.7 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum … OK
Loading Kernel Image … OK
OK

Starting kernel …

Uncompressing Linux… done, boo
ting the kernel.

Please help me solve this issue

–Sanjeev |

They can be compiled natively . You can install the compiler,linker
etc using opkg

-Deepak

Thanks Deepak.

Hey all,
I'm doing something like Chhavi ,wrote a module for the
veagleboard,but i dunno how to cross compile it and load it to the
beagleboard

tarek.attia wrote:

Hey all,
I'm doing something like Chhavi ,wrote a module for the
veagleboard,but i dunno how to cross compile it and load it to the
beagleboard
  
Cross-compiling a module out of the tree is easy:

You need the kernel-headers of the linux kernel running on the beagle
and a cross-compiler toolchain somewhere on your system.

Your makefile should look somewhat like this:

obj-m += my_module.o

all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

Now put the path to the kernel into an evironment variable (shown for my
path):

PATH_TO_KERNEL=~/source/beagle/kernel

and invoke make like this:

make -C $PATH_TO_KERNEL CROSS_COMPILE=arm-none-linux-gnueabi- M=$PWD

After compilation you should find a .ko file in the same directory as
the source. Copy that onto the beagle and as root type:

  insmod ./path/to/module/my_module.ko

to load the module.

That's it.

Cheers,
    Nils Pipenbrinck

Op 15 nov 2009 om 16:33 heeft np <np@planetarc.de> het volgende geschreven:\

tarek.attia wrote:

Hey all,
I'm doing something like Chhavi ,wrote a module for the
veagleboard,but i dunno how to cross compile it and load it to the
beagleboard

Cross-compiling a module out of the tree is easy:

You need the kernel-headers of the linux kernel running on the beagle
and a cross-compiler toolchain somewhere on your system.

Your makefile should look somewhat like this:

obj-m += my_module.o

all:
   make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

yes, uname works soooo great when crosscompiling. NOT!

Hi everyone,
this is my makefile

I have tried bitbaking a fresh kernel, but it gives me a parse error
while using bitbake.