(Mini2440) Build a cross-compiling environment + configure the Linux kernel, mini2440linux

Source: Internet
Author: User
Tags ftp client

(Mini2440) Build a cross-compiling environment + configure the Linux kernel, mini2440linux
(Mini2440) create a cross-compiling environment + configure the Linux Kernel

System ubuntu12.04 (not virtual machine)
Mini2440
CPU: S3C2440AL-40
Nanflash model: K9F1G08
Norflash model: SST39VF1601
LCD: tongbao 240x320
$: Normal account
#: Root Account
* You can use the tab key to automatically complete a path input in shell.


(1) Build a cross-compilation environment

1. Copy the linux folder on the mini2440 CD to/home/lianghuiyong and rename it Linux_share.
(Two of the documents are added to my post)


2. Press Ctrl + Alt + T to open the shell.
3. $ su-root (switch root permission)
4. # cd/home/lianghuiyong/Linux_share
5. Unzip and install the arm-linux-gcc editor.
# Tar xvzf arm-linux-gcc-4.4.3.tar.gz-C // Note: C is followed by a space
Run this command to install arm-linux-gcc to the/usr/loca/arm/4.4.3 directory. This is from the mini2440 user manual. I found that it is actually installed in the/opt/FriendlyARM/toolchain/4.4.3 directory.

6. # vim/root/. bashrc
7. add: export PATH = $ PATH:/opt/FriendlyARM/toolschain/4.4.3/bin/opt/FriendlyARM/toolschain/4.4.3/bin to the last line as the arm-linux-gcc environment variable.
: Wq is saved and exited.
# Source ~ /. Bashrc
8. # sudo gedit/etc/environment
Add tags after games




9. # arm-linux-gcc-v // there is a space behind gcc




Test hello. c # cd/opt/FriendlyARM/mini2440/examples/hello
# Arm-linux-gcc-o hello. c
#./Hello


(2) install the source code and other tools to create a working directory (the following are for the root environment ):
# Mkdir-p/opt/FriendlyARM/mini2440


1> decompress and install the Linux kernel source code
# Cd/opt/FriendlyARM/mini2440
# Tar xvzf/home/lianghuiyong/Linux_share/linux-2.6.32.2-mini2440-20100106.tar.gz


2> decompress and install the source code of the embedded graphics system qtopia.
# Cd/opt/FriendlyARM/mini2440
# Tar xvzf/home/lianghuiyong/Linux_share/x86-qtopia.tgz
# Tar xvzf/home/lianghuiyong/Linux_share/arm-qtopia.tgz


3> unzip and install embedded graphics system QtE-4.6.1 source code
# Cd/opt/FriendlyARM/mini2440
# Tar xvzf/home/lianghuiyong/Linux_share/arm-qte-4.6.3-20100802.tar.gz


4> decompress and install the busybox source code
# Cd/opt/FriendlyARM/mini2440
# Tar xvzf/home/lianghuiyong/Linux_share/busybox-1.13.3-mini2440.tgz


5> decompress and install the Linux sample program
# Cd/opt/FriendlyARM/mini2440
# Tar xvzf/home/lianghuiyong/Linux_share/examples-20100108.tgz


6> decompress and install the vboot source code
# Cd/opt/FriendlyARM/mini2440
# Tar xvzf/home/lianghuiyong/Linux_share/vboot-src-20100106.tar.gz


7> decompress and install the source code of bootloader.
# Cd/opt/FriendlyARM/mini2440
# Tar xvzf/home/lianghuiyong/Linux_share/bootloader. tgz


8> decompress the package to create the target file system.
# Cd/opt/FriendlyARM/mini2440
# Tar xvzf/home/lianghuiyong/Linux_share/rootfs_qtopia_qt4-20100816.tar.gz


9> decompress and install the target file system image creation tool mkyaffs2image.
# Cd/opt/FriendlyARM/mini2440
# Tar xvzf/home/lianghuiyong/Linux_share/mkyaffs2image. tgz-C/


10> decompress and install LogoMaker
# Cd/opt/FriendlyARM/mini2440
# Tar xvzf/home/lianghuiyong/Linux_share/logomaker. tgz-C/




(3) Customized Linux kernel and File System

Config_mini2440_x35-Kernel configuration file for Sony 3.5 "LCD
Config_mini2440_t35-Kernel configuration file for tongbao 3.5 "LCD
Config_mini2440_l80-Kernel configuration file for Sharp 8 "LCD (or compatible)
Config_mini2440_n35-Kernel configuration file for NEC3.5 "LCD
Config_mini2440_h43-Kernel configuration file for the 4.3 "LCD
Config_mini2440_a70-Kernel configuration file for Group Creation 7 "LCD
Config_mini2440_vga1024x768-kernel for VGA display output (resolution: 1024x768) Module
Configuration File


