tag:blogger.com,1999:blog-67641096755407267882024-03-19T11:16:43.354-07:00random hacksplaying with embeddedormzhttp://www.blogger.com/profile/07479609238793090117noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-6764109675540726788.post-9564556437870395542012-09-06T17:34:00.000-07:002012-09-06T17:40:08.679-07:00aarch64 toolchainIn the last months there has been movement towards merging a new architecture in the mainline kernel, called aarch64. Along with it, they came the binutils and gcc ports.<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">kernel: http://lwn.net/Articles/505682/
binutils: http://sourceware.org/ml/binutils/2012-07/msg00269.html
gcc: http://gcc.gnu.org/ml/gcc-patches/2012-05/msg01694.html
</pre>
Given that I have never touched a bare metal toolchain, I thought this was a good thing to pass the time, so I started playing with these pieces and got to compile binutils, gcc and the kernel, from the patches submitted. Now it is easier given that binutils support was merged.<br />
<br />
I don't really use cvs, just downloaded the latest snapshot of binutils (2.22.90 doesn't have aarch64):<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">wget ftp://sourceware.org/pub/binutils/snapshots/binutils.tar.bz2
</pre>
Extract.<br />
<br />
Assuming you are at /my_tc, you create build/binutils and compile from there, your source is at /my_tc/binutils-latest/.<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">$ cd /my_tc/build/binutils/
$ /my_tc/binutils-latest/configure --prefix=/my_tc/out --target=aarch64-none-linux-gnu --disable-werror
$ make -j4 && make install
</pre>
And for gcc:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">svn checkout http://gcc.gnu.org/svn/gcc/branches/ARM/aarch64-branch</pre>
Assuming you are at /my_tc, you create build/gcc and compile from there, your source is at /my_tc/aarch64-branch/.<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">$ cd /my_tc/build/gcc/
$ /my_tc/aarch64-branch/configure --prefix=/my_tc/out --target=aarch64-none-linux-gnu --disable-nls --enable-languages=c --disable-threads --without-headers --with-newlib --disable-shared --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath
$ make -j4 && make install
$ export PATH=/my_tc/out/bin:$PATH
$ export CROSS_COMPILE=aarch64-none-linux-gnu-
$ export ARCH=arm64
</pre>
Get the kernel:
<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64.git
$ cd linux-aarch64
$ make allnoconfig && make -j4</pre>
And now you have a compiled kernel with a bare metal toolchain. You can play with the menuconfig or just go randconfig and fix some of the bugs too.<br />
<br />
---<br />
<br />
Back then when aarch64 binutils wasn't merged, I had to download and patch binutils code and regenerate the makefile and include files. Something like:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">1. Download binutils-2.22.90, patch it with aarch64 changes.
2. automake on bfd/, binutils/, gas/, ld/ and opcodes/; automake must be 1.11.1.
3. autoconf on top configure file, bfd/ and opcodes/; autoconf must be 2.64.
4. configure and make, and wait for it to break or just run configure inside bfd in order to get a Makefile there.
5. cd bfd/; make headers and cd -, this will generate some missing symbols.
6. Now you can either clean your previous failed build or continue it.
</pre>
And then follow the steps to compile binutils, gcc and kernel.ormzhttp://www.blogger.com/profile/07479609238793090117noreply@blogger.com0tag:blogger.com,1999:blog-6764109675540726788.post-69846439310124689662011-11-30T10:27:00.001-08:002011-11-30T17:37:50.673-08:00Can't open /dev/ttyO2: No such file or directory (buildroot-2010.08)Lately I have been using a beagle-xm and a lent pandaboard, with an old minimal file system (buildroot 2010.08) and newest kernels 2.6.39+, and encountered this message whenever I wanted to boot anything beyond 2.6.39.<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">Can't open /dev/ttyO2: No such file or directory
</pre>
I realized the kernel version in the top Makefile was affecting after few git bisect runs, and then confirmed by playing with it for 3.0+ kernels.<br />
<br />
Although I knew there was something wrong with udev and user space I didn't have the time to dig into it and just modified the version in the top Makefile while compiling the kernel (from 3.0+ to 2.6.X).<br />
<br />
Later I discovered the issue was in my filesystem:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">/etc/init.d/S10udev:19
# old kernels don't use udev
case $(uname -r) in
2.6*|2.7*) ;;
*) exit 0;;
esac
</pre>
As it turns out newer kernels don't use udev either ;) according to the script.<br />
<br />
Removing those lines from the udev start script gives your ttyO2 console back.<br />
<br />
This was fixed in one of the latest buildroot releases, I didn't check which one, but the udev start script doesn't have the kernel version check in buildroot 2011.08.<br />
<br />
However, the latest version doesn't quite work for me, so, until I find some time to check what I'm missing I'll stick to 2010.08.<br />
<br />
On a side issue:<br />
<br />
If you ever re-download buildroot-2010.08 and build from scratch, you're likely to face a build break during:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">gzip: buildroot-2010.08/dl/fakeroot_1.9.5.tar.gz: not in gzip format
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
</pre>
Which is caused by a broken fakeroot link.<br />
<br />
The bad: <br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">http://snapshot.debian.net/archive/2008/04/27/debian/pool/main/f/fakeroot//fakeroot_1.9.5.tar.gz
</pre>
The good:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">http://snapshot.debian.org/archive/debian/20080427T000000Z/pool/main/f/fakeroot/fakeroot_1.9.5.tar.gz
</pre>
Just download from the good link and replace fakeroot tarball in:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;"> buildroot-2010.08/dl/fakeroot_1.9.5.tar.gz
</pre>
And continue the build.ormzhttp://www.blogger.com/profile/07479609238793090117noreply@blogger.com2tag:blogger.com,1999:blog-6764109675540726788.post-58237096637597005882011-03-04T16:37:00.000-08:002011-03-04T16:41:46.112-08:00beagle-xm portable juiceAfter a long week waiting for the deliveries and few shipping issues[1], finally, I got my portable battery and usb-to-5.5mm cable to power my beagle-xm; the hunt started a few weeks back when I was looking for a battery to power the beagle-xm and maybe 1 or 2 peripherals, why? just because, and also I needed something that could be used for other devices as well and here I found the <a href="http://www.dreamgear.net/i-sound-portable-power-8000-mah.html">iSound</a> —which by the way doesn't make any sound— and at a price of $40 from buy.com, it seemed like a fair buy.<br />
<br />
According to the spec sheet, it holds 8000 mah, and the output is 5V and 2.1A for each USB port. So, it seems like a fit for beagle-xm which eats 5V and 750mA, and up to 3A with all the USB ports. It also last up to 500 charges which seems lousy by the way, but I'm just planning to use it on rare occasions and when I'm out of cellphone battery in the middle of desert.<br />
<br />
Initial boot tests showed no problem, but I'm not plugging anything to the USB either; so I'll wait for a final verdict when using a USB based bluetooth, wifi or display.<br />
<br />
Here are some pictures of how it looks:<br />
<table><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIzvZhgLztMK4hxeSMHQjNDtvtMOz9kj93bC8gVlVnJfrh9kfTEf9F_w3F6pIRJlZUJKHA0Rj1dwNx4MpQfq_0QxYephqzOrQKDQH_kH43YyYJyhUDnaHC8o_W5rn2C2nj_YuWFDGPTkA/s1600/aIMG_0064.JPG" imageanchor="1" style=""><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIzvZhgLztMK4hxeSMHQjNDtvtMOz9kj93bC8gVlVnJfrh9kfTEf9F_w3F6pIRJlZUJKHA0Rj1dwNx4MpQfq_0QxYephqzOrQKDQH_kH43YyYJyhUDnaHC8o_W5rn2C2nj_YuWFDGPTkA/s320/aIMG_0064.JPG" width="320" /></a></td> <td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOnuahRp6KxdxZGm4YtXPnUolbiI74TQ_PVa9g7hM_rZuE66gmmwl_urCW2ACNvIxHRsHOs_zmvX4rgJx6HrIBXIf_7hYaZbFF1FRVbQWEPjWgE25PhOEBc4PJUZU5BzY-Lt4nUWArIVI/s1600/aIMG_0066.JPG" imageanchor="1" style=""><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOnuahRp6KxdxZGm4YtXPnUolbiI74TQ_PVa9g7hM_rZuE66gmmwl_urCW2ACNvIxHRsHOs_zmvX4rgJx6HrIBXIf_7hYaZbFF1FRVbQWEPjWgE25PhOEBc4PJUZU5BzY-Lt4nUWArIVI/s320/aIMG_0066.JPG" width="320" /></a></td></tr>
</tbody></table><br />
---<br />
[1] When ordering from buy.com and prompted to confirm billing address, I realized that I hadn't touched my account in 2 years since it had the address of the hotel I was at that time, I updated it and placed my order. Two days later, and like a desperate kid, reviewed the order progress and yes... the shipping address was the hotel; when contacting customer service, the guy said something like "Yep, I'll cancel the order and you can reorder again, just wait for one day for this to succeed", later on that day, I received an email: "Your order has been shipped" :/ .<br />
<br />
Anyway, thankfully the hotel is in the same city I'm living now, so just registered my email for delivery tracking, went by and picked it up, no hassle, no sweat.ormzhttp://www.blogger.com/profile/07479609238793090117noreply@blogger.com0tag:blogger.com,1999:blog-6764109675540726788.post-90989688786747877812011-02-17T18:41:00.000-08:002011-10-18T16:37:26.769-07:00booting beagle-xm with tidspbridgeThanks to <a href="http://groups.google.com/group/beagleboard/browse_thread/thread/6292bba4ea36c128/ebd7bc246effc97c#ebd7bc246effc97c">Andresj</a>, I got a good reason to dust off my beagle-xm and the dsp inside it.<br />
<br />
So, this post is just a quickie about booting and poking the dsp, even though Andresj intends to bring up <a href="http://elinux.org/BeagleBoard/DSP_Clarification">dsplink</a>, me, being a complete noob on the subject, will just swap it for tidspbridge.<br />
<br />
There are probably a lot of posts and wikis<a href="http://omapedia.org/wiki/Bootloader_Project">[1]</a><a href="http://omapedia.org/wiki/Linux_OMAP_Kernel_Main">[2]</a><a href="http://elinux.org/BeagleBoard">[3]</a><a href="http://omapedia.org/wiki/DSPBridge_Project">[4]</a> detailing these steps, but what the hell, one (this one) polluting the web space doesn't hurt much, besides I'm not going to detail each point.<br />
<br />
In the "nearly-done-from-scratch" world, you should have:<br />
<br />
<ul>
<li><a href="http://www.codesourcery.com/sgpp/lite/arm/">ARM GCC</a> to compile your <a href="http://gitorious.org/x-load-omap3">x-load</a> (MLO), <a href="http://git.denx.de/?p=u-boot.git;a=summary">u-boot</a>, uImage (<a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary">vanilla kernel</a> or <a href="http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=summary">linux-omap kernel</a>) and fileystem + utilities (I use <a href="http://buildroot.uclibc.org/">buildroot</a>), besides of your user space apps.</li>
<li>TI's <a href="https://www-a.ti.com/downloads/sds_support/TICodegenerationTools/download.htm">CGT</a> and <a href="http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dspbios/index.html">BIOS</a> to compile dsp binaries.</li>
<li>Filesystem storage: NFS, MMC or NAND.</li>
</ul>
<br />
If not, you could try my <a href="https://sites.google.com/site/orrmz1/arm-rootfs.tar.bz2?attredirects=0">rootfs</a> and mount it on MMC.<br />
<br />
UPDATE: Remember to change the rootfs files owner (chown) and group (chgrp) to "root" after decompressing into MMC or for NFS boot. <br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">In rootfs/etc/inittab, change ttyS0 for ttyO2 (on latest kernels, previously ttyS2)
In rootfs/etc/securetty, add ttyO2 (on latest kernels, previously ttyS2)</pre>
Compile your kernel with tidspbridge and copy to the uImage to mmc, the modules should go to the filesystem.<br />
<br />
I was using 2.6.38-rc3 with omap2plus_defconfig. I noticed a strange issue though: if you let the kernel booting messages through the console, you get a panic because mmc couldn't be mounted.<br />
<br />
UPDATE: Thanks to Vaibhav for pointing out, you can set <a href="http://lxr.linux.no/linux+v2.6.37.1/Documentation/kernel-parameters.txt#L2212">rootwait</a> on your bootargs, solving above mmc detection problem.<br />
<br />
And in u-boot.<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">set bootargs 'mem=512M console=ttyO2,115200n8 noinitrd root=/dev/mmcblk0p2 rw rootwait'</pre>
Be sure your boot.scr or the default environment variables doesn't override your bootargs, I had to modify mine, so the mmcboot didn't overwrite the bootargs.<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">set mmcboot 'bootm ${loadaddr}'</pre>
Then.<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">bootd</pre>
If everything went well, you can login as root and try the gst commands from one of my <a href="http://ormz.blogspot.com/2010/11/gst-dspomapfb-on-zoom2.html">previous posts</a>. Enjoi :P<br />
<br />
<span class="Apple-style-span" style="font-size: large;">Usual solutions to random problems</span><br />
<br />
Compiling<br />
<ul>
<li>Export your compiler path before cross-compiling, and also your CROSS_COMPILE variable, in some cases even the ARCH variable might be needed too.</li>
<li>Configure your target defconfig.</li>
<li>Remember to take mkimage from u-boot project to compile the uImage, you should put it under a folder in your PATH.</li>
</ul>
<br />
Booting<br />
<ul>
<li>No messages: recheck serial, USB-serial connections; check settings with the emulation terminal (usual ones are the port and speed configs, 115200n8); check MLO and SDcard, recompile & reflash if needed.</li>
<li>X-loader hangs: check u-boot, recompile & reflash if needed.</li>
<li>Kernel hangs in "Starting kernel": Something went horribly wrong enable earlyprintk to debug (with the right tty).</li>
<li>Kernel hangs in "Uncompressing Linux...": Recheck your bootargs (most common errors are that kernel throws messages through ttyS0, but bootargs listen ttyS2).<br />
</li>
<li>Kernel hangs around "Freeing init...": Recheck the same tty stuff in your file system /etc/inittab.</li>
<li>Filesystem doesn't allow login: check your configured users; add the tty to the list in /etc/securetty.</li>
<li>Kernel panic while mounting FS:</li>
<ul>
<li>NFS: check NFS server settings and exports; check bootargs; check file system path in server and bootargs; check ip, serverip, nfs server ip.</li>
<li>MMC: check bootargs; check filesystem partition in bootargs; check the SD card, if possible try another one.</li>
</ul>
</ul>ormzhttp://www.blogger.com/profile/07479609238793090117noreply@blogger.com6tag:blogger.com,1999:blog-6764109675540726788.post-64733199339480414232011-02-16T10:42:00.000-08:002011-02-16T14:21:14.591-08:00Beagle Board Challenge: SuperBeagleA few weeks back I ran over this <a href="http://processors.wiki.ti.com/index.php/Beagle_Board_Challenge:_SuperBeagle">project</a>, its purpose is to give dspbridge (or tidspbridge) users, a fair example of how to interact between a userspace application and a dsp dll, it is heavily based on <a href="http://github.com/felipec/dsp-dummy">dsp-dummy</a> made available by FelipeC.<br />
<br />
To be honest, I have never looked at dsp-dummy before this, but now I want to try writing a codec following this simple approach, although the result will be pure crap—coding and performance wise ;)—it seems like a good exercise.<br />
<br />
In the mean time, other nice projects from the same Beagle Challenge can be found <a href="http://processors.wiki.ti.com/index.php/Beagle_Board_Open_Source_Design_Challenge">here</a>.<br />
<br />
---<br />
<br />
BTW, if you ever run "SuperBeagle" project with TIDSPBRIDGE_WDT3 enabled, it may cause an overflow because of the way this dll was changed from the original dsp-dummy. Once it executes, the dsp side (dummy-dsp.c) falls into a while loop checking for messages all the time (NODE_getMsg with timeout=0) never refreshing the WDT timer... the common practice (on dsp side code) is to set the timeout value to infinite so the dsp can block that task and wake it up once a message arrives.ormzhttp://www.blogger.com/profile/07479609238793090117noreply@blogger.com0tag:blogger.com,1999:blog-6764109675540726788.post-10506115832914286932010-12-18T12:08:00.000-08:002011-02-16T10:58:23.770-08:00beagle xm unboxIt arrived 2-3 weeks ago, sadly I haven't had the time to try anything on it, other than the angstrom SD card environment included...<br />
<br />
I thought I could rely on USB to feed the board and boot, but when I tried the kernel that came with the board, I saw there was a nasty bug panicking every time I try to boot (I guess it is USB related), so, I had to search in my "cables" (spanish) junkyard box and found a perfect 5V match for it.<br />
<br />
Then, I wanted to test the display output, but since my TV doesn't have a DVI port :(, I got an ugly S-Video signal which I yet have to tweak and play with to see if it can get better.<br />
<br />
And... uboot doesn't have tftp support. I know these are the preloaded binaries, so I have to try the latest stuff to see if it gets better :).<br />
<br />
So, I leave a few pictures of the unboxing:<br />
<table><tbody><tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK5O59eju42ghMExGJ0NCXwVyZGGApPHNEkNI5SjssIRUYjFa97RSKFzFLOyl_7GrLxpq73nFPj8FpLe2QcJcEuXzK1ydSWrRx-474qh_xYCEe_FUkJvWoo7luXpBIBjyNaiYCvbRG4ak/s1600/mIMG_5768.jpg" imageanchor="1" style=""><img border="0" height="240" width="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK5O59eju42ghMExGJ0NCXwVyZGGApPHNEkNI5SjssIRUYjFa97RSKFzFLOyl_7GrLxpq73nFPj8FpLe2QcJcEuXzK1ydSWrRx-474qh_xYCEe_FUkJvWoo7luXpBIBjyNaiYCvbRG4ak/s320/mIMG_5768.jpg" /></a></td>
<td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNhV3nobfk0gpcVj9thZZ0KEnQtMW2iS5tN-twuyS9UYKnWyi4gR3BNjoczq2tSrluv3XbvykQI2vUDdB9pPqS8FYzDfuHNSXfwmm2OsEw8Nl3mzKMdzUSQmcJCbiFYmosnzz9P_R-iaU/s1600/mIMG_5771.jpg" imageanchor="1" style=""><img border="0" height="240" width="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNhV3nobfk0gpcVj9thZZ0KEnQtMW2iS5tN-twuyS9UYKnWyi4gR3BNjoczq2tSrluv3XbvykQI2vUDdB9pPqS8FYzDfuHNSXfwmm2OsEw8Nl3mzKMdzUSQmcJCbiFYmosnzz9P_R-iaU/s320/mIMG_5771.jpg" /></a></td></tr></tbody></table><table><tbody><tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc3V_nK8fCNuOioI8Q2OfkWoIO9csazX7IfxOPzD1j6l2hPNl3EfXJ07Zd_XIQFeEy7ykkI7teaYsXVQzih-CNbeTuOWzu6pXraroL1r9iwEDAfnYYZVTBGtymk_LL1idll9kSi_Gp2tg/s1600/mIMG_5772.jpg" imageanchor="1" style=""><img border="0" height="240" width="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc3V_nK8fCNuOioI8Q2OfkWoIO9csazX7IfxOPzD1j6l2hPNl3EfXJ07Zd_XIQFeEy7ykkI7teaYsXVQzih-CNbeTuOWzu6pXraroL1r9iwEDAfnYYZVTBGtymk_LL1idll9kSi_Gp2tg/s320/mIMG_5772.jpg" /></a></td>
<td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8bPcBCWqb9f_yni5peo1VL5C58wx8fbacXIzJol69McW9P1nhnb7n4FXFTf8Na9T4Uj5AzAvy4DiqDYwuMOT71w_ocWvj1f1Il-Dd70A7m5MnTptMHuWS1-50JcCegz_KwGfSwBKKLmw/s1600/mIMG_5775.jpg" imageanchor="1" style=""><img border="0" height="240" width="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8bPcBCWqb9f_yni5peo1VL5C58wx8fbacXIzJol69McW9P1nhnb7n4FXFTf8Na9T4Uj5AzAvy4DiqDYwuMOT71w_ocWvj1f1Il-Dd70A7m5MnTptMHuWS1-50JcCegz_KwGfSwBKKLmw/s320/mIMG_5775.jpg" /></a></td></tr></tbody></table>ormzhttp://www.blogger.com/profile/07479609238793090117noreply@blogger.com0tag:blogger.com,1999:blog-6764109675540726788.post-66431581170577018842010-11-28T06:56:00.000-08:002010-11-30T13:45:20.402-08:00gst dsp/omapfb on zoom2While waiting for the new board to arrive, I started to setup the gst-dsp + omapfb environment for what I currently have available: a zoom2.<br />
<br />
After few tips from Axel Castaneda (for fb and v4l2 options) and much of googling, I got the board to show the video on the display using gst dsp/omapfb plugins.<br />
<br />
As of today, you can easily use any kernel above 2.6.37-rc2, since it has a usable tidspbridge driver.<br />
<br />
Here it's what I did (BTW, you can find a <a href=http://gitorious.org/tidspbridge/kernel>tidspbridge kernel in gitorious</a> and ignore fetch & merge steps):<br />
<br />
Clone/fetch latest linux-2.6 from git.kernel.org, took linux-2.6 2.6.37-rc3:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
cd linux-2.6
git checkout -b tidspbridge-2.6.37-rc3 v2.6.37-rc3
</pre>Then merge the patches providing display support for zoom2/3 boards from Tomi's DSS2 repo, the easiest thing to do is pulling his entire devel branch.<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">git pull git://gitorious.org/linux-omap-dss2/linux.git devel
</pre>And last, pick a patch to solve a gpio reset problem on zoom2 (zoom3 works fine without this last step).<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">wget http://patchwork.kernel.org/patch/351421/mbox/ -O display.patch
git am display.patch
</pre>Config for omap2+, and in menuconfig select:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">CONFIG_TIDSPBRIDGE=m
CONFIG_OMAP2_DSS=y
CONFIG_OMAP2_VRAM_SIZE=4
CONFIG_FB_OMAP2=y
CONFIG_PANEL_NEC_NL8048HL11_01B=y
</pre>Build the uImage and copy to the filesystem:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">arch/arm/plat-omap/mailbox.ko
arch/arm/mach-omap2/mailbox_mach.ko
drivers/staging/tidspbridge/bridgedriver.ko
</pre>Alternatively, you can use modules_install after compiling kernel and modules.<br />
<br />
Now, assuming you have a filesystem + gstreamer environment (or you can take my <a href="https://sites.google.com/site/orrmz1/arm-rootfs.tar.bz2?attredirects=0">rootfs</a>, which has a uImage + dsp needed modules/binaries, be sure to read and agree to the license under /lib/dsp, just in case).<br />
<br />
Boot the uImage and insmod/modprobe the modules.<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">insmod /dspbridge/mailbox.ko
insmod /dspbridge/mailbox_mach.ko
insmod /dspbridge/bridgedriver.ko base_img=/lib/dsp/baseimage.dof
</pre>Generate a test video to play with:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">gst-launch videotestsrc num-buffers=200 ! video/x-raw-yuv, framerate=30/1, width=320, height=240 ! dspmp4venc ! avimux ! filesink location=my_avi.avi
</pre>If you noticed, the video generated is encoded using the dsp.<br />
<br />
Then send the video to the framebuffer, with:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; padding: 5px; white-space: pre-wrap; word-wrap: break-word;">gst-launch filesrc location=my_avi.avi ! avidemux ! dspvdec ! omapfbsink
</pre>And that's it.ormzhttp://www.blogger.com/profile/07479609238793090117noreply@blogger.com0tag:blogger.com,1999:blog-6764109675540726788.post-15392144112448345662010-11-22T13:56:00.000-08:002010-11-25T15:48:12.576-08:00a beagle-xm storyFinally, I have ordered my <a href="http://beagleboard.org/buy">beagle xm</a>. A week ago, and initially for shipment on Nov 18th, was rescheduled to be sent on Nov 25th, so now I have to wait a bit more time to get my hands on it. BTW, it seems there was a price drop just today, so I may have got ripped off with 30 bucks :(, lets see.<br />
<br />
Although buying a <a href="http://pandaboard.org/">panda board</a> was tempting at first, I decided to take xm for a ride instead, and maybe later have the switch to the OMAP4 chip.<br />
<br />
UPDATE: I received a mail saying that my XM was being shipped, after a quick reply to it, I received a response from <a href="http://www.digikey.com/">Digi-key</a>, they agreed to refund the difference on the price drop, thanks Digi-key! Probably I'll spend the extra buck getting a camera module or it will go to the piggy bank for a panda.ormzhttp://www.blogger.com/profile/07479609238793090117noreply@blogger.com0