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

Hi all,

If someone is interested in getting a Buildroot 2012.02 for
Beagleboard-xM with LI-5M03 (mt9p031) camera support please find the
information and precompiled MLO + U-Boot 2011.12, Linux kernel 3.2.8
and RootFS images by following the link below:

http://blog.galemin.com/2012/03/buildroot-2012-02-for-beagleboard-xm-with-li-5m03-mt9p031-camera-support/

Cheers,
Max.

Hi all,

> If someone is interested in getting a Buildroot 2012.02 for
> Beagleboard-xM with LI-5M03 (mt9p031) camera support please find the
> information and precompiled MLO + U-Boot 2011.12, Linux kernel 3.2.8
> and RootFS images by following the link below:

> http://blog.galemin.com/2012/03/buildroot-2012-02-for-beagleboard-xm-with-li-5m03-mt9p031-camera-support/

Thanks, please consider contributing your buildroot changes upstream.

Hi Max!

Does this Buildroot support MIC capture feature? I need this

regards,
Max

Hi Max,

Basically yep, it does... But please note that Beagleboard-xM has
stereo "line-in" audio input (i.e. not a "microphone-in" one) and
"microphone bias module" on TPS65950 (pins MIC.MAIN.P, MIC.MAIN.M,
MICBIASx etc.) is not even connected. So you need to use an active
(powered) microphone. In order to be able to capture signal just
enable "Analog Left AUXL" and "Analog Right AUXR" controls and adjust
"Analog" level in alsamixer.

Cheers,
Max.

Hello Max,

If someone is interested in getting a Buildroot 2012.02 for
Beagleboard-xM with LI-5M03 (mt9p031) camera support please find the
information and precompiled MLO + U-Boot 2011.12, Linux kernel 3.2.8
and RootFS images by following the link below:
http://blog.galemin.com/2012/03/buildroot-2012-02-for-beagleboard-xm-

your buildroot works fine, however I cannot get the camera (LI-5M03.
mt9p031) to work

what media-ctl magic do you use? what command to capture?

this is what I tried (and failed)
$ media-ctl -r -l '"mt9p031 2-0048":0->"OMAP3 ISP CCDC":0[1], "OMAP3
ISP CCDC":1->"OMAP3 ISP CCDC output":0[1]'
$ media-ctl -f '"mt9p031 2-0048":0[SGRBG12 320x240], "OMAP3 ISP CCDC":
0[SGRBG8 320x240], "OMAP3 ISP CCDC":1[SGRBG8 320x240]'
$ yavta --stdout -f SGRBG8 -s 320x240 -n 4 --capture=10000 --skip 3 -F
$(media-ctl -e "OMAP3 ISP CCDC output")

Device /dev/video2 opened.
Device `OMAP3 ISP CCDC output' on `media' is a video capture device.
Video format set: SGRBG8 (47425247) 320x240 (stride 320) buffer size
76800
Video format: SGRBG8 (47425247) 320x240 (stride 320) buffer size 76800
4 buffers requested.
length: 76800 offset: 0
Buffer 0 mapped at address 0x4015f000.
length: 76800 offset: 77824
Buffer 1 mapped at address 0x40373000.
length: 76800 offset: 155648
Buffer 2 mapped at address 0x403cd000.
length: 76800 offset: 233472
Buffer 3 mapped at address 0x40425000.
Unable to start streaming: Broken pipe (32).
4 buffers released.

thanks, p.

Hi pmeerw,

Try these magic commands:

media-ctl -v -r -l '"mt9p031 2-0048":0->"OMAP3 ISP CCDC":0[1], "OMAP3
ISP CCDC":2->"OMAP3 ISP preview":0[1], "OMAP3 ISP preview":1->"OMAP3
ISP resizer":0[1], "OMAP3 ISP resizer":1->"OMAP3 ISP resizer output":
0[1]'
media-ctl -v -f '"mt9p031 2-0048":0 [SGRBG12 1024x768], "OMAP3 ISP
CCDC":2 [SGRBG10 1024x768], "OMAP3 ISP preview":1 [UYVY 10006x760],
"OMAP3 ISP resizer":1 [UYVY 1024x768]'
yavta -f UYVY -s 1024x768 -n 8 --skip 3 --capture=1000 --stdout /dev/
video6 | mplayer - -demuxer rawvideo -rawvideo
w=1024:h=768:format=uyvy -vo fbdev

