2014年6月22日 星期日

[Raspberry Pi] Build up toolchain in ubuntu 10.04


[Raspberry Pi] Build up toolchain in ubuntu 10.04




  1. Install package



    sudo apt-get install make git-core ncurses-dev

     


  2. Download lastest toolchain



    git clone https://github.com/raspberrypi/tools.git



    remote: Reusing existing pack: 17273, done.

    remote: Total 17273 (delta 0), reused 0 (delta 0)

    Receiving objects: 100% (17273/17273), 311.52 MiB | 343 KiB/s, done.

    Resolving deltas: 100% (11698/11698), done.

    Checking out files: 100% (15860/15860), done.


  3. Edit .bashr



    vi ~/.bashrc

    export PATH=$HOME/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin



  4. write a simple program to hello.c



    vi hello.c

    #include

    int main()

    {

    printf(“hello, world\n”);

    return 0;

    }



  5. Compile this program



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



  6. Send hello-arm to Board then excute program.



    Show “hello, world” mean successfully.




 


Reference



1.Development Environment for the Raspberry Pi using a Cross Compiling Toolchain and Eclipse

1.[進階] 安裝 Raspberry Pi 的 Toolchain


Related Posts:

0 意見:

張貼留言