Main menu

Post navigation

Buildroot 2012.02 for Beagleboard-xM with LI-5M03 (mt9p031) camera support

New all-in-one Buildroot ver. 2012.02-mg01.1 released! It includes MLO + U-Boot 2011.12, Linux kernel 3.2.8 (@1GHz) and RootFS with all the necessary packages for working with LI-5M03 (mt9p031) camera module from Leopard Imaging. In order to build the images just run the following commands:

After that you’ll find all the images in buildroot/output/images folder:

MLO – U-Boot SPL first stage bootloader;

u-boot.img – U-Boot 2011.12 binary;

uEnv.txt – simple file with U-Boot parameters;

uImage – Linux kernel 3.2.8 image;

rootfs.tar – Root Filesystem image;

This build requires an external toolchain Codesourcery 2011.09-70 which needs to be installed in the /opt/CodeSourcery folder. However, you can use another toolchain version or folder after proper initialisation in Toolchainmenu (Buildroot menuconfig target).

I added Media-ctl and Yavta packages to the current release so you can configure and test your LI-5M02 (mt9p031) Aptina camera module. Also, I included OpenCV 2.3.1, MPlayer, FFmpeg and GStreamer packages, but please note that there is no X11 support in this release so if you need X11 you need to enable it in Buildroot. For full list of packages in current release please see corresponding wiki page: 2012.02-mg01.1.

If you need to add/remove some packets you can easily do this using the next command:

make menuconfigPackage Selection for the target —>

Please note that if you need to remove something you need to untick packet’s name in menuconfig and rebuild the entire RootFS.

Also please note that I added the following compiler flags to the configuration for Beagleboard-xM:

-mfpu=neon -ftree-vectorize -mfloat-abi=softfp

Installation

All the files can be found in buildroot/output/images folder. Just copy MLO, u-boot.img, uEnv.txt and uImage to the FAT partition of your SD card and untar everything from rootfs.tar to the second ext3 partition. That’s all, your Beagleboard-xM is ready to go.

Precompiled images

If you don’t have enough time for downloading/building everything or if you want just to test your board you can always use my precompiled images (rootfs.tar.gz – basic RootFS, rootfs_full.tar.gz – RootFS with all default packages):

P.S. If you find some issues feel free to add ticket to the Issues. And please note that it’s just a project I’m using for building all the files for my BB-xM. It’s not a clone or official/unofficial mirror, it’s just a personal project just for fun.

P.P.S. In order to build a basic minimal configuration (i.e. MLO, U-Boot, Linux kernel and RootFS with Busybox only) please use the following commands:

Hi Max,
Do you have any news? I was playing around for one week now without any remarkable improvements (8.5fps). I measured the camera pixelclock which is only 46.8MHz, this could be increased but I don’t think it is the main problem.

Another question: We need to implement an autofocus feature on our camera. Did you ever use the H3A module?

Many thanks for releasing those files.
Do you have any article or website that show someone how to integrate a package [i.e. drivers, code, etc..] into a linux kernel.

I have got a USB touch controller eGalaxTouch that I am using with my BeagleBoard-xm. The touchscreen works but I could not calibrate it with tslib and other calibration. So I will like to include the driver source code as a moudle in a linux kernel before I cross – build it for my BeagleBoard-xm
Please help!
Cheers!

I’m curious to know if you managed to achieve that 25-30 FPS with the lbcm5m03 yet (mt9p031)? I’m struggling with getting it to work, and while it does capture, 11 FPS is on the slow side (I’m certain you’re aware of that ).

I did notice on another post you saying something about the frame-rate issue being related to an initialization of the mt9p031 driver and that you’d had it working at 30 FPS…but that appeared to be with an older kernel. Does that fix apply to, or can it be applied to, the current kernel?

1. You can use U-Boot SPL first stage loader (this is my preference and actually this version of first stage bootloader is used in the current Buildroot). Please refer to the U-Boot 2011.12 sources/description for details;

2. Or if you need a separate/another version you can use X-Loader from the following repo (please note that I haven’t tested that version of X-Loader):
git://gitorious.org/x-loader/x-loader.git

I have two questions.
1. I installed the external toolchain Codesourcery 2011.09-70, got your buildroot, set up the environment, fixed the dash-bash problem and started the compile. The scripts and compilers run for hours and finall terminated with the following error.

