UbuntuThe project fully complies with the principles of open source software development, and encourages people to use, improve and spread open source software. That isUbuntuCurrently, it will always be free. However, this does not only mean zero cost, the idea of free software is that people should use software freely in all "useful to society" way, the Development Board used in this paper: YC2440-F-V5.1
1. ubuntu8.04 enable the root user and set the Chinese interface
UbuntuAfter installation, the root user is locked by default and cannot log on. For desktop users, this is more secure. But it is not suitable for embedded system development. Sometimes you may encounter some inexplicable problems during program compilation. Therefore, we need to enable the root user.
Steps:
1. Choose system> System Management> users and groups, select the root user, and click "properties" to set the password of the root user;
2. System> System Management> logon window. Click the "Security" option page and select "Allow Local Administrator Logon ". In this way, you can log on as the root user name. After logging on, you can see the English interface, even if you have installed a Chinese Language Pack. In this case, you need to make the following settings to see the Chinese interface.
- gedit ~/.profile
Modify the hidden file. profile under root. The following is the modified file. Since then, it has become a Chinese desktop. #~ /. Profile: executed by Bourne-compatible login shells. if ["$ BASH"]; then if [-f ~ /. Bashrc]; then .~ /. Bashrc fi mesg n # Installed by Debian Installer: # no localization for root because zh_CN.UTF-8 # cannot be properly displayed at the Linux console LANG = "zh_CN.UTF-8" LANGUAGE = "zh_CN: zh"
2. Install the host GCC compiler
CompileQtopiaThe GCC compiler of the host is required,UbuntuIt is not included by default, so you need to download and install it. Search for GCC in the new software package manager and select install. I installed GCC4.2.
3. Install the Cross Compiler
1) the cross compiler I use is arm-linux-gcc 3.4.1.
Enter the directory of the arm-linux-gcc-3.4.1.tar.bz2 File
Run the following command:
Mkdir/usr/local/arm if your pc-side linux system already has this folder, skip this step)
- Tar-xjvf arm-linux-gcc-3.4.1.tar.bz2-C/
- Then run the command gedit/etc/bash. bashrc.
Add a PATH = $ PATH:/usr/local/arm/3.4.1/bin at the end.
Save and close.
Re-open the terminal. If a version is displayed after the command arm-linux-gcc -- version is entered, the cross-compilation environment has been established.
2) modify the compiler File
- Gedit/usr/local/arm/3.4.1/arm-linux/include/linux/videodev2.h at # define V4L2_PIX_FMT_HI240 v4l2_fourcc ('h', 'I', '2 ', '4 ')
- /* 8-bit color */Add later
- # Define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc ('B', 'A', '8', '1')/* 8 BGBG... GRGR ..*/
Modify arm-linux/sys_include/linux/videodev2.h in the same way
4. Install NFS
1) install the nfs server
- apt-get install portmap nfs-kernel-server
2) Configure shared files
Edit/etc/exports and add the directory to be shared.
- gedit /etc/exports
Configuration
- /work/qtopia_arm/nfs *(rw,sync, no_root_squash)
/Work/qtopia_arm/nfs is the directory to be shared; * indicates that all clients can mount the file system; rw indicates that clients can mount their root file system with read/write permission; the no_root_squash option allows the client to mount the root file system as the root of the host. Save and exit.
3) restart the service
- /etc/init.d/portmap restart
- /etc/init.d/nfs-kernel-server restart
Restart the service whenever/etc/exports is modified to make the modification take effect.
5. install some libraries
Some errors may occur during compilation, prompting that some libraries are missing. You can download and install the missing library files as prompted. Each user's host environment is not the same, so the missing libraries may be different.
6. Create a working directory
Create/work/qtopia_arm/nfs
And copy the qtopia-opensource-4.3.2 source package to the/work/qtopia_arm/directory.
7. Define two environment variables to facilitate compilation
- #export QTOPIA_INSTALL=/work/qtopia_arm/nfs
- #export QTOPIA_RUN_ON_TARGET=/mnt
QTOPIA_INSTALL is the final installation directory of qtopia on the master machine. The installation path is independent here to facilitate nfs mounting and debugging on the target board.
QTOPIA_RUN_ON_TARGET is the path of qtopia in the target board file system. If NFS is used, you must mount qtopia to the path specified by QTOPIA_RUN_ON_TARGET, that is,/mnt, because the absolute path of qtopia has been compiled into the executable file.
8. modify some source code
1) copy the files required for compilation.
- # cd /work/qtopia_arm/qtopia-opensource-4.3.2/src/libraries/qtopiabase/
- # cp custom-linux-generic-g++.h custom-linux-arm-g++.h
- # cp custom-linux-generic-g++.cpp custom-linux-arm-g++.cpp
Note: These two files contain LCD brightness control functions and macro definitions for optimizing qotpia core. You can set them by yourself.
2) supports touch screen without using external libraries.
- #gedit /work/qtopia_arm/qtopia-opensource-4.3.2/qtopiacore/qconfig-qpe.h
Add a macro definition at the end
- #define QT_QWS_IPAQ
- #define QT_QWS_IPAQ_RAW
3) modify the time zone information read path
- #gedit /work/qtopia_arm/qtopia-opensource-4.3.2/qtopiacore/qconfig-qpe.h
Add a macro definition at the end
- #define QTOPIA_ZONEINFO_PATH "/mnt/etc/zoneinfo/"
The path of the QTOPIA_ZONEINFO_PATH file in the real-time zone. It is necessary to modify it here. Otherwise, qtopia will find the time zone file in the default path/usr/share/zoneinfo. Note that "/mnt" is the path of qtopia in the development board File System. It must be the same as the environment variable $ QTOPIA_RUN_ON_TARGET.
9. Generate the Makefile file
Create an empty file Configure. sh,
And copy the following content:
- echo "yes" | /work/qtopia_arm/qtopia-opensource-4.3.2/configure -edition phone -xplatform linux-arm-g++ -arch arm
- -no-qvfb -release -displaysize 480*272 -no-modem -launch-method quicklaunch –image /work/qtopia_arm/nfs
- -prefix /mnt -no-bluetooth -no-drm -no-infrared -extra-qt-config "-qt-zlib -qt-gif -qt-libpng -qt-libmng
- -qt-libjpeg" -extra-qtopiacore-config " -depths 16 -qt-mouse-linuxtp -no-mouse-pc -no-mouse-bus
- -no-mouse-yopy -no-mouse-vr41xx -no-mouse-tslib -no-mouse-qvfb" 2>&1 | tee logfile
Note: The script file must have executable properties before execution. Execute chmod + x Configure. sh.
Note: 1) Here we need to mention that qtopia is compiled using arm-linux-gcc by default during cross-compilation. From the path specified by the-xplatform parameter in linux-arm-g ++, we can find qmake. the conf file defines the tool used for cross-compilation. The default value of QMAKE_CC is arm-linux-gcc. Therefore, if someone uses another name-based cross-compilation tool, you need to modify it in the qmake. conf file or connect the compilation tool to arm-linux.
10. Configure and compile
Generate Makefile
- #cd /work/qtopia_arm
- #./configure.sh
Compile and install
- #make
- #make install
The installation path is $ QTOPIA_INSTALL, that is,/work/qtopia_arm/nfs.
11. Copy zoneinfo
By default, the time zone information is not copied during installation. You need to manually copy the information.
- #cp –rvf /work/qtopia_arm/qtopia-opensource-4.3.2/etc/zoneinfo /work/qtopia_arm/nfs/etc
12. Run qtopia
1) Start the kernel + file system after the Development Board) and mount qtopia
- #mount -t nfs 192.168.1.101:/work/qtopia_arm/nfs /mnt -o nolock,rsize=1024,wsize=1024,timeo=15
Host IP Address: 192.168.1.101, subnet mask 255.255.0, and gateway 192.168.1.1
The IP address of the Development Board is 192.168.1.168, The subnet mask is 255.255.0, And the gateway is 192.168.1.1.
2) Set Environment Variables
Import certain environment variables to make qtopia work properly
Run the following command on the Development Board:
- #export PATH=/mnt/bin:$PATH
- #export LD_LIBRARY_PATH=/mnt/lib:$LD_LIBRARY_PATH
- #export QWS_MOUSE_PROTO=LinuxTP:/dev/h3600_tsraw
- #export QWS_DISPLAY="LinuxFb:mmWidth85:mmHeight48:0"
"MmWidthXX: mmHeightXX" indicates the visible area of the screen, which is related to the specific device size.
- 12.3 run qpe
- # Qpe &
After the target LCD screen appears, start the touch screen correction program.
- #qcop service send Launcher "execute(QString)" "calibrate"
After calibration, A Pointercal calibration file is generated in the/etc directory. Each time the touch screen starts, the file is read for touch screen setting. Another way is to use the TSLIB library's calibration program for calibration, cross-compile TSLIB to the target machine, and then run the ts_calibrate program.
Qpe can be used properly after calibration.
Note:
1. Assume that the touch screen driver of the Development Board works properly. You can perform a simple test using the following methods:
- #cat /dev/fb0
- #cat /dev/h3600_tsraw
If an error is reported, the device cannot be correctly added. The problem of touch screen driver must be solved first.
2,QtopiaSome additional libraries that may be required during the runtime,
- cp -v libdl*so* $QTOPIA_INSTALL/lib/
- cp -v libpthread*so* $QTOPIA_INSTALL/lib/
- cp -v libstdc++*so* $QTOPIA_INSTALL/lib/
- cp -v libgcc_s*so* $QTOPIA_INSTALL/lib/
Summary: The compilation and running of Qtopia 4.3.2 In Ubuntu 8.04 is complete. The launch of Ubuntu has added a new impression to LINUX. I hope this article will help you!