This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
first_example_zybo [2020/09/06 16:25] – created ursgraf | first_example_zybo [2020/09/23 10:01] – ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
This example will demonstrate how to use the deep compiler to translate a simple Java program and run it on a [[https:// | This example will demonstrate how to use the deep compiler to translate a simple Java program and run it on a [[https:// | ||
Line 7: | Line 7: | ||
- On the Target Library wizard page you have to choose where the deep target runtime library is located. You can use the default library path or uncheck the box and browse to the location where you've installed the library. You can always set the default library path in [[eclipse: | - On the Target Library wizard page you have to choose where the deep target runtime library is located. You can use the default library path or uncheck the box and browse to the location where you've installed the library. You can always set the default library path in [[eclipse: | ||
- Target Configuration: | - Target Configuration: | ||
- | - Select a board: //NTB MPC555 header board// | + | - Select a board: //Zybo Zynq-7000 digilent evm// |
- | - Select a programmer: //NTB MPC555 USB-BDI// | + | - Select a operating System: //Simple Tasking System for ARM// |
- | - Select a operating System: //NTB Simple Tasking System for PPC// | + | - Select a programmer: //OpenOCD// |
- | - If you like to have an image file, you can select | + | - Select programmer options: // |
+ | - Select the checkbox // | ||
- Project name: | - Project name: | ||
- Choose a project name (no spaces, no special characters such as " | - Choose a project name (no spaces, no special characters such as " | ||
Line 20: | Line 21: | ||
- Open class and enter source code:< | - Open class and enter source code:< | ||
import java.io.PrintStream; | import java.io.PrintStream; | ||
- | import ch.ntb.inf.deep.runtime.mpc555.driver.SCI; | + | import ch.ntb.inf.deep.runtime.zynq7000.driver.UART; |
public class HelloWorld { | public class HelloWorld { | ||
static { | static { | ||
- | // 1) Initialize | + | // Initialize |
- | SCI sci1 = SCI.getInstance(SCI.pSCI1); | + | UART uart = UART.getInstance(UART.pUART1); |
- | sci1.start(9600, SCI.NO_PARITY, (short)8); | + | uart.start(115200, UART.NO_PARITY, (short)8); |
- | // 2) Use SCI1 for stdout | + | // Use the uart for stdout |
- | System.out = new PrintStream(sci1.out); | + | System.out = new PrintStream(uart.out); |
- | // 3) Say hello to the world | + | // Print a string |
System.out.println(" | System.out.println(" | ||
} | } | ||
Line 47: | Line 48: | ||
project HelloWorld { | project HelloWorld { | ||
libpath = " | libpath = " | ||
- | boardtype = ntbMpc555HB; | + | boardtype = Zybo; |
- | ostype = ntbSTS_ppc; | + | ostype = sts_arm; |
- | programmertype = ntbMpc555UsbBdi; | + | programmertype = openOCD; |
+ | programmeropts = localhost_4444; | ||
+ | imgfile = " | ||
+ | imgformat = BIN; | ||
+ | # pl_file = none; | ||
# enter names of rootclasses, | # enter names of rootclasses, | ||
# | # | ||
rootclasses = " | rootclasses = " | ||
- | |||
- | # imgfile = " | ||
- | # imgformat = BIN; | ||
} | } | ||
</ | </ | ||
- | - Connect the hardware to your host PC by an USB cable and apply power to the target. | + | - Connect the hardware to your host machine |
+ | - Make sure that you select the proper driver for your adapter [[https:// | ||
+ | - Start [[https:// | ||
- Open a terminal program such as '' | - Open a terminal program such as '' | ||
- Create a new run configuration by marking the project file // | - Create a new run configuration by marking the project file // | ||
- | - //Run// will compile, link and download the program. | + | - //Run// will compile, link and download the image file. For downloading and debugging [[openocd: |
- The terminal window will show //Hello, World//. | - The terminal window will show //Hello, World//. | ||
- | - With {{run.jpg}} you can recompile and rerun the programm. | + | - With {{run.jpg}} you can recompile and rerun the program. |
- | - See [[eclipse: | + | |
- | + | ||