2. While waiting for the compile I decided to just make an SD card with the precompiled images to see if it will work for what I need. The card boots and the camera shows up in the messages so I would expect it to work. My problem is I can’t seem to get the magic commands typed or copied into the console window. I’m using PuTTY on a Windows machine for the connection to the console port of the BeagleboardXM. When I try to type that huge line in it will wrap.

Hi Max,
Is it possible to use the prebuilt images with out the serial cable and minicom? I have a BeagleboardXM Rev C and I am trying to use your prebuilt images. I have connected a monitor and usb keyboard to BBXm ans when it boots, it shows only the penguin at the top and stays there. Any idea how to proceed?

I hand typed all the commands into a script and was able to get images. Apparently pasting into vi from from the web page didn’t work.

I have another question. Now that I have the buildroot creating all the files needed to run the system how do I change something. For example I need to reassign the DSS pins in beagle.h and recompile. I changed beagle.h and run make again but it didn’t recompile u-boot. Is there a way to just recompile uboot from the code buildroot put on my system?

Hi Max, now i really need a wireless adapter to stream the video to my laptop. Now, I have TP-Link TL-WN723N wireless adapter. However, I have no idea how to install the driver. Is there any advice that you could give?

Hi,
I am tryng to compile. I don’t know why, but when I start with make appear error: can’t execute /opt/CodeSourcery/arm-none-linux-gnueabi-gcc
It’s possible that I haven’t correctly installed the CodeSourcery. I don’t understand how to install it and so I have only untar in “/opt/CodeSourcery”.

So I set and used a toolchain that works with other procedure for Beagleboard XM revC and Angstrom. (the toolchain is http://www.angstrom-distribution.org/toolchains).
Infact when I start with make it compiles for 3 hour and then give me seguent error:

checking linux/media.h usability… no
checking linux/media.h presence… no
checking for linux/media.h… no
ERROR: Kernel header file not found or not usable!
make: *** [/root/buildroot/output/build/media-ctl-36a1357c9c879092fe2e36c82187f1d35b1efe13/.stamp_configured] Errore 1

Do you know what’s the matter?

While waiting for the compile I decided to just make an SD card with the precompiled images. I used the rootfs_full.tar.gz because I can’t download rootfs.tar.gz.
It starts but when i try to use the “magic command” (I made a script with the command for putty on windows) terminal says:
Media-ctl: command not found
is it right?

While I was waiting i retry with the precompiled image and so i was wrong with the “magic command”. Now it work!
Someone Know If ther are some command/method for change:
- Saturation
- Brightness
- Contrast
- time of Shutter
- Sensitivity Gain
and if and how I can apply a Gamma correction?

I solved the compiling problem. I was wrong with CodeSourcery setup. I’m working with Ubuntu 11.10 64-bit version. I didn’t have the 32-bit libraries. Now I have install all using this link’s advices:https://sourcery.mentor.com/GNUToolchain/kbentry62

Hei Max,
First of all I want to thank you for sharing your experience with the LI camera module. I followed your instructions and compiled all files. From the comments I understand that it is normal to just get a penguin in the upper left corner on the HDMI output. However I don’t have a serial adapter and I can’t ssh into the beagleboard since no ssh port is configured on the beagle board. Thus I can’t give any system input at all(except for Ctrl+Alt+Del which resets the board).
How can I get a terminal and system output to appear on the screen? Or how can I access the board when there is nothing else except a penguin?

After changing this parameter, my BBxM boots up properly.
I have some further questions regarding this:
1. Is the HW on BBxM not ready for 1GHz? or just the SW (kernel) not support 1GHz yet?
2. I want to perminantly change mpurate value to 800 instead of changing it every time after uEnv.txt is generated. What I did is manually modify this section in boot/uboot/Config.in file:
===========================
config BR2_TARGET_UBOOT_UENV_MPURATE
string “mpurate”
default “800″
# default “1000″
help
MPU frequency
===========================
I was hoping “make menuconfig” is driven by this file, however it seems not. Could you please let me know where does “make menuconfig” get its mpurate value “1000″ from?

Uncompressing Linux… done, booting the kernel.
===============================
As you’ve seen, it hangs here forever if I keep “mpurate=1000″ in uEnv.txt. It can only finish booting up if I change this parameter to 800 or less. I guess I am still missing something. Could you please suggest what I missed?

Another question about your buildroot structure: if I want to setup an static IP address for eth0 at compilation time, which file I should modify?

1. I’m not sure, but maybe your BB/power supply has some issues (as image works on my BB-xM Rev.C and I know it works on a number of another boards). Start with power supply, i.e. check output current or try another one.

2. Try to use “earlyprintk” kernel parameter in order to see early kernel debug output.

3. Yes, if you need to change default parameters of your RootFS then “fs/skeleton” is the best place to do that.

Hei Max,
Thank you very much for your help. I got everything working and capturing videos and converting them works fine. However I faced some issues:
1. My videos are colored yellow. Cleaning the camera and reinstalling everything didn’t help. Have you ever face an issue like that?
2. Even with smaller resolutions I cannot capture images on a higher rate than 13.6fps. You reported you could capture video at 25-30 fps. How did you manage to do so?
3. I would like to do some basic color detection with opencv. At my PC everything works fine with opencv and a webcam. How can I open the video stream on the beagleboard with opencv or how can I get Opencv to detect the camera?

I have an LBCM3M1 (MT9T111) module and an LBCM5M1 (MT9P011) module from Leopard Imaging which I’m trying to get working on my BB-xM (Rev.C). Is there any support for these in kernel 3.2.8 or do I have to go back to 2.6.32? I can only see MT9P031, MT9T001, MT9V011 and MTV032 listed in linux-3.2.8.config in the buildroot/board/beagleboard/xm directory.

If it is a case of going back to 2.6.x, is it just a case of following your instructions for 2011 Buildroot?

BTW: I can confirm that your instructions for Bbuildroot 2012.02 work fine on an Ubuntu 12.04 LTS x64 (Core i7 CPU) host for the BB-xM (Rev.C) target. I created the beagle_xm_full_defconfig files and it booted fine. Many thanks.

Do you still have a branch on your git repository to your 2011 buildroot (k.2.6) configuration or has that been superseded by the 2012 one?

I’ve been trying to find out what the status of camera support is on the OMAP3 platform. It seems that Laurent Pinchart is one of the leading developers for V4L2 and that Android has better support for cameras? Unless you’ve been working in the Linux community for a good while it is quite difficult for a beginner to hit the right landing point to find out what is/not possible.

1. Try “2011.05-mg00.1″ tag for old Buildroot;
2. I have no idea about another cameras support, you should probably ask on some forums/mail lists (and basically if Android has better support then you should definitely use Android). I tested my Buildroot with mt9p031 as I’m using this module only in my project.

I made my Leopard Imaging 5PM camera module work on the BeagleBoard xM with the pre-built images. Great! That validates my setup. Thanks a lot :-).

