My MiniGUI transplant journey

Publisher:HarmonySpiritLatest update time:2024-11-11 Source: cnblogsKeywords:MiniGUI Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I: Introduction
I have been porting minigui in recent days. I have never used the minigui interface before. I want to see what the effect is and learn it by the way. After all, it is made in China. It took me three days to finally display the minigui interface on my LCD and run the MDE demonstration program. I encountered many problems during the period. Fortunately, I recorded my problems and solutions. Now I will start my porting.

2. Setting up the usage environment
1. Host: RedHat Enterprise Linux AS4
2. Cross-compilation tool path: /usr/local/arm/2.95.3/ (used to compile vivi, minigui1.3.3)
/usr/local/arm/3.3.2/ (used to compile busybox1.5.1)
/usr/local/arm/3.4.1/ (used to compile linux2.6.11.1 kernel)
Add the /usr/local/arm/2.95.3/bin path to the /etc/profile file
3. Development board: Friendly Arm SBC2410
4. Linux2.6.11 kernel used by the development board
When configuring the kernel, select the following options
Graphics support --->
<*> Support for frame buffer devices //minigui graphics engine related
<*> Virtual Frame Buffer support (ONLY FOR TESTING!)
Console display driver support --->
<*> Framebuffer Console support //minigui graphics engine related

3:
Installation I referred to the transplantation method of Desert Wolf on the Internet. I don't know if these resources are used when compiling. Some are used. I installed them all. All resource dependency libraries and minigui source files are downloaded to /home/minigui/.
1. Installation of zlib library
Download address: http://www.zlib.net/zlib-1.2.3.tar.gz
# tar zxf zlib-1.2.3.tar.gz
# cd zlib-1.2.3
#./configure --prefix=/usr/local/arm/2.95.3/arm-linux/ --shared
#vi Makefile

change gcc to arm-linux-gcc

#make
#make install
2. Installation of png library
Download: http://superb-east.dl.sourceforge.net/sourceforge/libpng/libpng-1.0.10rc1.tar.gz
# tar zxf libpng-1.0.10rc1.tar.gz
# cd libpng-1.0.10rc1
# cp scripts/makefile.linux Makefile
# vi Makefile
CC=arm-linux-gcc
# where "make install" puts libpng.a, libpng.so*, png.h and pngconf.h
prefix=/usr/local/arm/2.95.3/arm-linux //Modify here
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
ZLIBLIB=/usr/local/arm/2.95.3/arm-linux/lib //Modify here
ZLIBINC=/usr/local/arm/2.95.3/arm-linux/include //Modify here
#make
#make install
3. Installation
of jpeg library I copied the jpeg library to the /usr/local/arm/3.3.2/arm-linux/lib/ directory. The 3.3.2 cross-compiler itself contains the jpeg library. 4.
Installation of libttf library
Download address: http://nchc.dl.sourceforge.net/sourceforge/freetype/freetype-1.3.1.tar.gz
# tar zxf freetype-1.3.1.tar.gz
# cd freetype-1.3.1
Change gcc of all Makefile files to arm-linux-gcc
#make
#make install

IV. Installation of MiniGUIi
Create a new directory under /usr/ to store the results of minigui compilation and installation
#mkdir /usr/arm-linux
#cd /usr/arm-linux
# mkdir lib etc include
1. Install minigui-res-1.3.3.tar.gz
#tar –xzvf minigui-res-1.3.3.tar.gz
#cd minigui-res-1.3.3

#Modify the config.linux file and change {prefix} to /usr/arm-linux
#make install //Install resource files
Install resource files to /usr/arm-linux/lib

2. Install libminigui-1.3.3.tar.gz
When installing libminigui-1.3.3, you need to modify a file fbvideo.c, in the libminigui-1.3.3/src/newgal/fbcon/ directory: Modify as follows:

/* Initialize the library */
GAL_fbdev = getenv("FRAMEBUFFER");
if ( GAL_fbdev == NULL ) {
GAL_fbdev = "/dev/fb/0"; //Modify here
}
console_fd = open(GAL_fbdev, O_RDWR, 0);
if ( console_fd < 0 ) {
GAL_SetError("Unable to open %s", GAL_fbdev);
return(-1);
}

