Group members: 20135310 Chen Chaojan 20135305 Liao
I. Purpose and requirements of the experiment:
- Understanding the target platform and development platform
- Preliminary understanding of hardware development platform construction
- Preliminary understanding of the process of hardware development
- Ability to compile and run simple programs
- Mastering program debugging and Testing methods
Two. Experimental content
- Based on ARM development platform. Software installation, hardware connection, familiar with the development process, master the program loading, debugging and testing methods
- Familiar with Linux development environment, learn the configuration and use of Linux development environment. Use Linux ARMV4L-UNKNOWN-LINUX-GCC compilation, use NFS-based download debugging to understand the basic process of embedded development
Three. Experimental steps
Connecting the ARM Development Board
Connect the ARM Development Board power Cord to keep the board switch closed. The serial line, the line and the network cable are connected with the PC machine separately.
Set up Super Terminal
Run Windows XP system under start → all programs → accessories → communications → hyperterminal. Create a new communication terminal, named Arm. In the Properties dialog box, set the baud rate to 115200, the data bit to 8, no parity, stop bit 1, no data flow control. Save As on desktop
Start the experimental platform
Open the HyperTerminal and turn on the arm machine power switch. Wait a minute and the information from the arm machine is displayed in the HyperTerminal window. Continue waiting until the interface appears. Enter the Ifconfig command to record the IP of the arm machine as: 192.168.0.121
- Modify the IP of the XP system and the Redhat virtual machine so that they all have the same network segment as the ARM machine IP
Installing the ARM compiler
In the PC "Start", "Run", enter the virtual machine's IP. \\192.168.0.234, enter the username BC, password 123456 and then OK, you can access the virtual machine's files. Then extract the required files to the shared folder BC. Enter the virtual machine, enter the./install.sh on the command line, the setup script will automatically create the directory, configure the compilation environment
Configuring Environment variables
Use VI in the virtual machine to modify the PATH variable in the/root/.bash_profile file to path= $PATH: $HOME/bin:/opt/host/armv4l/bin/(because the file is a hidden system file, use LS Command not visible), after disk execution: Source/root/.bash_profile, then ARMV4L-UNKNOWN-LINUX-GCC will automatically search, you can enter on the terminal
Build the hello.c file and compile it
Enter the folder/ROOT/BC in the virtual machine and write the hello.c file in this directory. Compile the hello.c with the command ARMV4L-UNKNOWN-LINUX-GCC and generate a hello executable file
Download Debug
Mount the shared folder in HyperTerminal to establish communication between the Development Board and the virtual machine. Enter the command "mount-t nfs-o nolock 192.168.0.234:/root/bc/host", run the compiled hello executable in HyperTerminal, print the team member's number
Three. The problems encountered during the experiment and the solving methods
Problem: Open HyperTerminal, turn on arm power switch, wait for some time to find the arm machine information is not displayed in the HyperTerminal window
Workaround: Restart the computer, set up the HyperTerminal again, the information of the ARM machine successfully displayed
Question: What is the meaning of "armv4l-unknown-linux"? What is the connection to "gcc hello.c–o hello"?
Workaround: Armv4l-unknown-linux: This is the Cross compiler (ARM-LINUX-GCC) compile command for the Development Board program compilation. (The cross compiler is used for scenarios where we do not allow or cannot install the compilers we need; The destination platform is resource-poor, unable to run the compiler we need; The destination platform has not been established, no operating system)
GCC hello.c–o hello: Usually in the Linux system for C programs compiled using the host compiler, command for the GCC hello.c can
Problem: Arm machine information display after input ifconfig does not display the correct IP information
WORKAROUND: The arm machine should continue to wait for the arm machine to load after the information is displayed. So we re-established the HyperTerminal, waiting for all the information to be loaded and then input ifconfig, and the result is the same as the experimental instruction
Issue: When a shared folder is mounted in HyperTerminal, when communication between the Board and the virtual machine is established, the "Mount-t nfs-o nolock 192.168.0.234:/root/bc/host" command is found to fail to run the hello executable file in HyperTerminal
Workaround: After the failure in HyperTerminal, we analyze the possible problem is that the executable file is not in the ROOT/BC directory, so we find the directory and found that the directory does not exist. Then we used LS to find the executable file of Hello, found it under HOME/BC, finally run successfully
Four. Experimental experience
Through this experiment, familiar with the Linux development environment, learned the configuration and use of the Linux development environment, can compile, run a simple program, mastered a number of program debugging and testing methods. In the experiment, I learned a method of self-study. In the experiment, we should have the ability of flexibility, combine practice and theory closely, in order to grasp the learning better. In order to complete the experiment task accurately and quickly, we need to cooperate with the Division of labor. It is necessary to strictly follow the contents of the experimental instructions to carry out the steps, but also in each step to add their own thinking and try to gain more.
An experimental report on the basic experiment of information Security system Design (group)