Following that, I tried to compile the kernel, u-boot image and MLO. I tried first with the Angstrom toolchain, but the process stopped after building the kernel image… and after three hours of intensive computation. I tried a second time with CodeSourcery toolchain and it worked. My Linux distro is Ubuntu 10.04.

Once I had a working Beagle+camera combo, I tried the Magic Formula and tadam!, images showed up. It works but I noticed the following issues:
a) the image has a yellow dominance,
b) frame rate is low (6 fps at 1024×768) – I aim for at least 15 fps.

Now, where is the performance bottleneck: is it the camera driver or the video display driver? Both? As a test, I tried removing mplayer from the formula by redirecting yavta output to /dev/null instead of piping it in mplayer. The test script reported a improvement: 13 fps instead of 6. From there, It’s a bit premature to draw a conclusion but it seems that the whole V4L2 architecture trades off performances for hardware abstraction and versatility. What if a high-performance application will need to call lower-level device drivers at the cost of device independance?

I’d like to mention another thing: I looked into syslogs after running tests on the camera and noticed that the kernel trace contains I2C debug messages and some camera & OMAP ISP register dumps as well. I will try to optimize the kernel a bit by turning debug options off & recompiling the kernel.

Its interesting that you have a 3.2.x kernel running at 1 GHz on the Beagleboard xM. Did you port the patches to the 3.2.x kernel or did you find them somewhere? Even Ubuntu and Angstrom (which ships with the board) have not yet merged them into their 3.2.x kernels.

Hi Max,
I been trying to fix this problem for a while with no resultshttps://github.com/MaxGalemin/buildroot/issues/31
i did copy MLO, u-boot.img, uEnv.txt and uImage to the FAT partition of the SD card and untar everything from rootfs.tar to the second ext3 partition, same errors comes up and reference of what I can do?

since you are using the CodeSourcery toolchain and not (for example) Ubuntu’s arm-linux-gnueabihf toolchain? As far as I understand, using CodeSourcery limits you to soft float and that seems like wasting CPU power – or am I getting something wrong?