1. Configure the default file config_t35 (tongbao 240x320)

# Cd/opt/FriendlyARM/mini 24/linux-2.6.32.2
# Cp config_mini2440_t35. config
# Make menuconfig
Page appears
Do not change. exit and exit. This is to generate the header file for the corresponding configuration (tongbao 240x320.


2. Compile the kernel

Compile the kernel in/opt/FriendlyARM/mini2440/linux-2.6.32.2 directory
# Make zImage
After compilation, the linux kernel image file zImage will be generated under the arch/arm/boot directory (zImage can be downloaded to the Development Board for testing)


3. Customize the Linux kernel (refer to the user manual)

# Cd/opt/FriendlyARM/mini 24/linux-2.6.32.2
# Make menuconfig
Configuration options are displayed:


3.1 configure cpu
Main Menu --> System --> Type S3C2400 Machines --> FriendlyARM Mini2440 development board
3.2 LCD Driver Configuration
Main Menu --> Device Drivers --> Graphics support --> Support for frame buffer devices --> Backlight --> LCD select --> 3.5 inch 240x320 Toppoly LCD


3.3 configure Touch Screen
Main Menu --> Device Drivers --> Input device support --> Touchscreens --> Samsung s3c24410 touchscreen input driver


3.4 configure usb mouse and keyboard
Main Menu --> Device Drivers --> hid devices --> USB Human interface Device


3.5 configure the USB flash drive
Main Menu --> Device Drivers --> SCSI device support --> SCSI disk


3.6 configure the universal drive USB camera
Main Menu --> Device Drivers --> Multimedia devices --> Video capture adapters --> V4L USB devices --> GSPCA based webcams --> ALi USB m 5602 Camera Driver


3.7 configure the CMOS camera driver
Main Menu --> Device Drivers --> Multimedia devices --> Video capture adapters --> OV9650 on the s3c2440 driver




3.8 configure the NIC Driver
Main Menu --> Netwoking support --> Networking options --> select Unix and TCP/IP


Main Menu --> Device Drivers --> Network device support --> Ethernet (10 or 100 Mbit) -->
Select <*> Generic Media Independent Interface device support
<*> DM9000 support


3.9 configure a USB wireless NIC Driver
Main Menu --> Netwoking support --> wireless --> IEEE 802.11


Main Menu --> Device Drivers --> Netwoking device support --> wireless LAN --> Wireless LAN (IEEE 802.11) --> Ralink driver support -->


3.10 configure the audio driver
Main Menu --> Device Drivers --> Sound card supprt --> OSS Mixer API --> ALSA for Soc audio support --> SoC Audio for the samsung S3Cxxxx Chips


3.11 configure the SD/mmccard driver
Main Menu --> Device Drivers --> MMC/SD/SDIO card --> samsung S3C SD/MMC card


3.12 Support for dog driver Configuration
Main Menu --> Device Drivers --> Watchdog Timer --> s3c2440 Watchdog


3.13 configure LED driver
Main Menu --> Device Drivers --> Character devices --> LED support for Mini2440


3.14 configure the key driver
Main Menu --> Device Drivers --> Character devices --> Buttons driver


3.15 configure PWM control buzzer driver
Main Menu --> Device Drivers --> Character devices --> buzzer driver


3.16 configure the adconverter driver
Main Menu --> Device Drivers --> Character devices --> ADC driver


3.17 configure the serial port driver
Main Menu --> Device Drivers --> Character devices --> Serial drivers --> samsung S3C2440/S3C2442


3.18 how to configure the RTC real-time clock driver
Main Menu --> Device Drivers --> Real Time Clock --> samsung S3C series SoC RTC


3.19 configure I2C-EEPROM drive support
Main Menu --> Device Drivers --> I2C support --> I2C Hardware Bus support --> S3C2410 I2C Driver


3.20 configure the support for the yaff2s File System
Main Menu --> Device Drivers --> MTD --> NAND Device Support --> nand flash Support
Main Menu --> File systems --> Miscellaneous filesystems --> YAFFS2 file system support


3.21 configure EXT2, VFAT, NFS, and other file systems
Main Menu --> File systems --> Network File Systems --> root file system on NFS


To support the FAT32 file system.
Main Menu --> File systems --> DOS/FAT/NT Filesystems --> VFAT (windows-95) fs support


For more information about how to save the mini2440 Linux kernel cropping, click Save!


3.22 create a Linux logo


If you want to use Logomaker, the images generated by the result are non-data, which may be related to some system parameters.
Use commands to create a logo:
Under the image (open_show.png) Directory
# Pngtopnm open_show.png> temp. ppm
# Ppmquant 224 temp. ppm> temp2.ppm
# Pnmnoraw temp2.ppm> logo. ppm
Change the logo. ppm generated in the directory to linux_logo_clut224.ppm, replacing the file with the same name in the linux2.6.32.2/drivers/video/logo directory.


(4) Create the target board (mini2440) under the system image root
# Cd/opt/FriendlyARM/mini2440

# Mkyaffs2image-128M rootfs_qtopia_qt4 rootfs_qtopia_qt4.img




In this way, the rootfs_qtopia_qt4.img image file is generated in the current directory. You can use a USB Flash to write the file to 128 M Nand Flash.
At this point, the cropped linux system image is complete!
How to build a cross-compiling environment in Linux

The application development environment based on the Linux operating system is generally composed of the target system hardware (Development Board) and the host PC. The target hardware development board is used to run the operating system and system application software, the kernel compilation and application development and debugging of the operating system used by the target Board need to be completed through the host PC (therefore called cross-compilation ). Generally, the two parties establish a connection through a serial port, a parallel port, or an Ethernet interface. However, I suggest you build the following cross-compilation environment for individual or R & D teams to use: Use a single PC (PII or above, just use the old machines that have been eliminated before ), to install a Linux operating system (such as Red Hat Linux 8.0 or later) on the PC, you can use the default installation option (including the FTP service). This PC is used as a Linux server, in addition to the Administrator, it is generally not allowed to be operated by others directly. Connect the Linux server to the LAN and create some valid users so that the legitimate users of other PCs (referred to as workstation) can access the Linux server. Other PCs (workstations) still use the Windows operating system. Required software tools include: 1. FTP client programs (such as Cuteftp, which can be downloaded online ). 2. Telnet tool (such as SecureCRT, which can be downloaded from the Internet ). 3. source code of the Linux operating system kernel transplanted to a specific ARM platform (usually provided by the vendor ). 4. GNU compilation tools can be downloaded from related websites or provided by vendors. Install the FTP client program and Telnet tool on a PC of a workstation. After installation, you can transfer files between the PC and the Linux server of the workstation, you can also log on to the Linux server through Telnet on the workstation PC (you may need to disable the Firewall Service of the Linux Server ). Install On a Linux Server: transfer the Linux operating system kernel source code package on the PC of the workstation and the GNU compilation tool to a directory (such as a valid user directory) on the Linux server through FTP ), decompress the package in the directory and install the GNU compilation tool to the default working directory. The above work is done by using the Telnet tool on the workstation PC, instead of on the Linux server. Compiling the Linux operating system kernel: there is usually a fixed step for compiling the Linux operating system kernel, which may vary slightly depending on the MakeFile file. For details, refer to the relevant documentation, the compilation is completed on the workstation PC using the Telnet tool.

