[[mips_cross_compiler]]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
mips_cross_compiler [2014/02/16 17:57]
beckmanf [MIPS Cross Compiler build] - used HOME variable
mips_cross_compiler [2014/06/04 17:52]
beckmanf simple project added
Line 536: Line 536:
 make check-gcc RUNTESTFLAGS=--target_board=mips-sim make check-gcc RUNTESTFLAGS=--target_board=mips-sim
 </​code>​ </​code>​
 +
 +===== Install git and download a simple project ​ =====
 +
 +Install git and download a simple project
 +
 +<​code>​
 +sudo apt-get install git
 +cd
 +mkdir projects
 +cd projects
 +git clone https://​git.etech.fh-augsburg.de/​friedrich.beckmann/​myfirst.git
 +</​code>​
 +
 +Now you have the simple project "​myfirst"​ in your directory. ​
 +
 +=== Try the MIPS Cross Compiler ===
 +
 +Change to the src directory and compile the code with the cross compiler. ​
 +
 +<​code>​
 +cd myfirst
 +cd src
 +mipsel-none-elf-gcc -S hello.c
 +less hello.s
 +</​code>​
 +
 +Now you have the compiled assembler code "​hello.s"​. To compile to binary do: 
 +
 +<​code>​
 +mipsel-none-elf-gcc -o hello -Tidt.ld hello.c
 +</​code>​
 +
 +Now you have the binary "​hello"​. You can run the binary in the instruction set simulator with
 +
 +<​code>​
 +mipsel-none-elf-run hello
 +</​code>​
 +
 +This will run the binary with the mips instruction set simulator. You should see "Hello World"​. ​
 +
 +
  
 ===== Open OCD ===== ===== Open OCD =====
  • mips_cross_compiler.txt
  • Last modified: 2014/06/04 17:52
  • by beckmanf