Difference between revisions of "Category:BareMetal"

From Gumstix User Wiki
Jump to: navigation, search
(Created page with "==Setup the cross compiling environment== The one I used is Sourcery CodeBench Lite Edition, you can get it from its website.(http://www.mentor.com/embedded-software/sourcery-too...")
 
Line 1: Line 1:
==Setup the cross compiling environment==
+
=Setup the cross compiling environment=
The one I used is Sourcery CodeBench Lite Edition, you can get it from its website.(http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/)
+
The one I used is Sourcery CodeBench Lite Edition, you can get it from [http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/ its website] <br />
Please choose the eabi verison and format tar.bz2(This is what I used arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2)
+
Please choose the eabi verison and format tar.bz2(I used arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2) <br />
Untar the file
+
Untar the file<br />
  mkdir ~/overo-standalone
+
  $ mkdir ~/overo-standalone
  cd ~/overo-standalone
+
  $ cd ~/overo-standalone
  tar xvjf arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
+
  $ tar xvjf arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
Add the bin to your PATH
+
Add the bin to your PATH<br />
  export PATH=$PATH:~/overo-standalone/arm-2008q3/bin
+
  $ export PATH=$PATH:~/overo-standalone/arm-2008q3/bin
  
==Write the program==
+
=Write the program=
The following two Hello World program has been tested on an overo
+
The following two Hello World program has been tested on an overo<br />
You have test with them
+
You can play with them<br />
  
==Compile the program==
+
=Compile the program=
Get into the desired folder
+
==Assembly verison==
  cd c/ or  cd asm/
+
  $ cd asm/
Run the compile files in c program folder
+
Use make to compile the asm program<br />
sh compile
+
  $ make
Use make to compile the asm program
+
  make
+
  
==Run the program==
+
Boot.asm
You needed a flashed, bootable MicroSD. You can make one by using Sakoman's scripts (mkcard.sh and mksdcard.sh from http://www.sakoman.com/downloads.html)
+
[[File:Example.jpg]]
Copy the .bin file generated by the compiler to the boot drive on the SD card
+
 
  cp *.bin /media/boot/
+
==C version==
Umount the SD card
+
$ cd c/
  umount /media/boot
+
Run the compile file in c program folder<br />
  umount /media/rootfs
+
$ sh compile
Plug the SD card in overo and connect the overo on a Tobi expansion board
+
=Run the program=
Power it up and go into serial console
+
You needed a flashed, bootable MicroSD. You can make one by using Sakoman's scripts ([http://www.sakoman.com/downloads.html mkcard.sh and mksdcard.sh])<br />
When the console prompt "Hit any key to stop autoboot", please hit any key
+
Copy the .bin file generated by the compiler to the boot drive on the SD card<br />
  mmc list
+
  $ cp *.bin /media/boot/
  mmc part
+
Umount the SD card<br />
  fatls mmc 0:1
+
  $ umount /media/boot
  fatload mmc 0:1 0x80200000 uimage
+
  $ umount /media/rootfs
  go 0x80200000
+
Plug the SD card in overo and connect the overo on a Tobi expansion board<br />
 +
Power it up and go into serial console<br />
 +
When the console prompt "Hit any key to stop autoboot", please hit any key<br />
 +
  # mmc list
 +
  # mmc part
 +
  # fatls mmc 0:1
 +
  # fatload mmc 0:1 0x80200000 uimage
 +
  # go 0x80200000
  
 
By now you should see "Hello world!" poping in the console
 
By now you should see "Hello world!" poping in the console

Revision as of 14:30, 21 September 2012

Setup the cross compiling environment

The one I used is Sourcery CodeBench Lite Edition, you can get it from its website
Please choose the eabi verison and format tar.bz2(I used arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2)
Untar the file

$ mkdir ~/overo-standalone
$ cd ~/overo-standalone
$ tar xvjf arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

Add the bin to your PATH

$ export PATH=$PATH:~/overo-standalone/arm-2008q3/bin

Write the program

The following two Hello World program has been tested on an overo
You can play with them

Compile the program

Assembly verison

$ cd asm/

Use make to compile the asm program

$ make

Boot.asm

File:Example.jpg

C version

$ cd c/

Run the compile file in c program folder

$ sh compile

Run the program

You needed a flashed, bootable MicroSD. You can make one by using Sakoman's scripts (mkcard.sh and mksdcard.sh)
Copy the .bin file generated by the compiler to the boot drive on the SD card

$ cp *.bin /media/boot/

Umount the SD card

$ umount /media/boot
$ umount /media/rootfs

Plug the SD card in overo and connect the overo on a Tobi expansion board
Power it up and go into serial console
When the console prompt "Hit any key to stop autoboot", please hit any key

# mmc list
# mmc part
# fatls mmc 0:1
# fatload mmc 0:1 0x80200000 uimage
# go 0x80200000

By now you should see "Hello world!" poping in the console

This category currently contains no pages or media.