Cheers,
Max.

Try these magic commands:
media-ctl -v -r -l '"mt9p031 2-0048":0->"OMAP3 ISP CCDC":0[1], "OMAP3
ISP CCDC":2->"OMAP3 ISP preview":0[1], "OMAP3 ISP preview":1->"OMAP3
ISP resizer":0[1], "OMAP3 ISP resizer":1->"OMAP3 ISP resizer output":
0[1]'
media-ctl -v -f '"mt9p031 2-0048":0 [SGRBG12 1024x768], "OMAP3 ISP
CCDC":2 [SGRBG10 1024x768], "OMAP3 ISP preview":1 [UYVY 10006x760],
"OMAP3 ISP resizer":1 [UYVY 1024x768]'
yavta -f UYVY -s 1024x768 -n 8 --skip 3 --capture=1000 --stdout /dev/
video6 | mplayer - -demuxer rawvideo -rawvideo
w=1024:h=768:format=uyvy -vo fbdev

powerful magic indeed :slight_smile:
it gets me an image

[root@beagleboard-xm ~]# media-ctl -v -r -l '"mt9p031 2-0048":0-

"OMAP3 ISP CCDC":0[1], "OMAP3 ISP CCDC":2->"OMAP3 ISP preview":0[1],

"OMAP3 ISP preview":1->"OMAP3 ISP resizer":0[1], "OMAP3 ISP resizer":1-

"OMAP3 ISP resizer output": 0[1]'

Opening media device /dev/media0
Enumerating entities
Found 16 entities
Enumerating pads and links
Resetting all links to inactive
Setting up link 16:0 -> 5:0 [1]
Setting up link 5:2 -> 7:0 [1]
Setting up link 7:1 -> 10:0 [1]
Setting up link 10:1 -> 12:0 [1]
[root@beagleboard-xm ~]# media-ctl -v -f '"mt9p031 2-0048":0 [SGRBG12
1024x768], "OMAP3 ISP CCDC":2 [SGRBG10 1024x768], "OMAP3 ISP preview":
1 [UYVY 10006x760], "OMAP3 ISP resizer":1 [UYVY 1024x768]'
Opening media device /dev/media0
Enumerating entities
Found 16 entities
Enumerating pads and links
Setting up format SGRBG12 1024x768 on pad mt9p031 2-0048/0
Format set: SGRBG12 864x648
Setting up format SGRBG12 864x648 on pad OMAP3 ISP CCDC/0
Format set: SGRBG12 864x648
Setting up format SGRBG10 1024x768 on pad OMAP3 ISP CCDC/2
Format set: SGRBG10 864x647
Setting up format SGRBG10 864x647 on pad OMAP3 ISP preview/0
Format set: SGRBG10 864x647
Setting up format SGRBG10 864x647 on pad OMAP3 ISP AEWB/0
Unable to set format: Invalid argument (-22)
Setting up format SGRBG10 864x647 on pad OMAP3 ISP AF/0
Unable to set format: Invalid argument (-22)
Setting up format SGRBG10 864x647 on pad OMAP3 ISP histogram/0
Unable to set format: Invalid argument (-22)
Setting up format UYVY 10006x760 on pad OMAP3 ISP preview/1
Format set: UYVY 846x639
Setting up format UYVY 846x639 on pad OMAP3 ISP resizer/0
Format set: UYVY 846x639
Setting up format UYVY 1024x768 on pad OMAP3 ISP resizer/1
Format set: UYVY 1024x768
[root@beagleboard-xm ~]# yavta -f UYVY -s 1024x768 -n 8 --skip 3 --
capture=10 /dev/video6
Device /dev/video6 opened.
Device `OMAP3 ISP resizer output' on `media' is a video capture
device.
Video format set: UYVY (59565955) 1024x768 (stride 2048) buffer size
1572864
Video format: UYVY (59565955) 1024x768 (stride 2048) buffer size
1572864
8 buffers requested.
length: 1572864 offset: 0
Buffer 0 mapped at address 0x402d5000.
length: 1572864 offset: 1572864
Buffer 1 mapped at address 0x404df000.
length: 1572864 offset: 3145728
Buffer 2 mapped at address 0x4068b000.
length: 1572864 offset: 4718592
Buffer 3 mapped at address 0x4085f000.
length: 1572864 offset: 6291456
Buffer 4 mapped at address 0x40a0e000.
length: 1572864 offset: 7864320
Buffer 5 mapped at address 0x40c16000.
length: 1572864 offset: 9437184
Buffer 6 mapped at address 0x40d97000.
length: 1572864 offset: 11010048
Buffer 7 mapped at address 0x40faa000.
0 (0) [-] 4294967295 1572864 bytes 193.531157 193.531920 5.190 fps
1 (1) [-] 4294967295 1572864 bytes 193.726650 193.726780 5.115 fps
2 (2) [-] 4294967295 1572864 bytes 193.799995 193.800135 13.634 fps
3 (3) [-] 4294967295 1572864 bytes 193.873351 193.873476 13.632 fps
4 (4) [-] 4294967295 1572864 bytes 193.946696 193.946831 13.634 fps
5 (5) [-] 4294967295 1572864 bytes 194.020051 194.020184 13.632 fps
6 (6) [-] 4294967295 1572864 bytes 194.093398 194.093523 13.634 fps
7 (7) [-] 4294967295 1572864 bytes 194.166750 194.166881 13.633 fps
8 (0) [-] 4294967295 1572864 bytes 194.240102 194.240227 13.633 fps
9 (1) [-] 4294967295 1572864 bytes 194.313448 194.313579 13.634 fps
Captured 10 frames in 0.975117 seconds (10.255172 fps, 16129991.381328
B/s).
8 buffers released.

