Labels

Showing posts with label Gumstix. Show all posts
Showing posts with label Gumstix. Show all posts

20/04/2012

Black screen after running an application

I put my application in /etc/rc5.d/S99rmnologin to let it automatically start.
The application is running well. But the screen turns black after 1 minute. When I touched the screen, a small area, where my finger pointed, of my application GUI show up. My application GUI gradually appears if I continuously moving my finger on the screen. It looks like using a mop to wipe the screen.

Solution:

Take a look in /etc/rcS.d/S01psplash file. At the end of line, there is a "sleep 120 ..." command which caused the problem. After comment out this line, everything goes fine.

# Timetrap against hanging with splash hiding console messages.
(sleep 120; psplash-write "QUIT") &

13/04/2012

Change Gumstix Overo Booting Screen (Logo image)


By default, overo boots up with its own image with progress bar. I want to display my own picture when it boots up.

I follow the below website, but it is for Angstrom. I did some modification to suit my overo COM.

https://support.bluetechnix.at/wiki/Changing_the_splash_screen_picture

1) bitbake psplash

$ cd /build/czhang/overo-oe
$ source build/profile
$ bitbake psplash
...

2) copy make-image-header.sh file to proper place.

$ cp /build/czhang/overo-oe/tmp/work/armv7a-angstrom-linux-gnueabi/psplash-angstrom-0.0+svnr422-r33/psplash/make-image-header.sh /build/czhang/overo-oe/org.openembedded.dev/recipes/psplash/files/overo

3) create your own image file, make sure it is in right dimensions.

$ cd /build/czhang/overo-oe/org.openembedded.dev/recipes/psplash/files/overo
$ ./make-image-header.sh [your-image].png HAND

    back up original image head file:
$ mv psplash-hand-img.h psplash-hand-img.h_orig
$ mv [your-imge]-img.h psplash-hand-img.h
$ cd /build/czhang/overo-oe
$ source build/profile
$ bitbake psplash

Error occurred:

| psplash.c: In function 'main':
| psplash.c:271: error: 'POKY_IMG_WIDTH' undeclared (first use in this function)
| psplash.c:271: error: (Each undeclared identifier is reported only once
| psplash.c:271: error: for each function it appears in.)
| psplash.c:272: error: 'POKY_IMG_HEIGHT' undeclared (first use in this function)
| psplash.c:275: error: 'POKY_IMG_BYTES_PER_PIXEL' undeclared (first use in this function)
| psplash.c:276: error: 'POKY_IMG_RLE_PIXEL_DATA' undeclared (first use in this function)
| make[1]: *** [psplash.o] Error 1
| make[1]: *** Waiting for unfinished jobs....
| mv -f .deps/psplash-write.Tpo .deps/psplash-write.Po
| mv -f .deps/psplash-console.Tpo .deps/psplash-console.Po
| mv -f .deps/psplash-fb.Tpo .deps/psplash-fb.Po
| make[1]: Leaving directory `/build/czhang/overo-oe/tmp/work/armv7a-angstrom-linux-gnueabi/psplash-0.0+svnr422-r33/psplash'
| make: *** [all] Error 2
| FATAL: oe_runmake failed

it took me a long time to figure it out. In

/build/czhang/overo-oe/tmp/work/armv7a-angstrom-linux-gnueabi/psplash-0.0+svnr422-r33/psplash

there are three files:
psplash-hand-img.h
psplash-poky-img.h
psplash-bar-img.h

take a look psplash-poky-img.h content where the error occurred:
$ less psplash-poky-img.h

/* GdkPixbuf RGB C-Source image dump 1-byte-run-length-encoded */

#define HAND_IMG_ROWSTRIDE (816)
#define HAND_IMG_WIDTH (272)
#define HAND_IMG_HEIGHT (363)
#define HAND_IMG_BYTES_PER_PIXEL (3) /* 3:RGB, 4:RGBA */
#define HAND_IMG_RLE_PIXEL_DATA ((uint8*) \

After I replaced the HAND with POKY, and bitbake again, error disappeared.

4) bitbake console image

$ bitbake omap3-console-image

5) remember to install psplash_0.0+svnr422-r33.6_armv7a.ipk (maybe psplash-support_0.0+svnr422-r33.6_armv7a.ipk too), this is a software which can load booting image.

Done! you will see the pretty image in the booting procedure.

Modify booting scrip for Gumstix Overo Tide COM

The Tide COM has no NAND built in. When I try to change environment parameter, such as rotate screen or change default display, it just won't work.

The solution is to create a boot command file, e.g. ubootenvcmd, and add it into a boot.scr.

Here is how I do it:

1) create a ubootenvcmd file by using gedit. The content is something like:

setenv ethaddr 00:00:00:FF:FF:FF
setenv mpurate 720
setenv vram 4M
setenv linuxmem 176M
setenv defaultdisplay lcd43
setenv dvimode 480x272MR-16@60
setenv mmcargs ${mmcargs} omapfb.rotate=1
setenv bootcmd 'mmc init; run loaduimage; run mmcboot'
boot

2) install mkimage:
$ sudo apt-get install uboot-mkimage

3) create boot.scr file:
$ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Overo boot script" -d ubootenvcmd boot.scr

ps. remember to put the ubootenvcmd file in current directory.

4) copy boot.scr to your FAT partition of your SD card.

Done :)

07/12/2011

Rotate Gumstix Overo Touch screen

Go to u-boot environment settings,

Overo # setenv mmcargs setenv bootargs console=${console} mpurate=${mpurate} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay}  omabfp.rotate=1 root=${mmcroot} rootfstype=${mmcrootfstype}

Overo # saveenv
Overo # reset

ps: 1 --- 90°     2 --- 180°     3 --- 270°

------------------------------
Several month later when I tried to rotate my another gumstix fire + LG4.3" screen, it doesn't work!

finally, I found at this time, the default dvimode was 1024x768. I have to change it back to 4.3" screen resolution, which is 480x272.


#dvimode=480x272MR-16@60

12/10/2011

Load Gumstix Libraries


1) Install rsync pakage:
$ scp /build/czhang/overo-oe/tmp/deploy/glibc/ipk/armv7a/rsync_3.0.6-r0.6_armv7a.ipk root@10.0.0.146://home/root/

$ opkg install rsync_3.0.6-r0.6_armv7a.ipk

2) Install Qt lib:
$ rsync -av czhang@10.0.1.202://build/czhang/qt-everywhere-opensource-src-4.7.0/lib/* /usr/lib

3) Install serial port lib:
$ rsync -av czhang@10.0.1.202://build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qextserialport/build/libqextserialport* /usr/lib

4) Install qwt lib:
$ rsync -av czhang@10.0.1.202:///build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qwt-5.2.1/lib/* /usr/lib

4) Install sqlit3 lib:
$ scp czhang@x.x.x.x:/build/czhang/qt-everywhere-opensource-src-4.7.0/plugins/sqldrivers/libqsqlite.so /home/m4/sqldrivers

5) Install qzip lib:
$ rsync -av czhang@10.0.1.202://build/czhang/qt-everywhere-opensource-src-4.7.0/projects/quazip-0.3/quazip/libquazip.so* /usr/lib

6) Install Analogwidget lib:
$ scp /build/czhang/qt-everywhere-opensource-src-4.7.0/projects/AnalogWidgets/analogwidgets/libanalogwidgets_plugin.so root@10.0.0.146://usr/lib

 

25/08/2011

Gumstix touch screen problem


I re-installed file system (2Gb SD card) for my Overo gumstix. After i booted from SD, I found the touch screen did not work. So, I had a look in /dev/input directory. I can only see 'mice' in this folder, no 'touchscreen0'.

Then I tried different way to solve the problem. I tried:
$ nand erase 240000 20000
$ reset

When I booted gumstix, the back light of screen turned on, but nothing displays on the screen.  I can see 'touchscreen0' in /dev/input.  I tried '/usr/bin/ts_test'. This command can detect the position when i touched screen, but just no display.

I thought my screen was faulty.

After that, I took a look the u-boot environment:

# printenv
dvimode=1024x768MR-16@60
defaultdisplay=dvi

DVI? The touch screen I am using is LCD!

Ok, changed it to:
# setenv defaultdisplay lcd43
# saveenv
# boot

Haha, screen is working.

08/08/2011

Install AnalogWidget in Ubuntu / Gumstix

Install in Ubuntu:

System spec:

Ubuntu 10.04 (lucid)
2.30.2 (Ubuntu 2010-06-25)
2.6.32-33-generic (#70-Ubuntu SMP Thu Jul 7 21:13:52 UTC 2011)
4.4.3 (x86_64-linux-gnu)
AnalogWidgets_234.zip

Download from here:
http://qt-apps.org/content/show.php?content=87780&forumpage=0

unzip it.

$ cd /home/czhang/Downloads/AnalogWidgets
$ qmake AnalogWidgets.pro
$ make
$ sudo make install
$ cp  /home/czhang/Downloads/AnalogWidgets/analogwidgets/libanalogwidgets_plugin.so /home/czhang/QtSDK/QtCreator/lib/qtcreator/plugins/designer/libanalogwidgets_plugin.so

In .pro file, added:
LIBS += /home/czhang/Downloads/AnalogWidgets/analogwidgets/libanalogwidgets_plugin.so
INCLUDEPATH += /home/czhang/Downloads/AnalogWidgets/analogwidgets/analogwidgets


Install in Gumstix:

unzip Analogwidget.zip under:
/build/czhang/qt-everywhere-opensource-src-4.7.0/projects

$ qmake AnalogWidgets.pro
$ make

got some error messages according to file:
/build/czhang/AnalogWidgets/analogwidgets/code/chart/channel.cpp
/build/czhang/AnalogWidgets/analogwidgets/code/scriptwidget.cpp

I edited these two files:
in channel.cpp
void Channel::setType(unsigned int i)
{
//if (i!=Line && i!=Dots)
// throw "Bledny typ";

m_type = i;

}

in scriptwidget.cpp:
void ScriptWidget::setScript(const QString & s)
{
m_script = s;
qDebug("ScriptWidget::setScript() %s",qPrintable(m_script));
try
{
QFile file(m_script);
if (file.open( QIODevice::ReadOnly ))
{
QString src = QString(file.readAll());
QScriptValue widget = m_engine->newQObject(this);
m_engine->globalObject().setProperty(objectName(),widget);
m_engine->evaluate(src);
QScriptValue v = m_engine->uncaughtException();

if (v.isValid())
qDebug("Error %s",qPrintable(v.toString()));
}
}
//catch (std::exception & e)
//{
// qDebug("Wyjatek %s",e.what());
//}
}// setScript


$ scp /build/czhang/qt-everywhere-opensource-src-4.7.0/projects/AnalogWidgets/analogwidgets/libanalogwidgets_plugin.so root@10.0.0.146://usr/lib

31/05/2011

Disable gumstix overo console login message on ttyS2

In my design, I need to use second serial port (ttyS2) on overo.
I connected SDA3 (pin 24 on chestnut43 board) to WinXP hyperterminal, and booted up Overo.
I saw all booting messages are showing in hyperterminal.

----------------------------------------------------------- 
Login timed out after 60 seconds.                                               
                                                                                
.-------.                                                                       
|       |                  .-.                                                   
|   |   |-----.-----.-----.| |   .----..-----.-----.                             
|       |     | __  |  ---'| '--.|  .-'|     |     |                             
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |                             
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'                             
                -'  |                                                           
                '---'                                                           
                                                                                
The Angstrom Distribution overo ttyS2                                           
                                                                                
Angstrom 2010.7-test-20101005 overo ttyS2                                       
                                                                                
overo login: root                                                               
 |  '  | | | |                                                                   
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'                             
                -'  |                                                           
                '---'                                                           
                                                                                
The Angstrom Distribution overo ttyS2                                           
                                                                                
Angstrom 2010.7-test-20101005 overo ttyS2                                       
... 
... 

-------------------------------------------------------------------- 

Then, I run my program (written by Qt), the hyperterminal shows as follow: 

-------------------------------------------------------------------------- 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
QIODevice::read: Called with maxSize < 0 
... 
... 
------------------------------------------------------------------------- 

in the meantime, the string which sent from Qt program also shows in the screen. 
I only want ttyS2 send the information from my program, not other messages.

With help from Nabble forum, the following is my solution:

Those messages are from the kernel.  U need to change the "console" uboot environment variable, otherwise the kernel will print messages on that serial port.

Take a look at uboot environment variable. to do this ,  boot gumsix, pushed any key to stop it booting from MMC. Then use "printenv" list all u-boot variables. 
------------------------------------------ 
Overo # printenv 
bootcmd=if mmc init; then if run loadbootscript; then run bootscript; else if run loaduimagei 
baudrate=115200 
loadaddr=0x82000000 
console=ttyS2,115200n8 
vram=12M 
dvimode=1024x768MR-16@60 
nandargs=setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.d2 
loadbootscript=fatload mmc 0 ${loadaddr} boot.scr 
bootscript=echo Running bootscript from mmc ...; source ${loadaddr} 
loaduimage=fatload mmc 0 ${loadaddr} uImage 
mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr} 
nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr} 280000 400000; boot} 
dieid#=0ef000040000000004035c140d002011 
ethact=smc911x-0 
bootdelay=2 
defaultdisplay=lcd43 
i2cspeed=3,100 
bootargs=console=ttyS2,115200n8 i2c_bus=${i2cspeed} vram=12M omapfb.mode=dvi:1024x768MR-16@6t 
mmcargs=setenv bootargs console=${console} i2c_bus=${i2cspeed} vram=12M omapfb.mode=dvi:1024t 
stdin=serial 
stdout=serial 
stderr=serial 

Environment size: 1279/131068 bytes 
--------------------------------------------- 

the "console=ttyS2,115200n8" means send console login messages to ttyS2.

After that, take a look at /etc/inittab in mmc system on 2G SD card.
-------------------------------------------------
# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:5:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin
S:2345:respawn:/sbin/getty 115200 ttyS2
# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
#  :::
#

1:2345:respawn:/sbin/getty 38400 tty1
-------------------------------------------------------

The last line sets up a login on tty1.  If you have a keyboard (eg. USB keyboard via a powered HUB)  and display connected, then you'd be able to login using those.  I am using a chestnut43 board with LCD, and i can use tty1 on a couple of occasions when I messed up the networking.

the command to change console environment variable are follows:

# setenv console tty1 
# saveenv 
The console setting is passed to the kernel at boot time.  It Only tells the kernel where to send messages;  It does not have anything to do with login terminals as that is handled by inittab and getty.  I can use tty1 because it allows me to see the kernel messages on the LCD during boot. 

25/03/2011

Linux library link configuration (libquazip.so)

In Linux system, understanding of how system or application library works is very important. Many applications you download are source files which need to be compiled. for example: qmake, make, make install.
After "make" the source file (typically lib), the lib files will be created, such as:

ln -s libquazip.so.1.0.0 libquazip.so
ln -s libquazip.so.1.0.0 libquazip.so.1
ln -s libquazip.so.1.0.0 libquazip.so.1.0

but these lib file are not installed in Linux system.
After "make install", all lib files has been installed in Linux system.

ln -f -s "libquazip.so.1.0.0" "/usr/local/lib/libquazip.so"
ln -f -s "libquazip.so.1.0.0" "/usr/local/lib/libquazip.so.1"
ln -f -s "libquazip.so.1.0.0" "/usr/local/lib/libquazip.so.1.0"


However, even you "make install" lib files, you may still get error message when you run Qt application. for example, I "make install" QuaZIP package, and successfully compile a test.pro which come with this package, but i still got error message when i run the program:

Starting /home/czhang/quazip-0.3/test/zip-build-desktop/zip...
/home/czhang/quazip-0.3/test/zip-build-desktop/zip: error while loading shared libraries: libquazip.so.1: cannot open shared object file: No such file or directory
/home/czhang/quazip-0.3/test/zip-build-desktop/zip exited with code 127


Why?!! I have been struggling on this problem for long time.

Here is what i understand and solve the problem.

First of all, take a look at "ldconfig" - configure dynamic linker run-time bindings
$ man ldconfig
All applications, if they need lib to run, will check from here first /etc/ld.so.conf
take a look ld.so.conf:
$ cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf


It re-direct to /etc/ld.so.conf.d  and all .conf file will be checked through.
Let's take a look at ld.so.conf.d folder
$ ls /etc/ld.so.conf.d

GL.conf            libasound2.conf   x86_64-linux-gnu.conf
lib32asound2.conf  libc.conf        Qtlib.conf


in here, we can see a Qtlib.conf file. If you take a look at it, you will see all Qt lib is setting in
/home/czhang/qtsdk-2010.04/lib

When I "make install" QuaZip package, I got message like:

ln -f -s "libquazip.so.1.0.0" "/usr/local/lib/libquazip.so"
ln -f -s "libquazip.so.1.0.0" "/usr/local/lib/libquazip.so.1"
ln -f -s "libquazip.so.1.0.0" "/usr/local/lib/libquazip.so.1.0"


This means all QuaZip libs are stored in /usr/local/lib/

So, I create a new .conf file which call qauzip.conf
$ gedit qauzip.conf
add "/usr/local/lib" in it.

From now on, when Qt tries to use QuaZip lib, it can be found.

Re-compile my "test.pro", and run it, works! :)

Happy end.

EDIT:
or, just simply
$ sudo cp -a /home/czhang/quazip-0.3/quazip libquazip* /usr/lib64
=================================================
EDIT:

when i compile my own program which including QuaZip, i got error messages:

error: undefined reference to `QuaZip::QuaZip(QString const&)'
error: undefined reference to `QuaZip::open(QuaZip::Mode, zlib_filefunc_def_s*)'
...

Then I took a look .pro file,

INCLUDEPATH += /home/czhang/quazip-0.3/quazip
LIBS += -L -lquazip

Actually, I don't really understand the -L. After doing some studies, i learned:

INCLUDEPATH:
This variable specifies the #include (normally header file) directories which should be searched when compiling the project.

LIBS:
This variable contains a list of libraries to be linked into the project. You can use the Unix -l (library) and -L (library path) flags and qmake will do the correct thing with these libraries on Windows (namely this means passing the full path of the library to the linker). The only limitation to this is the library must exist, for qmake to find which directory a -l lib lives in.

Therefore, my .pro file should be like:


INCLUDEPATH += /home/czhang/quazip-0.3/quazip
LIBS += -L/home/czhang/quazip-0.3/quazip -lquazip
Or:
INCLUDEPATH += /home/czhang/quazip-0.3/quazip
LIBS += -lquazip


$ rsync -av czhang@10.0.1.202://build/czhang/qt-everywhere-op
ensource-src-4.7.0/projects/quazip-0.3/quazip/libquazip.so* /usr/lib

23/02/2011

Install sqlite3 library in Gumstix for Qt application

My Qt program will create a database by using sqlite3 plugin app.
The program is working happily in ubuntu, meanwhile, i can use command line to do all sqlite3 command in gumstix. but i got error message when i run it in gumstix.

the error message shows on my touch screen as:

"Unable to open database, An error occurred while opening the connection."

take a look my program:


// create new database
QDate sDate = QDate::currentDate();
QString dbName;
dbName = QString(QApplication::applicationDirPath()).append("/database/I-" + sDate.toString("MMyyyy") + ".db");
mydb = QSqlDatabase::addDatabase("QSQLITE");
mydb.setDatabaseName(dbName);

if (!QFile::exists(dbName))
{
mydb.open();
QSqlQuery query;
query.exec("create table c1Params (ID int primary key unique, "
"Time QString, Status int, Spare QByteArray)");

mydb.close();
}

if (!mydb.open())
{
QMessageBox::warning(this, tr("Unable to open database"), tr("An error occurred while "
"opening the connection: ") + m4db.lastError().text());
return;
}

This indicate that 'mydb' has not been able to created.
The following message is shown in on gumstix prompt.

root@overo:~# ./mypro -qws
Trying to open File
Opened File succesfully
QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
Segmentation fault
root@overo:~#

used 'strace' command to track the error message, and compare stack content between ubuntu and gumstix.

in my ubuntu:
$ strace -o /home/czhang/Desktop/test  ./mypro

.
..
stat("/etc/xdg/Trolltech.conf", 0x7fff4c33bec0) = -1 ENOENT (No such file or directory)
stat("/etc/xdg/Trolltech.conf", 0xec71c8) = -1 ENOENT (No such file or directory)
stat("/usr/lib/kde4/plugins/sqldrivers/.", 0xec7348) = -1 ENOENT (No such file or directory)
lstat("/usr/lib/kde4/plugins/sqldrivers/.", 0x7fff4c33c2a0) = -1 ENOENT (No such file or directory)
stat("/usr/lib/qt4/plugins/sqldrivers/.", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib/qt4/plugins/sqldrivers", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 22
statfs("/usr/lib/qt4/plugins/sqldrivers", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=9612197, f_bfree=7908029, f_bavail=7419748, f_files=2444624, f_ffree=2135156, f_fsid={490287925, 258803822}, f_namelen=255, f_frsize=4096}) = 0
getdents(22, /* 4 entries */, 32768)    = 128
stat("/usr/lib/qt4/plugins/sqldrivers/libqsqlmysql.so", {st_mode=S_IFREG|0644, st_size=73432, ...}) = 0
..
.
 
in gumstix:
$ strace -o /home/root/test  ./mypro

.
..
stat64("/etc/xdg/Trolltech.conf", 0xbe916208) = -1 ENOENT (No such file or directory)
stat64("/etc/xdg/Trolltech.conf", 0x205ad0) = -1 ENOENT (No such file or directory)
stat64("/home/root/sqldrivers/.", 0x1ef1b8) = -1 ENOENT (No such file or directory)
lstat64("/home/root/sqldrivers/.", 0xbe916400) = -1 ENOENT (No such file or directory)
write(2, "QSqlDatabase: QSQLITE driver not"..., 40) = 40
write(2, "QSqlDatabase: available drivers:"..., 34) = 34
..
.

here is the problem. the Qt in gumstix can not locate the sqlite library interface at directory /home/root/sqldrivers.

"The Qt plugins should be deployed in one of the locations that Qt looks when it needs a plugin: look for Deploying Plugins in Assistant. In the case of the Qsqlite driver you could deploy it in a sub directory "sqldrivers" of the directory containing the program executable or in a plugins/sqldrivers directory of central Qt installation. Similar locations exist for other plugin types."

ok, create a dirctory in gumstix
$ mkdir /home/root/sqldrivers
$ scp czhang@x.x.x.x:/build/czhang/qt-everywhere-opensource-src-4.7.0/plugins/sqldrivers/libqsqlite.so .

Done!



09/12/2010

Battery Backup For on Board Overo Board RTC (twl4030)

I have been googled a lot for the external rtc project. Almost people are discussing about how to make the external rtc working. Seldom to see people mention about the on board rtc usage.

Have a look on gumstix website:
http://www.gumstix.net/Hardware/view/I/O-connectors-cabling/Gumstix-Overo-I/O-overview/112.html
7) The Overo series does not support battery charging.

the battery charging was disabled for safety concern.

However, take a look at this new implementation, line 470:

http://www.sakoman.com/cgi-bin/gitweb.cgi?p=linux-omap-2.6.git;a=blob;f=drivers/rtc/rtc-twl4030.c;h=72f7863376c8eb61ffbe3c5e51bc0e525744aa09;hb=83d22678ac1d8126b41f6880f57e2421d0c11391

470         /* enable backup battery charging */
471         /* use a conservative 25uA @ 3.1V */
472         ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
473                 BIT_PM_RECEIVER_BB_CFG_BBCHEN |
474                 BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 |
475                 BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA,
476                 REG_BB_CFG)


Measure the voltage at pin12 (Vbackup) while the gumstix is on. There is 3.13V on it.

It seems like the battery backup charging truly has been enabled!

try it anyway...

bought a coin cell battery, connect to Vbackup and Gnd,

root@overo:~# hwclock
Thu Oct  7 06:39:02 2010  0.000000 seconds
root@overo:~# date
Thu Oct  7 06:39:17 UTC 2010
root@overo:~# date 12090857
Thu Dec  9 08:57:00 UTC 2010
root@overo:~# hwclock -w
root@overo:~# hwclock
Thu Dec  9 08:57:14 2010  0.000000 seconds

turn off gumstix, wait for10 minutes, start gumstix,

during the boot process:
fbcvt: 1024x768@60: CVT Name - .786M3-R
Console: switching to colour frame buffer device 60x34
regulator_init_complete: incomplete constraints, leaving VDAC on
twl_rtc twl_rtc: setting system clock to 2010-12-09 09:09:40 UTC (1291885780)
Waiting for root device /dev/mmcblk0p2...
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SD card at address b368
mmcblk0: mmc0:b368 UD    1.90 GiB


root@overo:~# date
Thu Dec  9 09:10:25 UTC 2010
root@overo:~# hwclock
Thu Dec  9 09:10:38 2010  0.000000 seconds

Hmm, how convenient! Great, throw my external rtc away ~



Lithium Vanadium Pentoxide battery, Farnell-1514218

08/11/2010

Add RTC DS1037 in to gumstix Kernel

Need to add an external real time clock chip on Gumstix to make the time correct.

Overo (I am using Air) has two i2c devices. First all of, add i2c driver in kernel.

Note:
Every time when I try to modify kernel, I need to re-source the kernel profile by using:
overo-oe$ source build/profile

overo-oe$ bitbake -c  menuconfig virtual/kernel


----------------------------------------------------------------------------------------------------

PS: the virtual/kernel means the default build kernel in overo directory. or, I still can use:
overo-oe$ bitbake -c menuconfig overo-omap3


take a look at:
/build/czhang/overo-oe/org.openembedded.dev/conf/machine/overo.conf

-----------------------------------------------------------------------------------------------------


in 'device drivers' --- 'real time clock'
add 'y' in front of 'Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025'

ps: y: build into kernel
     m: add a module


save it.


$ cd /build/czhang/overo-oe/org.openembedded.dev/recipes/linux/linux-omap3-2.6.34/overo
$ cp deconfig deconfig.old
$ cp /build/czhang/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.34-r90/git/.config /build/czhang/overo-oe/org.openembedded.dev/recipes/linux/linux-omap3-2.6.34/overo/deconfig


take a look at the "deconfig"
#
# I2C Hardware Bus support
#

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_DESIGNWARE is not set
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set
CONFIG_I2C_OMAP=y

#
# I2C RTC drivers
#
CONFIG_RTC_DRV_DS1307=y
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set




rebuild kernel:
overo-oe$ bitbake -c clean virtual/kernel
overo-oe$ bitbake virtual/kernel


New kernel image is in /build/czhang/overo-oe/tmp/deploy/glibc/images/overo
copy new kernel (uImage) to SD card FAT partition.
start Gumstix, I can see i2c-1 and i2c-3 in /dev.


I2C-1 is the power chip. If you want to alter power settings use this.
I2C-3 is the external connection port. If you want to communicate to
external circuits use this.

I am using DS1338 rtc chip.
power supply votage Vcc is 1.8V
logic VH = Vcc x 0.7
logic VL = 0.3V
Therefore, I don't need a logic converter.

connect rtc to overo, try command:
$ i2cdetect -y -r 3
      0 1 2 3 4 5 6 7 8 9 a b c d e f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50:50-- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

the address of ds1338 is 0x68, not 0x50.
Googled around, found the 0x50 is address of eeprom on the overo. That means the rtc chip has not been detected in the i2c bus.
Then, I thought I need to change to i2c bus speed to be 100khz. The overo i2c bus' default speed is 400khz. I am sure the ds1338 can run at hight speed mode. But I could not talk to rtc at the mement. So, give it a try.

------------------------------------------------------
Change i2c bus speed:
(followed steps from http://www.jumpnowtek.com/)

i2c bus speed can be changed by passing a kernel boot argument to the driver in the u-boot startup script.


To modify u-boot, start your system, stop the u-boot process by hitting a key, and make the following change to either nandargs or mmcargs depending how you boot. The nandargs/mmcargs variables are just gumstix conventions for initializing bootargs which is the value u-boot cares about.

Using mmc booting as the example, the old value should look SOMETHING like this:

Overo # printenv
...
mmcargs=setenv bootargs console=${console} ...
...

So a add new variable so you can easily change the speed again and then modify mmcargs and save your changes.
 
Overo # setenv i2cspeed 3,100
Overo # setenv mmcargs setenv bootargs console=\${console} i2c_bus=\${i2cspeed} ...
Overo # saveenv
 
After reboot gumstix, i got errors:

Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "(null)" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00             512 mtdblock0 (driver?)
1f01            1792 mtdblock1 (driver?)
1f02             256 mtdblock2 (driver?)
1f03            4096 mtdblock3 (driver?)
1f04          255488 mtdblock4 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)


Where did I do wrong?!!
Read the instruction again...
Pay attention to these RED words. I was using exact command (copy and paste), even includes the "..." .
How stupid I am : (

I can not remember my mmcargs argument. So, I went to internet, search a printevn to find a similar print out. here is what i found quit similar:

mmcargs=setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay} root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
nandargs=setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay} root=/dev/mtdblock4 rw rootfstype=jffs2
Re-do the 'setenv', reboot, all good. It can boot from mmc again. Thank goodness.
---------------------------------------------------------------------------------------
The speed has been changed. But the rtc still can not been found.
Do I need two pull up resisters for SDA and SCL? No, the overo already has them on board. 
I had a close look the chip... It is ds133833!!  this is running at 3.3v! Wrong chip!

*waiting for new chip*

Got a correct rtc ds1338c-18
$ i2cdetect -y -r 3
root@overo:~# i2cdetect -y -r 3
     0 1 2 3 4 5 6 7 8 9 a b c d e f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50:50-- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- --68-- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- 

0x68, yeah, found it.

Here are two command to read and write time from/to rtc:
root@ i2cget -y 3 0x68 0x01              // read from address 0x01 from rtc
root@ i2cset -y 3 0x68 0x02 0x11      // set rtc address 0x02 to be 0x11

after used i2cset command to set time and date correctly, then used command 'hwclock -w' to write clock to system from rtc.
Check system clock:
root@ date

the data and time are different from what i just set in rtc.

then do:
root@ hwclock
this clock time is as same as the system clcok, but different from rtc.

Strange!!

the 'hwclock' is supposed to read hardware clock (rtc). Does that mean the overo has on board rtc?

Google around, yes, it has a 'twl4030' on board rtc.
when i do:
root@ ls /dev
i can see rtc and rtc0
the rtc0 is on board twl4030.

on the internet, most people recommended to get the external rtc clock time from their program code. that's hard~~

Todo:
use on board rtc and get battery charged.



02/11/2010

Install Qwt for Gumstix

(Install Qwt in Ubuntu)

After I finished program in Ubuntu, I want to compile the program for gunstix.
In the beginning, I copied the qwt-5.2.1 folder to my build machine (fc13). When I do
$ make distcleam
cd src/ && make -f Makefile distclean
make[1]: Entering directory `/build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qwt-5.2.1/src'
make[1]: *** No rule to make target `/usr/share/qt4/mkspecs/linux-g++/qmake.conf', needed by `Makefile'.  Stop.
make[1]: Leaving directory `/build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qwt-5.2.1/src'
make: *** [sub-src-distclean-ordered] Error 2

I tried many time. It looks like the "distcleam" command is not working very well. The qwt-5.2.1 folder is copied from Ubuntu machine. That means it has already been build for i386 system. The "distcleam" command supposes to clean all make files, and return to original file.

The easiest way to fix is download qwt source file to FC13, copy folder to:
   /build/czhang/qt-everywhere-opensource-src-4.7.0/projects
do
$ qmake qwt.pro
$ make

error occur:

compiling resources-release-shared/qrc_qwt_designer_plugin.cpp
rm -f libqwt_designer_plugin.so
linking plugins/designer/libqwt_designer_plugin.so
/build/czhang/overo-oe/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -lQtDesigner
collect2: ld returned 1 exit status
make[1]: *** [plugins/designer/libqwt_designer_plugin.so] Error 1
make[1]: Leaving directory `/build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qwt-5.2.1/designer'
make: *** [sub-designer-make_default-ordered] Error 2

