Beijing Institute of Electronic Technology (BESTI)
Real Inspection report
Course: Cryptographic system Design Basic class: 1352 classes, 1353 classes
Name: Wangyue, Liu Hao No.: 20135232, 20135318
Score: Instructor: Lou Jia Peng Experimental Date: 2015.11.10
Experiment level: Preview degree: Experiment time: 15:30--18:00
Instrument Group: Compulsory/Elective: Experiment Number: 1
Experiment Name: experiment One familiar linux development environment
Experimental purposes and requirements: be familiar with the Linux development environment and learn the configuration and use of the Linux development environment based on s3c2410 . using linux ARMV41-UNKNOWN-LINUX-GCC compilation, using NFS -based download debugging understand the basic process of embedded development.
Experimental instrument:
Name |
Model |
Number |
PC Machine |
Lenovo |
1 |
Embedded experimental Platform |
Up-tech S2410 |
1 |
First, the contents of the experiment:
This experiment uses the Redhat Linux 9.0 operating system environment, installs the Arm-linux Development Library and the compiler, creates a new directory, and write the hello.c and makefile files in it, learn the programming and compiling process under Linux, as well as the use of the arm Development Board and the settings of the development environment, download the compiled files to the target Development Board to run.
Second, the experimental steps:
1. Connecting the ARM Development Board
Connect the ARM Development Board power Cord to keep the board switch closed. And then the serial line, the line and the network cable and the PC connection is good.
2. Set up Super Terminal
Run the 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 the desktop.
3. 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.
4. Modify the IP of the XP system and the Redhat virtual machine so that they are all in the same network segment as the arm machine's IP. In this experiment, the IP of the PC is set to 192.168.0.55,redhat virtual machine IP is 192.168.0.234.
Confirm after reboot:
5. Install 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, and the setup script will automatically establish the directory and configure the compilation environment.
6. 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 is not visible), after disk execution: Source/root/.bash_profile, then ARMV4L-UNKNOWN-LINUX-GCC will automatically search, you can enter on the terminal. Note the space!
7. 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 the executable file.
8. 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" (Note the space!) )
Run the hello executable that was compiled through the HyperTerminal.
Third, the problems encountered and solutions
1. Issue one: After compressing the required folder to the shared folder BC, enter the virtual machine and enter the./install.sh configuration compilation environment failed. Displays install.sh not found.
Workaround: We go into the folder to see if the file is in the end, found the unpacked folder Armv4l-tools inside there is a Armv4l-tools folder, so need to enter two times folder to be able to find install.sh. We entered the CD Armv4l-tools two times and then we succeeded.
2. Issue two: When the 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 run hello in HyperTerminal The executable failed, showing not found.
WORKAROUND: With LS view, did not generate HELLO.O file, but the default execution filename a.out, so we execute a.out, run successfully.
Iv. understanding of knowledge points and experience of experiment
1. What's the cross-compiling? Why do I need cross-compiling?
A compiler that runs in a computer environment can compile code that runs in another environment, which we call the compiler to support cross-compiling. This compilation process is called cross-compiling. Cross-compiling is synchronized with the extensive development of embedded systems. Cross-compiling is required for the following reasons: A. We do not allow or cannot install the compilers we need on the destination platform, and we need some of the features of this compiler; B. Resource-poor on the destination platform, unable to run the compiler we need; C. The purpose of the platform has not been established, even the operating system is not, simply not run what compiler. With the cross-compilation tool, we can compile executable programs for other platforms on a host platform (such as a PC) that has strong CPU power and sufficient storage controls.
2. What does each option in the Mount command mean in the experiment?
Generally, the "mount-t file type filename loaded directory", in such a format, you are here to mount the directory on the NFS server. 192.168.1.19 This is the NFS server side. The/nfs directory is mounted to the native/mnt directory.
Experiment Experience:
Through this experiment our team has a certain understanding of the Linux development environment, and learned the configuration and use of the Linux development environment based on s3c2410. Learn the knowledge of cross-compiling, and be able to use Linux ARMV41-UNKNOWN-LINUX-GCC to compile files, understand the basic process of embedded development. Through this experiment, our group only have a practical and in-depth understanding, and hope to gain more in practice in the future.
Experimental report (Experimental one)