This is an old revision of the document!
This example will demonstrate how to use the deep compiler to translate a simple Java program and run it on a mpc5200 board.
import java.io.PrintStream; import org.deepjava.runtime.mpc5200.driver.UART3; public class HelloWorld { static { // Initialize UART (9600 8N1) UART3.start(9600, UART3.NO_PARITY, (short)8); // Use the UART3 for stdout System.out = new PrintStream(UART3.out); // Print a string to the stdout System.out.println("Hello world"); } }
#deep-1 meta { version = "Mon Jan 05 12:40:12 CET 2015"; description = "deep project file for HelloWorld"; } project HelloWorld { libpath = "\\ost.ch\dfs\bsc.sys\public-programme\deep\lib"; boardtype = MicroZed; ostype = sts_arm; programmertype = openOCD; programmeropts = bdi3000inf01; imgfile = "D:\HelloWorld.bin"; # pl_file = none; # enter names of rootclasses, e.g. # rootclasses = "test.MyFirstTestClass","other.MySecondTestClass"; rootclasses = "test.HelloWorld"; }
putty
or realterm
. Alternatively open a terminal program as an eclipse view. Select the appropriate serial port number. Check your host operating settings for this number.If the boot loader uBoot is present on the board, it will start up and configure the memory and clocks. Now, it's possible to download a program without using an Abatron device. For this, you have to choose in step 4 the target configuration Phytec PhiCORE-MPC5200uBoot. This configuration is valid for the tiny and the io board. Connect a terminal program on PSC3 with 115200, no parity, 8 bit. Also connect the Ethernet of the board to your local server, which must have a TFTP server running. Run the following command:
tftp 0x400000 myDir/test.bin bin
Please make sure that your image file resides in the right directory on your TFTP server. Finally start your program with
go 0x400100