It tried to install qwt plugin for qt-designer.
We can disable it by comment out make option in 'qwtconfig.pri'

$ make

Do not need "make install". This command install qwt library to current machine. I am not going to run the program in my FC13.

Done!

Next, compile m4.pro and copy m4 and qwt library to gumstix.

$ rsync -av czhang@10.0.1.202:///build/czhang/qt-everywhere-opensour
ce-src-4.7.0/projects/qwt-5.2.1/lib/* /usr/lib


11/10/2010

Touch Screen (Gumstix)

Calibrate the screen:
$ cd /usr/bin
$ ts_calibrate

when I run my Qt project, the mouse curse is still incorrect. That's because the Qt does know which touch screen library can be used.
//$ export QWS_DISPLAY="VNC:LinuxFB"
$ export QWS_MOUSE_PROTO="tslib:/dev/input/touchscreen0"

Hint 1: in /~ directory, ".profile" contains commands to be executed after log on.
Therefore, I can add these two export files in ".profile" to load these two command lines automatically when I log in. Alternative, ".bashrc" file does the same job as ".profile" does.

Hint 2: In almost Linux system (except Ubuntu), system checks /etc/inittab file first when start pc. You can tell which run level is the default from it. Normally rc5 is the default run level. You can add you own applications in rc5.d/S99xxx. The system will run these applications automatically (before log in step).
EDIT:
system will run rcS.d first, then rc5.d

a) applications should be added after "rm nologin"

#! /bin/sh
#
# rmnologin     This script removes the /etc/nologin file as the last
#               step in the boot process.
#
# Version:    @(#)rmnologin  1.00  22-Jun-1998  miquels@cistron.nl
#

if test -f /etc/nologin.boot
then
        rm -f /etc/nologin /etc/nologin.boot
fi

# add from here
export QWS_DISPLAY="VNC:LinuxFB"
export QWS_MOUSE_PROTO="tslib:/dev/input/touchscreen0"
/home/czhang/m4 -qws &

: exit 0

b) applications should followed by '&' to make sure they all run on the background, and not affect the login step.

/home/czhang/m4 -qws &


Note: Qt has a build in vnc. we can remotely view the program running on gumstix screen.
I installed vncviewer on my ubuntu machine, and run as:
$ vncviewer 10.0.0.xx      (gumstix IP address)


----------------------------
To use standard USB mouse in gumstix, use following command:
$ export QWS_MOUSE_PROTO= Auto


08/10/2010

Running Qt in Gumstix

first of all, make sure your can create a bootable microSD card. Follow the instruction:

http://www.gumstix.net/Overo/view/Overo-Setup-and-Programming/Creating-a-bootable-microSD-card/115.html


http://www.gumstix.org/create-a-bootable-microsd-card.html


Overo and verdex pro COMs will boot directly from a properly prepared microSD card. This section will outline how to partition and format a bootable microSD card.

To create a bootable microSD, compatible with the·OMAP3 boot ROM, set a special geometry using the·fdisk "Expert mode".  These steps also work for verdex pro COMs.
Important Notes:

- When creating a bootable microSD card for an·Overo COM,·you MUST use expert mode. This sets the correct cylinders, heads and sectors for the microSD card before you partition it.
- Gumstix recommends using a microSDHC card for Overo COMs. Only use microSD cards for verdex pro COMs.

The example below shows the steps required to set up a new microSD card of any size.  The numbers shown are given for a particular 2GB microSD card.  You will be directed to make a simple calculation to determine the correct values for your microSD card.
First, insert your card into the development machine's flash card slot. You may need to use a microSD to SD card adaptor to fit your slot. example the device name will be /dev/sde.  Please substitute the proper device name for your machine. You can use 'mount' or 'df' to see where the card mounts on your machine. Let's unmount the device's existing file system before we get started with fdisk:

$ sudo umount /dev/sde1

Partitioning the Card
Now, launch fdisk and create an empty partition table. Note that the argument for fdisk is the entire device (/dev/sde) not just a single partition (i.e. /dev/sde1):

# sudo fdisk /dev/sde

Command (m for help): o
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)


Let's first look at the current card information:

Command (m for help): p
Disk /dev/sde: 2032 MB, 2032664576 bytes
64 heads, 63 sectors/track, 984 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes
Disk identifier: 0x00aa8e5c
Device Boot      Start         End      Blocks   Id  System
Note the card size in bytes. We will need it later in the process.
Now go into "Expert" mode:
Command (m for help): x


Next, set the geometry to 255 heads, 63 sectors and a calculated value for the number of cylinders required for the particular microSD card. To calculate the number of cylinders, take the 2032664576 bytes reported above by fdisk, divide by 255 heads, 63 sectors and 512 bytes per sector: 2032664576 / 255 / 63 / 512 = 247.12 which we round·down to 247 cylinders.

Expert command (m for help): h
Number of heads (1-256, default 4): 255
Expert command (m for help): s
Number of sectors (1-63, default 62): 63
Warning: setting sector offset for DOS compatiblity
Expert command (m for help): c
Number of cylinders (1-1048576, default 984): 247


Return to fdisk's main mode and create a new partition 32 MB FAT partition:
Expert command (m for help): r
Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-247, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-247, default 15): +32M


Change the partition type to FAT32:
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))


Mark it bootable:
Command (m for help): a
Partition number (1-4): 1


Now, create an ext3 partition for the rootfs:
Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (6-247, default 6): 6
Last cylinder or +size or +sizeM or +sizeK (6-247, default 247): 247

To verify your work, print the partition info:
Command (m for help): p
Disk /dev/sde: 2032 MB, 2032664576 bytes
255 heads, 63 sectors/track, 247 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00aa8e5c
Device Boot      Start         End      Blocks   Id  System
/dev/sde1   *           1           5       40131    c  W95 FAT32 (LBA)
/dev/sde2               6         247     1943865   83  Linux


Finally, write the new partition table to the card and then exit:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks


Formatting the New Partitions
Format the first partition as an FAT file system (the -n parameter gives it a label of FAT).  You can change or omit this if you like.
$ sudo mkfs.vfat -F 32 /dev/sde1 -n FAT
mkfs.vfat 2.11 (12 Mar 2005)


Format the second partition as an ext3 file system:
$ sudo mkfs.ext3 /dev/sde2
mke2fs 1.40.8 (13-Mar-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
121920 inodes, 485966 blocks
24298 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=499122176
15 block groups
32768 blocks per group, 32768 fragments per group
8128 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done                          
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: ^[done
This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.


Installing the Boot Files
There are three files required on the first (FAT) partition to boot your Overo.
1) MLO: the boot-loader loader - this small program is loaded into the OMAP3 processor's static RAM. It does some minimal configuration of system memory and I/O pins and then loads the second file.
2) u-boot.bin: the boot loader
3) uImage: the Linux kernel

Note: For verdex pro, MLO is not required.
You can build these yourself or download pre-built images. but these three files must be named as stated above.

After building or downloading these files, mount the FAT partition of your microSD card. The following example assumes you mount it at /media/card.
$ sudo mount /dev/sde1 /media/card


Due to constraints of the mask boot ROM in the OMAP processor, MLO MUST be written first.
$ sudo cp MLO-overo /media/card/MLO


Copy u-boot and the Linux kernel to the card:
$ sudo cp u-boot.bin /media/card/u-boot.bin
$ sudo cp uImage.bin /media/card/uImage


Now you can unmount the FAT partition.
$ sudo umount /dev/sde1


At this point you have a bootable FAT partition. Lastly, untar your desired root filesystem on the ext3 partition that you created above.  Do not untar your COM rootfs onto your development machine!  This example assumes that you have mounted it at /media/card:
$ sudo mount /dev/sde2 /media/card


Untar your desired rootfs.
$ cd /media/card
$ sudo tar xvaf /path/to/console-image.tar.bz2


Unmount the ext3 partition.
$ sudo umount /dev/sde2


U-boot Environment Refresh
U-boot comes with a default set of environment variables that can change as new versions are released.  If you are updating u-boot, clear your current set of u-boot environment variables the first time you boot with the new version.  Do this by breaking into u-boot and typing the following commands. (Overo ONLY).
$ nand erase 240000 20000
$ reset
To make additional changes to the environment, break into u-boot again, make the changes and type 'saveenv' to save.  This also eliminates the "*** Warning - bad CRC or NAND, using default environment".


====================================================================

PS! The order you copy MLO, u-boot and uImage to microSD FAT partition is very important. Otherwise, you may not boot from microSD card successfully.

Then, copy two files from your build directory to microSD card:
 directory: /build/czhang/overo-oe/tmp/deploy/glibc/images/overo
 files:  uImage-2.6.34-r90-overo.bin
             Angstrom-omap3-console-image-glibc-ipk-2010.7-test-20101005-overo.rootfs.tar.bz2 (extract to sd card)


****************************************************************************

Problem occur:

after boot from microSD card (which contain pre-make overo image from internet), Ethernet does not work, because i cannot see the light turns on after i plugged Ethernet cable.

in Overo kernel, check the loaded module
$ lsmod
Module Size Used by
libertas_sdio 13860 0
libertas 168952 1 libertas_sdio
lib80211 6848 1 libertas
ipv6 238492 16
ads7846 10328 0

Hmm, eth0 module hasn't been loaded.

try
$ modprobe smsc911x
smsc911x: Driver version 2008-10-21.
smsc911x-mdio: probed
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:01, irq=-1)
net eth0: MAC Address: 00:15:c9:28:c3:60
net eth0: SMSC911x/921x identified at 0xd0c3a000, IRQ: 336

great, loaded. right, i need to add eth0 module while the overo booting.

$ cd /etc
$ cat modules
### This file is automatically generated by update-modules"
#
# Please do not edit this file directly. If you want to change or add
# anything please take a look at the files in /etc/modutils and read
# the manpage for update-modules.
#
### update-modules: start processing /etc/modutils/ipv6
ipv6

### update-modules: end processing /etc/modutils/ipv6

$ cd /etc/modutils
$ cat > smsc911x ; create a eth0 module file
$ cat smsc911x ; add command in this file
smsc911x
(Ctrl+D to save it)

$ update-modules

reboot gumstix, done!

copy my own build overo image to microSD card, boot gumstix, the eth0 still not work!!
the reason is that the latest version of bb recipes includes the smsc911x in kernal, not a module. take a look in:
$ cd /etc/network
$ cat interfaces
#auto eth0
#iface eth0 inet dhcp
#iface eth1 inet dhcp
(eth0 has been disabled)

$ vi interfaces ; learn how to drive vi, un-comment eth0
auto eth0
iface eth0 inet dhcp
#iface eth1 inet dhcp ; gumstix does not have eth1

reboot gumstix, done.

Note: sometimes, the eth0 will down after I stopped program. To enable the eth0 manually, try:
$ ifconfig eth0 up
$ ifconfig eth0 10.0.0.xxx netmask 255.255.255.0

or

$ udhcpc

sometimes "udhcpc" does not work.
I am using
$ifdown eth0
$ifup eth0

to enable the Ethernet.


take a look if the kernel has "rsync", because i need use it to copy Qt arm-lib files from my build machine.
try if you can install "rsync" with opkg command, which is similar to yum or apt-get
$ opkg install rsync
can't install rsync
try
$ opkg update
$ opkg install rsync
still can't install.

go back to build machine, build rsync package myself.
$ cd /build/czhang/overo-oe
$ source build/profile
$ bitbake rsync

after that, i should be able to see a rsync.ipk file in:
/build/czhang/overo-oe/tmp/deploy/glibc/ipk/armv7a/rsync_3.0.6-r0.6_armv7a.ipk


Go to Gumstix, copy this package to /~

Then
$ cd ~
$ opkg install rsync_3.0.6-r0.6_armv7a.ipk

Then copy all Qt ARM-lib file to gumstix lib folder
$ rsync -av czhang@10.0.1.202://build/czhang/qt-everywhere-opensource-src-4.7.0/lib/* /usr/lib

copy my Qt executable file to gumstix
$ cd ~
$ scp czhang@10.0.1.202:/build/czhang/qt-everywhere-opensource-src-4.7.0/projects/m4_arm/m4/m4 .
$ pwd
/home/root
$ /home/root/m4
error while loading shared libraries: libqextserialport.so.1: cannoy

ok, need to copy serial port arm-lib to gumstix
$ rsync -av czhang@10.0.1.202://build/czhang/qt-everywhere-opensource-src-4.7.0/projects/qextserialport/build/libqextserialport* /usr/lib

run again
$ /home/root/m4

great, see my program on the touch screen.

next step is to calibrate the touch screen and import some pictures.



06/10/2010

build cross compile tools for overo arm processor

First of all, I need to understand the open-embedded (OE) build system.
OE is a software framework to create Linux distributions. OE downloads the source code and cross compiles it for you as needed. OE builds everything from scratch including the cross compilation toolchain. 


The first part of this instruction is copy from

This section will show us how to set up an OE environment on our Linux development system.


The second part is all my set up steps afterwards.

In the meantime,  this website is very helpful.
(http://www.klc.net.nz/linux/?page_id=13)



Part 1

Prerequisites

Your build machine should be running a recent Linux distribution. Gumstix uses Ubuntu for development, and this is what we strongly recommend.
For those who need to use a different distribution, we recommend that you consult the OpenEmbedded documentation at:
Depending on your distribution, it is likely you will need to install additional software. If you would like to install these packages up front, the following list includes most of the necessary packages:
  • git
  • subversion
  • gcc
  • patch (this and gcc are often bundled with other developer tools in the build-essential package)
  • help2man (Centos 5 package available from atrpms repository)
  • diffstat
  • texi2html (texinfo on SUSE)
  • makeinfo (texinfo on Ubuntu)
  • ncurses-devel (libncurses5-dev on Ubuntu)
  • cvs
  • gawk
  • python-dev
  • python-pysqlite2 (python-sqlite2 on SUSE)
  • unzip
  • chrpath
  • ccache
Only the first two packages (git and svn) are required to be installed up front. Otherwise you can proceed and you will be prompted to install needed packages later in the process.
Note 1: If you are using an Ubuntu distribution, it is likely that /bin/sh is linked to /bin/dash. If this is the case, then you will need to change /bin/sh to link to /bin/bash. Neglecting to do this will cause target system init file corruption and your build image will not boot! Run "sudo dpkg-reconfigure dash" and answer no when asked whether you want to install dash as /bin/sh.

Build system checkout

First you'll want to check out the source files for OE build system (roughly 250 MB). With a typical DSL connection this step should take less than 20 minutes. You should have at least 10GB of free space on your hard drive in order to do a complete build of the kernel and root file system images.
These instructions will assume that you are installing the build system in your home directory under "overo-oe". If you decide to put it elsewhere you will need to make appropriate alterations to the steps below.
First we will create the "overo-oe" directory and cd into it:
$ mkdir -p ~/overo-oe
$ cd ~/overo-oe
Then we will install the OE metatdata, and check out the Overo branch (you can safely ignore the warnings you will get from the git commands):
$ git clone git://gitorious.org/gumstix-oe/mainline.git org.openembedded.dev
$ cd org.openembedded.dev
$ git checkout --track -b overo origin/overo
The next step installs BitBake:
$ cd ~/overo-oe
$ git clone git://git.openembedded.net/bitbake bitbake
$ cd bitbake
$ git checkout 1.10.2

Creating the OE configuration files and profile

We now will create a profile script and the configuration files required to tailor OE to our needs.
To make this a somewhat easier task, there is a template for the required files in the OpenEmbedded installation we just did.
Copy these files to your overo-oe directory:
$ cd ~/overo-oe
$ cp -r org.openembedded.dev/contrib/gumstix/build .
If you have followed the example installation and placed the build system in overo-oe in your home directory, you are now ready to proceed to the next step. If you have installed the build system in a different location you will need to edit overo-oe/build/profile and change the definition of OVEROTOP as appropriate.

Source code caching

As part of the build process OpenEmbedded downloads source code tarballs for the Linux kernel, compiler, and other software packages. By default this source code cache will be placed in overo-oe/sources. If you would like this cache to be located elsewhere, now is the time to edit build/conf/site.conf and set DL_DIR as appropriate.

Environment setup

OpenEmbedded requires some environment setup in order to function properly. There are a couple of ways to handle this requirement.

OPTION A: BASH PROFILE

You can set this up via your bash profile:
$ cp ~/.bashrc ~/bashrc.bak
$ cat ~/overo-oe/build/profile >> ~/.bashrc
With most distributions, adding this environment setup to ~/.bashrc will work for both GUI shells and login shells. If your distribution does not source .bashrc for login shells, you may need to use ~/.bash_profile instead of ~/.bashrc (or modify ~/.bash_profile so that it does source ~/.bashrc).
f you chose Option A for environment setup (bash profile method),·log out/log back in or close your terminal window and open a new one so that the environment changes you enabled above will take effect.

OPTION B: COMMAND LINE SOURCING

If you don't want to modify your standard terminal profile for some reason, you can do this environment setup on a per session basis by sourcing overo-oe/build/profile prior to issuing any build commands:
$ . ~/overo-oe/build/profile
or alternatively:
$ source ~/overo-oe/build/profile
If you chose Option B (command line sourcing), issue the command to source the environment setup.

Your first build

You can build a basic kernel and non-gui root file system image in one step with:
$ bitbake omap3-console-image
If your build machine is missing any essential packages, bitbake will notify you about them at this point. Install the recommended packages and try the bitbake command again. There are many other bitbake targets for different images.
You will also get a message from bitbake suggesting that you install the psyco JIT compiler for better performance. It isn't necessary to install psyco right now, though it is a good idea to install it at some point.
You may also notice another message complaining about not finding user.collection/packages/*/*.bb. Don't concern yourself with this -- you will create this directory later when you create your first package for your own code.
This initial build will take a bit of time since it will need to download all the source code and build the cross compilation tools. Subsequent builds will be much faster. When the build completes, you will find the root file system image and the kernel image in $HOME/overo-oe/tmp/deploy/glibc/images/overo.