The establishment of the arm-linux cross-compilation environment is expected to be answered by people who are clear about the replication.

This is the case. In computer linux, the original gcc is for general-purpose X86 and Other Processors. Compiled executable files can only run on general-purpose computers, and arm is also a kind of processor, however, its commands are different from those of CPUs such as X86. Therefore, a compiler for arm must compile the source program to run the program in arm.
I have worked on linux and qt programming in ARM9. I need to first install linux on a PC, then install arm-linux-gcc, and compile the program in order to use arm-linux-gcc, you need to specify the environment variable. profile and other files, you can find the specific method. You can also use the export command to set environment variables in the terminal. The results of the two methods are different!
If you want to use the 2440 Development Board, it will be ARM9. I haven't found the simulation tool for ARM9. however, there is already a simulation tool for arm7.
For arm-linux-gcc, after installing and setting the path (environment variable), enter # arm-linux-gcc-v in a terminal
Generally, you can see the information about the installed arm-linux-gcc version. At this point, you can use it to compile your source program, then download the generated executable file to the arm Development Board to run it.
Let's talk about another question. I also found it out by myself. It may be a month before I successfully ran my first qt graphic interface program on arm. Good luck!
My suggestions:
1. Familiar with linux operating commands (such as export)
2. Learn how to download executable files to arm
3. Learn to use pc to control linux on arm

I have only used arm-linux-gcc and can find it in your installation folder.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.