S3C2440 cross-compilation environment construction

Publisher:SereneHeartLatest update time:2019-04-26 Source: eefocusKeywords:S3C2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Find the cross-compilation tool package arm-linux-gcc-4.4.3.tar.gz in the tool directory of Wei Dongshan's "Linux Development and User Manual" CD. The installation steps are as follows:


1. Unzip the cross-compilation development toolkit


       sudo tar xvzf arm-linux-gcc-4.4.3.tar.gz -C /

      Unzip the toolchain to the root directory. You can specify any directory you want. The system will add the directory /opt/FriendlyARM/toolchain/4.4.3/


2. Modify the environment variables and add the path of the cross compiler to PATH


      Use the method of modifying the /etc/bash.bashrc file (there are other methods)


      ①Open the file with vim:


        #sudo vim /etc/bash.bashrc


      ②Create a new line at the end and add:


        export PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin


3. Make the new environment variables take effect immediately without restarting the computer:


     #source /etc/bash.bashrc

{

  This is another way to modify the environment variables above

   ① $sudo -i Enter your own password to enter super user privileges


    ② cd /root/

       vim .bashrc


    ③ Add export PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin (path) at the end (note that there should be no space around the equal sign)


    ④ source ~/.bashrc (takes effect immediately) (it seems to be only for this terminal, log out and the environment variable will always exist)


}

4. Check whether the path is added to PATH


    #echo $PATH


    If the displayed content contains the directory where the cross-compiler just added is located, it proves that the compilation environment has been installed successfully.


5. Test whether the installation is successful


Instruction: #arm-linux-gcc -v


The above command will display the arm-linux-gcc information and version, and the displayed content information is:


At this point, the installation is successful.


6. Compilation experiment


Write a HelloWorld program to test cross-tool connection


Write the following HelloWorld program and save it as hello.c


#include


int main()


{


    printf("HelloWorld!n");


    return0;


}


Execute the following command:


   #arm-linux-gcc-o hello hello.c


If there is no error, it means the installation is successful.


Keywords:S3C2440 Reference address:S3C2440 cross-compilation environment construction

Previous article:s3c2440 bare metal system clock and timer settings
Next article:2440 bare board program clock initialization

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号