Part 2

use oe to build overo system image file.

after bitbake omap3-console-image has been succeed

$cd /overo-oe/tmp/sysroots/x86_64-linux/usr/armv7a/bin/

This folder contains all cross compile tools. We gonna to use the same compile tools to compile Qt compiler and Qt libraries.

On our normal pc, Qt creator compiles programs for i386 processor. These programs could not run in gumstix, because it got ARM processor. In order to solve this problem, we need to re-compile these programs which created in normal pc for ARM processor.

We use the same oe cross compile tools to compile Qt libraries and Qt-ARM-compiler.


take a look all PATH:
$echo $PATH
/build/bitbake/bin:$/build/bitbake/bin:$/build/bitbake/bin:$/build/bitbake/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/czhang/bin

the cross compile tools  are not in the PATH, I need to create links for these tools. Review the PATH, at the very end, /home/czhang/bin is in the PATH. I decide to put links into this folder.



Meanwhile, (not very clear), during the compiling, the system only look for 'arm-linux-xxx'. Therefore, create links to link 'arm-linux-xxx' to 'arm-angstrom-linux-gnueabi-xxx'.

$cd ~/bin
$for A in `find . -name "arm-angstrom-linux-gnueabi-*"`; do ln -s $A `echo $A | sed s/arm-angstrom-linux-gnueabi-/arm-linux-/` ; done


Then
$make distclean
clean the pre-compile files.
$./configure -embedded arm -qt-mouse-tslib -qt-gfx-vnc -prefix /usr
install with touch screen and vnc application, and tell qmake to compile program in arm
$qmake