#tar –xzvf libminigui-1.3.3.tar.gz
#cd libminigui-1.3.3
#make menuconfigConfigure

libminigui
System Wide Options:
[*] Build MiniGUI-Lite //Compile in Lite mode, not Thread mode, this is suitable for PDA
[ ] Stand-Alone
[ ] Use incore (built-in) resource
[*] Unit of timer is 10ms
[*] Cursor support
[ ] User can move window with mouse
[*] Mouse button can do double click
[*] Build with debugging messages
[ ] Trace messages of MiniGUI
[*] Include symbol name of messages

GAL engine Options:
(NEWGAL) GAL and its engines
[*] NEWGAL engine on Linux FrameBuffer console
[ ] NEWGAL engine on Qt Virtual FrameBuffer
[ ] NEWGAL engine on eCos LCD interface
[*] Dummy NEWGAL engine
[*] Have console on Linux FrameBuffer

IAL engine options :
[ ] EP7211-based board
[ ] ADS Graphics Client
[ ] iPAQ H3600 (also H3800)
[ ] MPC823
[ ] PX255B
[ ] NEC VR4181
[ ] Helio Touch Panel
[ ] MT T800
[*] SMDK2410 Touch Screen
[ ] uClinux Touch Screen Palm/MC68EZ328
[*] Dummy IAL engine
[*] Native (console) input engine
--- Native IAL engine subdriver options
[ ] PS2 mouse
[ ] IntelligentMouse (IMPS/2) mouse
[ ] MS mouse
[ ] MS3 mouse
[*] GPM daemon

Font Option :
[*] Raw bitmap font
[ ] Var bitmap font //Don't choose this, it will cause an error when compiling mde
[*] Incore font sansserif
[*] Incore font courier
[*] Incore font symbol
[*] Incore font vgas
[*] Qt Prerendered Font
[*] TrueType font
[ ] Adobe Type1 font

Image Options:
[*] Includes SaveBitmap-related functions
[ ] PCX file support
[ ] LBM/PBM file support
[ ] TGA file support
[*] GIF file support
[*] JPG file support
[*] PNG file support

Input Medthold Option:
[*] IME (GB2312) support
[ ] IME (GB2312) Intelligent Pinyin module

Development Environment Option:
(Linux) Platform
(arm-linux-gcc) Compiler
(glibc) Libc
--- Installation options
Path prefix: "/usr/arm-linux"
--- Additonal Compiler Flags
CFLAGS: ""
LDFLAGS: ""
After configuration is completed,
#make
#make install
will install the minigui library to /usr/arm-linux/lib, MiniGUI.cfg to /usr/arm-linux/etc/ and related files to /usr/arm-linux/include/.
3. Install mde-1.3.0.tar.gz
#tar –xzvf mde-1.3.0.tar.gz
#cd mde-1.3.0
#export CC=arm-linux-gcc
#vi configure.in

Modify the configure.in file
l Add a line
CFLAGS="$CFLAGS –I${prefix}/include -L${prefix}/lib" //Specify the reference path of minigui header files and library files.
l Modify the header file path:
AC_CHECK_HEADERS(${prefix}/include/minigui/common.h,
have_libminigui=yes, foo=bar)

#./autogen.sh
#./configure --prefix=/usr/arm-linux /
--host=i386-linux /
--build=arm -linux /
--target=arm -linux /
#make

If the compilation is successful, the minigui demonstration program will be generated in the current directory. If the compilation fails, it is mostly because your libminigui-1.3.3 configuration is incorrect.

5. Making the MiniGUI root file system

Create a new rootfs in the /opt directory. If you already have an available root file system, copy it to the rootfs directory and create a few new directories. As follows:
#cd /opt/rootfs/usr
#mkdir local
#cd local
#mkdir etc lib minigui
1. Copy the above resources to the /usr/local/ related directory. The method is as follows:
#cp –a /usr/arm-linux/lib/*.* /opt/rootfs/usr/local/lib/
#cp –a /usr/arm-linux/etc/*.* /opt/rootfs/usr/local/etc/
Copy the libjpeg, libpng, libttf, libz related libraries in the /usr/local/arm/2.95.3/arm-linux/lib/ directory to /opt/rootfs/usr/local/lib/, and bring the -a parameter when copying.