ethernet is not reliable (using a beagle-xm rev. b); but hey, one
can't have everything

thanks, p.

Hi Max!

I'm new to buildroot and now try to build your image at my PC. A
problem appears with the mentioned toolchain. I've downloaded and
installed
arm-2011.09-69-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 to /opt/CodeSourcery

make beagle_xm_defconfig
make

maxx-EX38T-DQ6:~/buildroot/buildroot$ make
Checking external toolchain settings
Cannot execute cross-compiler '/opt/CodeSourcery/bin/arm-none-linux-gnueabi-gcc'
make: *** [/home/maxx/buildroot/buildroot/output/stamps/ext-toolchain-checked]
Error 1
maxx@maxx-EX38T-DQ6:~/buildroot/buildroot$ ls /opt/CodeSourcery/
arm-none-eabi/ bin/ lib/ libexec/ share/
maxx@maxx-EX38T-DQ6:~/buildroot/buildroot$ ls /opt/CodeSourcery/bin/
arm-none-eabi-addr2line arm-none-eabi-c++filt arm-none-eabi-gcc
  arm-none-eabi-gdbtui arm-none-eabi-objcopy arm-none-eabi-run
arm-none-eabi-strip
arm-none-eabi-ar arm-none-eabi-cpp
arm-none-eabi-gcc-4.6.1 arm-none-eabi-gprof arm-none-eabi-objdump
arm-none-eabi-size
arm-none-eabi-as arm-none-eabi-elfedit arm-none-eabi-gcov
  arm-none-eabi-ld arm-none-eabi-ranlib arm-none-eabi-sprite
arm-none-eabi-c++ arm-none-eabi-g++ arm-none-eabi-gdb
  arm-none-eabi-nm arm-none-eabi-readelf arm-none-eabi-strings

Ok, I found that arm-none-linux-gnueabi is hardcoded in
toolchain/toolchain-external/Config.in

