Archive Page 7

Some videos

Here are some videos I published on YouTube in the past few months.
» …continue reading ‘Some videos’

In this howto I describe how to add a generic kernel mode SPI driver to the BeagleBone kernel source. Of course the methods are nearly the same for different target platforms. I won’t go into the details of writing a kernel mode SPI driver for now.
» …continue reading ‘BeagleBone SPI driver’

You’ll need the cross-compiled version of libiconv, libgettext, glib, and slang.

Compiling libiconv

1
2
3
#!/bin/bash
CC=arm-linux-gcc ./configure --host=arm-linux-gnu --prefix=/usr --enable-static
make install DESTDIR=/home/nonoo/common-libs-compiled/arm/libiconv

Compiling libgettext

1
2
3
#!/bin/bash
CC=arm-linux-gcc ./configure --host=arm-linux-gnu --prefix=/usr --disable-csharp --disable-java --disable-openmp --disable-c++ --disable-native-java --enable-static --with-libiconv-prefix=/home/nonoo/common-libs-compiled/arm/libiconv/usr
make install DESTDIR=/home/nonoo/common-libs-compiled/arm/libgettext

Compiling libffi (needed by glib)

1
2
3
#!/bin/bash
CC=arm-linux-gcc ./configure --host=arm-linux-gnu --prefix=/usr
make install DESTDIR=/home/nonoo/common-libs-compiled/arm/libffi

Compiling glib

1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash
echo "glib_cv_stack_grows=no" >config.cache
echo "glib_cv_uscore=no" >>config.cache
echo "ac_cv_func_posix_getpwuid_r=yes" >>config.cache
echo "ac_cv_func_posix_getgrgid_r=yes" >>config.cache
CPPFLAGS="-I/home/nonoo/common-libs-compiled/arm/libffi/usr/lib/libffi-3.0.11/include -I/home/nonoo/common-libs-compiled/arm/libgettext/usr/include" \
LDFLAGS="-L/home/nonoo/common-libs-compiled/arm/libiconv/usr/lib -L/home/nonoo/common-libs-compiled/arm/libgettext/usr/lib" \
LIBFFI_CFLAGS="-I/home/nonoo/common-libs-compiled/arm/libffi/usr/lib/libffi-3.0.11/include" \
LIBFFI_LIBS="-L/home/nonoo/common-libs-compiled/arm/libffi/usr/lib -lffi" \
CC=arm-linux-gcc ./configure --host=arm-linux-gnu --prefix=/usr -C --enable-static
make install DESTDIR=/home/nonoo/common-libs-compiled/arm/glib

Compiling slang

1
2
3
#!/bin/bash
CC=arm-linux-gcc ./configure --host=arm-linux-gnu --prefix=/usr
make install DESTDIR=/home/nonoo/common-libs-compiled/arm/slang

Compiling mc

1
2
3
4
5
6
7
#!/bin/bash
CPPFLAGS="-I/home/nonoo/common-libs-compiled/arm/libiconv/usr/include -I/home/nonoo/common-libs-compiled/arm/libgettext/usr/include -I/home/nonoo/common-libs-compiled/arm/glib/usr/include/glib-2.0 -I/home/nonoo/common-libs-compiled/arm/glib/usr/lib/glib-2.0/include" \
LDFLAGS="-L/home/nonoo/common-libs-compiled/arm/libiconv/usr/lib -L/home/nonoo/common-libs-compiled/arm/libgettext/usr/lib -L/home/nonoo/common-libs-compiled/arm/glib/usr/lib -lintl -lglib-2.0" \
PKG_CONFIG_PATH=/home/nonoo/common-libs-compiled/arm/glib/usr/lib/pkgconfig \
GLIB_LIBDIR=/home/nonoo/common-libs-compiled/arm/glib/usr/lib \
CC=arm-linux-gcc ./configure --host=arm-linux-gnu --prefix=/usr --with-slang-includes=/home/nonoo/common-libs-compiled/arm/slang/usr/include --with-slang-libs=/home/nonoo/common-libs-compiled/arm/slang/usr/lib
make install DESTDIR=/home/nonoo/common-libs-compiled/arm/mc

You will find the compiled mc in /home/nonoo/common-libs-compiled/arm/mc.