2. Make the library file work.
Modify ld.so.conf in the /opt/rootfs/etc/ directory and add /usr/local/lib to the modified file. To make the newly added library effective, execute
#ldconfig –r /opt/rootfs/
3. Copy the mde demonstration program
Copy the generated mde demonstration program to the /opt/rootfs/usr/local/minigui/ directory, only copy the related applications and res directories, and note that when copying mginit, copy mginit.rc as well
4. Modify MiniGUI.cfg
Modify MiniGUI.cfg to debug GAL engine first, and then debug IAL engine after debugging. Modify as follows: Other defaults:
# GAL engine
gal_engine=fbcon

# IAL engine
ial_engine=dummy //Modify here

mdev=none //Modify here
mtype=none //Modify here

[fbcon]
defaultmode=640x480-16bpp //Modify here, the LCD I use is 640x480

5. Make an image containing the minigui root file.
The Linux 2.6.11.1 kernel I use has already transplanted the Yaffs file system. You can use the mkyaffsimg tool to create a Yaffs root file system image. Burn it to the development board. I downloaded it via USB. The production method is as follows:
#cd /opt
#mkyaffsimg rootfs rootfs.img
This will generate a rootfs.img image file in /opt, download it to the development board and run it.

6. Some problems with MiniGUI initialization and their solutions.
There will be some problems when running mginit according to the above method. If running according to the above MiniGUI.cfg configuration, the following problems will appear:
Problem 1
[root@FriendlyARM mginit]# ./mginit
640x480 LCD
GAL ENGINE: Can't open /dev/tty0: No such file or directory
NEWGAL: Set video mode failure.
Error in step 3: Can not initialize graphics engine!
InitGUI failure when using /usr/local/etc/MiniGUI.cfg as cfg file.
Solution:
#mknod /dev/tty0 c 4 0

There will still be errors when running mginit, as follows:
Problem 2
LoadSharedResource: No such file or directory
Error in step 7: Can not load shared resource!
InitGUI failure when using /usr/local/etc/MiniGUI.cfg as cfg file.
[root@FriendlyARM mginit]
#Solution:
mkdir /var/tmpIn
this way, you can see the minigui preliminary interface. If you force exit, the following problem will appear when you run mginit next time:
Problem 3:
Error in step 3: There is already an instance of 'mginit'!
Solution:
Delete the two minigui files in the /var/tmp directory.

VII. Adding the input engine
The above operations have not added the input engine. The input engine available for my development board is the USB mouse. The following is the process of adding the USB input engine.

1. Check the USB mouse device node

The method is to check the changes in the /dev/input/directory when the USB mouse is not inserted and when the USB mouse is inserted. I have an additional mouse1 in the /dev/input directory, which means that the device node of my USB mouse is /dev/input/mouse1. Link this node to /dev and rename it to mouse, that is:
#ln –s /dev/input/mouse1 /dev/mouse

2. Configure the MiniGUI.cfg file (can be modified through the serial port)
Configure the MiniGUI.cfg file, mainly to add the input engine, the adding method is as follows:
# GAL engine
gal_engine=fbcon

# IAL engine
ial_engine=console //Add here

mdev=/dev/mouse //Add here
mtype=PS2 //Add here

[fbcon]
defaultmode=640x480-16bpp
. This will add my USB mouse, modify mginit.rc, automatically execute the same program, and then run mginit and a dialog box will pop up. Click OK and you will enter the minigui interface. There will be problems clicking the start button in the lower left corner. Other games can be used.

[1] [2]
Keywords:MiniGUI Reference address:My MiniGUI transplant journey

Previous article:Embedded Web Server on S3C4510 - Transplantation of boa under uclinux
Next article:Transplantation of Linux frame buffer device driver framework and graphical interface GUI

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号