fixed it to arm-none-eabi, make clean, make ..xm_config, make again.
Now there is a different problem:
maxx-EX38T-DQ6:~/buildroot/buildroot$ make
/usr/bin/make -j2 HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" silentoldconfig
make[1]: Вход в каталог `/home/maxx/buildroot/buildroot'
KCONFIG_AUTOCONFIG=/home/maxx/buildroot/buildroot/output/build/buildroot-config/auto.conf
KCONFIG_AUTOHEADER=/home/maxx/buildroot/buildroot/output/build/buildroot-config/autoconf.h
KCONFIG_TRISTATE=/home/maxx/buildroot/buildroot/output/build/buildroot-config/tristate.config
BUILDROOT_CONFIG=/home/maxx/buildroot/buildroot/.config
/home/maxx/buildroot/buildroot/output/build/buildroot-config/conf
--silentoldconfig Config.in
make[1]: Выход из каталога `/home/maxx/buildroot/buildroot'
mkdir -p /home/maxx/buildroot/buildroot/output/target
if ! [ -d "/home/maxx/buildroot/buildroot/output/target/bin" ]; then \
    if [ -d "/home/maxx/buildroot/buildroot/fs/skeleton" ]; then \
      cp -fa /home/maxx/buildroot/buildroot/fs/skeleton/*
/home/maxx/buildroot/buildroot/output/target/; \
    fi; \
    touch /home/maxx/buildroot/buildroot/output/host/usr/arm-unknown-linux-gnueabi/sysroot/.fakeroot.00000;
\
  fi
find /home/maxx/buildroot/buildroot/output/target -type d -name CVS
-print0 -o -name .svn -print0 | xargs -0 rm -rf
find /home/maxx/buildroot/buildroot/output/target -type f \( -name
.empty -o -name '*~' \) -print0 | xargs -0 rm -rf
touch /home/maxx/buildroot/buildroot/output/build/.root
Checking external toolchain settings
Incorrect selection of the C library
make: *** [/home/maxx/buildroot/buildroot/output/stamps/ext-toolchain-checked]
Error 255

Now what's wrong?

2011.09-70 is needed. I used 2011.09-69 which is publicly available
from Mentor Graphics.

Hi Max,

Basically, you should pay attention not to the version number itself
but rather to a name of the toolchain. For compiling binaries for
Linux target system you need "arm-none-linux-gnueabi" version
(arm-2011.09-70-arm-none-linux-gnueabi, also freely available) but not
an "arm-none-eabi" (arm-2011.09-69-arm-none-eabi) which is for bare
metal development, i.e. without any RTOS.

Cheers,
Max.

I had similar issue, and got a reliable /dev/eth1 through one of those simple usb-ethernet converters.

Hello all,

I have gotten the image to work and am communicating with putty through the serial port. I cannot type in the full magic commands can someone point me in the right direction hon how to write a script to execute the “magic commands”

Cheers
-Nathan

Cabrito,

Looking at the terminal loader screen if the camera activates you will
see "mt9p031 2-0048: mt9p031 chip ID 1801"
that means the driver has loaded and associated to the camera, Aptina
has a list of chip ID numbers to cross reference with.
as for your Invalid argument (22) if you cut and paste in the commands
the " and ' generate strange unrecognizable characters if you write a
script and edit it with nano in the build you can fix that problem.

Cheers
-Nathan

Cabrito,

Max's build allows convenient access from the minicom or whatever
RS323 interface. It looks to me that your camera is detected. Max
has built the terminal editor nano into his build. From your terminal
type [root@beagleboard-xm ~]# nano this will open the editor then type
in the all the commands you can do this in 3 different scripts or all
in 1 just save them with a .sh suffix. If you cut and paste the " and
' in the command return strange characters. Save your script say call
it camera.sh then run it [root@beagleboard-xm ~]# sh camera.sh you
can manipulate the number of frames captured, resolution and more by
editing this script once you get it working.

Cheers
-Nathan

Hello Nathan that such apparently already working, I will make some tests to see if it works correctly

thanks

2012/6/27 Nathan Proper <natprop@gmail.com>

Nathan hello this is working well, I have only one drawback, the picture looks as if a pixel was dead, not in your case if the same thing happens

2012/6/28 Juan Gerardo Sánchez Malfavón <cabro0o0@gmail.com>

Juan,

Glad to hear it is working! I have not had a dead pixel in mine I
would check your monitor and cable. If that is not the problem I
would guess your camera has a faulty chip on it.

Cheers
-Nathan

hello again Nathan, a question, you know how to configure the ethernet interface to access the network?, I’d appreciate your help

2012/7/2 Nathan Proper <natprop@gmail.com>

Sorry I do not. I ended up building a 2.6.32 kernel with angstrom for
my Ethernet and GUI and other peripheral support.

Maybe this is a stupid question, but where are you supposed to see the images? I input the 3 magic commands posted by Max and am able to get it to say that it’s capturing frames, but I don’t actually see them. I have my tv connected to the beagleboard via HDMI and I assumed the images would show there, is that correct? Do I need to alter any of the commands (i.e. the video6 part of the last command)?