Archived version of this post

Here’s how to cross-compile mc for the BeagleBone. This tutorial is suitable for other target platforms as well, you just have to use a different cross-compiler.

glib

To cross-compile compile Midnight Commander, you’ll have to compile glib first, otherwise mc will start with this error:

1
mc: error while loading shared libraries: libgmodule-2.0.so.0: cannot open shared object file: No such file or directory

libffi

For glib, you’ll need libffi from here. Extract it and compile:

1
2
3
CC=arm-arago-linux-gnueabi-gcc ./configure --host=arm --prefix=~/libffi
make
make install

glib again

Download and extract the glib source, and compile it:

1
PKG_CONFIG_PATH=~/libffi/lib/pkgconfig CC=arm-arago-linux-gnueabi-gcc ./configure --host=arm --prefix=~/glib -C

This of course throws an error:

1
configure: error: cannot run test program while cross compiling

To fix this, I opened the configure script and searched for the cache variable names of the failed tests. More info about them here. Finally I added these to the config.cache file:

1
2
3
4
glib_cv_stack_grows=no
glib_cv_uscore=yes
ac_cv_func_posix_getpwuid_r=yes
ac_cv_func_posix_getgrgid_r=yes

After this, configure ran without errors. I compiled glib then with make and make install.

slang

mc needs slang, so download it’s source and compile it:

1
2
3
CC=arm-arago-linux-gnueabi-gcc ./configure --host=arm --prefix=~/slang
make
make install

mc

Download and compile mc:

1
2
3
PKG_CONFIG_PATH=~/glib/lib/pkgconfig GLIB_LIBDIR=~/glib/lib CC=arm-arago-linux-gnueabi-gcc ./configure --host=arm --prefix=~/mc --with-slang-includes=~/slang/include --with-slang-libs=~/slang/lib --with-glib-static
make
make install

There were some errors, so I inserted this to the beginning of the configure script:

1
fu_cv_sys_stat_statfs2_bsize=yes

I had to remove the # from the beginning of the following line in src/Makefile:

1
am__append_4 = -DSAVERDIR=""$(pkglibexecdir)""

After this configure ran without errors and I could proceed with compiling. I then copied the whole ~/mc dir to the /usr folder of the SD card’s rootfs.

Fine tuning

To avoid the Unable to load ‘default’ skin error, I added this line to the end of /etc/profile:

1
MC_SKIN=/usr/share/mc/skins/default.ini

The BeagleBone is a low-power open source hardware single-board computer designed with open source software development in mind, and as a way of demonstrating the Texas Instrument’s OMAP3530 system-on-a-chip.


» …continue reading ‘Dealing with the BeagleBone’

Running with the dog

Renewed PSU

Finally I’ve finished my old PSU’s renewal. I added overvoltage protection and a slim fan which is switched on by bimetal thermostats on the heatsinks when the temperature reaches 45°C. I bought both the slim fan and the thermostats on eBay. The overvoltage protection is a very simple circuit: when the voltage is above a preset threshold (determined by the voltage divider on the left), the tiristor opens and burns out the fuse.

ha5kdr.hu

I’ve finished the shiny new webpage of our radio club: www.ha5kdr.hu

Last weekend we installed Ubiquity AirGrid M5s to the Gerecse tower and my QTH in Tata to create a 5Ghz Wifi link between them. It was quite difficult to put the stuff up on the tower because the wind was blowing crazy. Link works reliably and fast, the average is around 120MBps, I can copy between the two networks with 2.1 megabytes/s. Interestingly, when it’s raining, the link and signal quality drops as you can see on the graphs below.


(The collinear Diamond X510 antenna above the AirGrid is under repair, that’s why the ground planes are missing.)

Nagoya BA-6200

I bought this antenna on eBay about a week ago and installed it on the mast on the roof at my girlfriend’s place. Price and quality is quite good, looks like the exact Chinese copy of the Diamond X200, but I had to use some silicon paste on the connections to ensure no water could get in.

About me

Nonoo
I'm Nonoo. This is my blog about music, sounds, filmmaking, amateur radio, computers, programming, electronics and other things I'm obsessed with. ... »

Twitter

Listening now

My favorite artists