Getting Qt 4.3.2 running on the Chumby
The libraries
First, we need the GNU toolchain to cross-compile things for the Chumby. Download and install it from:
Now, we need to decide where to install our files to; i.e., our prefix. Since I'm having some trouble with my NFS share, I'll use my USB stick. (Located at /mnt/usb). Feel free to replace this with your prefix wherever you see me mention this location. Next, we need to download and install tslib for the touchscreen.
I used version 1.0 from: http://tslib.berlios.de/
Make sure you have autoconf, libtool, and the other usual suspects installed. Then from the extracted files directory run:
./autogen.sh
./configure --prefix=/mnt/usb --host=arm-linux
make
If you get some errors about rpl_malloc, simply comment out that evil line in config.h and try make again.
And finally:
make install
Next up is Qt.
Unpack it, and run:
./configure -embedded arm -pch -prefix /mnt/usb -qt-kbd-usb -qt-mouse-tslib \
-L/mnt/usb/lib/ -I/mnt/usb/include/ -nomake examples -nomake demos
Note:You can leave out the -qt-kbd-usb if you want. I kept it in since I like being able to type on the Chumby with my USB keyboard ;). Also, thanks to orangerobot from the Chumby forum for pointing out the mangled -L line.
Next:
make
make install
So far we don't have any Qt programs to play with. Let's compile a small Qt widget/app called PictureFlow (http://code.google.com/p/pictureflow/) by Ariya Hidayat.
I have modified the sources slightly (added basic mouse support, some images, resizing), and packaged it here:
pictureflow-chumby_1_0_tar.gz
Uncompress it, and in that very directory:
/mnt/usb/bin/qmake
make
Copy the resulting binary and images to a place on your prefix:
mkdir /mnt/usb/test
cp pictureflow *jpg /mnt/usb/test/
Now, we need to create a file with some environment variables that you can use when you're in your Chumby shell.
Create a file in your prefix (/mnt/usb for me) called chumby.env with the following contents:
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_PLUGINDIR=/mnt/usb/lib/ts
export TSLIB_CONSOLEDEVICE=/dev/ttyS0
export TSLIB_CONFFILE=/mnt/usb/etc/ts.conf
export TSLIB_CALIBFILE=/mnt/usb/etc/pointercal
export LD_LIBRARY_PATH=/lib:/mnt/usb/lib
export POINTERCAL_FILE=/mnt/usb/etc/pointercal
export QWS_MOUSE_PROTO=Tslib:/dev/input/event0
export QWS_KEYBOARD=USB:/dev/input/event1
Finally it's Chumby time!
Enable SSH on the Chumby as per:
http://wiki.chumby.com/mediawiki/index.php/Chumby_tricks#Open_a_secure_s...
SSH in and cd in to your directory of installed files.
For me, this meant:
Plugging in my USB stick.
ssh root@<ChumbyIpAddress>
cd /mnt
umount usb
mount usb
cd usb
Lets start off by killing the current Chumby GUI:
/usr/chumby/scripts/stop_control_panel
Now, we need to source that file with environment variables:
source /mnt/usb/chumby.env
Then, we need to configure the touch screen for tslib.
Make sure that your etc/ts.conf file has the input module un-commented.
My /mnt/usb/etc/ts.conf looks like:
module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear
Finally, we need to calibrate the touchscreen:
/mnt/usb/bin/ts_calibrate
Make sure that you touch the five different crosshair locations. If you accidently tap twice at the same spot, re-run ts_calibrate untill you get it right :)
To test and make sure that tslib is working correctly, feel free to play with:
/mnt/usb/bin/ts_test
You should be able to drag the crosshair around.
And last but not least - it's time to try out our Qt app:
cd /mnt/usb/test
./pictureflow -qws
If all is well, you should see something that looks like this:
(http://www.youtube.com/watch?v=v2yN0F7_YlI)
Hopefully you didn't encounter any problems. These steps worked for me, but I may have just been lucky ;). More likely though is that I forgot to mention something. Please feel free to ask questions on this Chumby forum thread:
http://forum.chumby.com/viewtopic.php?id=720/
Allthough I realize that this was quite cumbersome, the good new is that you basically only need to do this once. Thereafter you just need to write your Qt app (Google for tutorials ;)), qmake, make, and copy the executable to your Chumby! :)
Qt 4.4.0 builds and works!
I got most of the Qt 4.4 demos to run, except the one I was really looking forward to: browser. For those of you not following Qt development, 4.4 has WebKit built in, targeted for Windows, Linux, Mac OS X, WinCE, all Qtopia (qt-embedded) platforms, including embedded Linux on ARM (Chumby). Browser is the demo that shows off WebKit.
I launched it from SSH and the basic window came up and started issuing network requests and then just segfaulted.
I tried out the chumby remote gdb client/server combo, but that didn't really yield any useful debugging information.
Apparently, remote GDB, especially cross-architecture, is pretty awkward. It would be nice if the Chumby guys would put out a tutorial. It would be nicer if they went ahead and figured out why the Qt WebKit demo crashed. :)
Dave
re:Qt 4.4.0 builds and works!
Yeah- I experienced the same problem. I think it's a problem with the toolchain because:
1) The less optimizations I allow at compile time, the longer it lasts before segfaulting (more pages load).
2) Other devices which I use other arm toolchains for work relatively well.
Good luck, and let me know how it goes with the Chumby guys feedback on this!
Jesper
Thanks for the heads up, but need little help
Hi,
Thanks for this excellent explanation. I have a customized arm926ejs based versatile board and i am trying to port qtopia & pictureflow to it. I have successfull ran qtopia phone and pictureflow seperately but now i want to integrate both. I tried adding pictureflow.desktop and pics to pictureflow qt project file and it dows appear inside qpe application window. but when i click on it noting happens. i enabled the log and below is the response. what i see is the ApplicationLauncher doesnt call handleStateChanged to make pictureflow running.
Kindly help me to resolve this
Thanks in advance
Regards
Gururaja
ApplicationLauncher : LegacyLauncherService: Request for execute( "PictureFlow" )
ApplicationLauncher : 226570 : 226570 : LegacyLauncherService: Request for execute( PictureFlow )
ApplicationLauncher : LegacyLauncherService: Request for execute( "PictureFlow" )
ApplicationLauncher : 226860 : 226860 : LegacyLauncherService: Request for execute( PictureFlow )
ApplicationLauncher : LegacyLauncherService: Request for execute( "PictureFlow" )
ApplicationLauncher : 227170 : 227170 : LegacyLauncherService: Request for execute( PictureFlow )
tslib problem (solved) and color depth
I had a problem with tslib. Qtopia configure complained:
"The tslib functionality test failed!", without going into any detail. Turned out, that the tslib 'make install' tried to create a symbolic link from a temporary file to 'libts.so', which it wasn't permitted to do. I don't know why that failed, but I just renamed the temporary file in /mnt/usb/lib to 'libts.so' to get it working. Just thought I'd mention it in case someone else came across that problem.
Later in the configure script, qtopia asks for the color depth. I just chose 32. Does anyone know whether the chumby actually handles that? Does that have performance implications on qtopia?
Fortota tool
You need ot install intltool to run ./autoconfigure
cool
It's good to know that PictureFlow can work out-of-box on this cool device :-)
re: cool
Indeed - and performance is really great! Thanks for making such a neat widget :)
Qtopia on Chumby
I'd already follow your instruction for build qtopia and all the compiling process works fine, but, when i run ts_calibrate the LCD don't show the crosshair. I set the environment variables as file:///home/cain/Desktop/chumby/qt_on_chumby.html say, but i can't see nothing sad
If i run:
unzip -p /bitmap/chumby_logo.zip >/dev/fb1
some colored circles are shoen in LCD, why QT applications don't drive the LCD?
There are a environment variable that manage the QT framebuffer device?
When i run:
/mnt/usb/examples/qtopiacore/framebuffer/framebuffer
The framebuffer device was opened successfully.
Fixed screen info:
id: IMX
smem_start: 0xc3d40000
smem_len: 153600
type: 0
type_aux: 0
visual: 2
xpanstep: 0
ypanstep: 0
ywrapstep: 0
line_length: 640
mmio_start: 0x0
mmio_len: 0
accel: 0
The framebuffer device was mapped to memory successfully.
Switch to graphics mode failed: Invalid argumentVariable screen info:
xres: 320
yres: 240
xres_virtual: 320
yres_virtual: 240
yoffset: 0
xoffset: 0
bits_per_pixel: 16
grayscale: 0
red: offset: 8, length: 4, msb_right: 0
green: offset: 4, length: 4, msb_right: 0
blue: offset: 0, length: 4, msb_right: 0
transp: offset: 0, length: 0, msb_right: 0
nonstd: 0
activate: 0
height: -1
width: -1
accel_flags: 0x0
pixclock: 62500
left_margin: 15
right_margin: 6
upper_margin: 9
lower_margin: 7
hsync_len: 1
vsync_len: 1
sync: 0
vmode: 0
Will draw 3 rectangles on the screen,
they should be colored red, green and blue (in that order).
Done.
But nothing appear an LCD :(
re: Qtopia on Chumby
In your example, you mentioned:
"unzip -p /bitmap/chumby_logo.zip >/dev/fb1"
On my device, fb0 was what worked. Try running "export TSLIB_FBDEVICE=/dev/fb1"
And let me know if you see when you run ts_calibrate.
Also, make sure your ts.conf file is properly set up as described in the guide.
We can tackle Qt itself after that ;)
Same issue with ts_calibrate
I am having the same issues with ts_calibrate -- the chumby screen never displays the calibration targets but it does responds to taps.
Setting TSLIB_FBDEVICE=/dev/fb1 causes the same issue described above -- the chumby screen goes black when i run ts_calibrate (and still responds to taps).
Any help would be much appreciated . . .