This example will demonstrate how to use the deep compiler to translate a simple Java program and run it on a Zybo board.
import java.io.PrintStream; import org.deepjava.runtime.zynq7000.driver.UART; public class HelloWorld { static { // Initialize UART (115200 8N1) UART uart = UART.getInstance(UART.pUART1); uart.start(115200, UART.NO_PARITY, (short)8); // Use the uart for stdout System.out = new PrintStream(uart.out); // Print a string to the stdout System.out.println("Hello world"); } }
#deep-1 meta { version = "Mon Jan 05 12:40:12 CET 2020"; description = "deep project file for HelloWorld"; } project HelloWorld { libpath = "\\ost.ch\dfs\bsc.sys\public-programme\deep\lib"; boardtype = Zybo; ostype = sts_arm; programmertype = openOCD; programmeropts = localhost_4444; imgfile = "D:\work\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 COM port number. Check your host operating settings for this number.