This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
first_example_mpc5200 [2020/09/06 14:48] – ursgraf | first_example_mpc5200 [2020/09/23 10:00] – 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 mpc555 target platform. For other platforms see at the bottom of this page. | + | This example will demonstrate how to use the deep compiler to translate a simple Java program and run it on a [[https:// |
- Start eclipse, choose a new workspace and open the deep perspective with //Window -> Open Perspective -> Other -> Deep//. | - Start eclipse, choose a new workspace and open the deep perspective with //Window -> Open Perspective -> Other -> Deep//. | ||
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: //Phytec PhiCORE-MPC5200io//, //Phytec PhiCORE-MPC5200tiny//, |
- | | + | - Select a operating System: //Simple Tasking System for PPC// |
- | - Select a operating System: //NTB Simple Tasking System for PPC// | + | - Select a programmer: //Abatron BDI2000/ |
- | - If you like to have an image file, you can select the corresponding checkbox. This option is not necessary if you use the //NTB MPC555 USB-BDI// to download to the target. \\ {{targetconfiguration555.png?300|}} | + | - Select programmer options: network name of your programmer, e.g. //bdi3000inf01// |
+ | | ||
- 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.mpc5200.driver.UART3; |
public class HelloWorld { | public class HelloWorld { | ||
static { | static { | ||
- | // 1) Initialize | + | // Initialize |
- | SCI sci1 = SCI.getInstance(SCI.pSCI1); | + | UART3.start(9600, |
- | sci1.start(9600, | + | |
- | + | // Use the UART3 for stdout | |
- | // 2) Use SCI1 for stdout | + | System.out = new PrintStream(UART3.out); |
- | System.out = new PrintStream(sci1.out); | + | |
- | + | // Print a string | |
- | // 3) Say hello to the world | + | |
System.out.println(" | System.out.println(" | ||
} | } | ||
Line 47: | Line 47: | ||
project HelloWorld { | project HelloWorld { | ||
libpath = " | libpath = " | ||
- | boardtype = ntbMpc555HB; | + | boardtype = MicroZed; |
- | ostype = ntbSTS_ppc; | + | ostype = sts_arm; |
- | programmertype = ntbMpc555UsbBdi; | + | programmertype = openOCD; |
+ | programmeropts = bdi3000inf01; | ||
+ | imgfile = " | ||
+ | imgformat = BIN; | ||
+ | # pl_file = none; | ||
# enter names of rootclasses, | # enter names of rootclasses, | ||
Line 55: | Line 59: | ||
rootclasses = " | rootclasses = " | ||
- | # imgfile = " | ||
- | # imgformat = BIN; | ||
} | } | ||
</ | </ | ||
- | - Connect the hardware to your host PC by an USB cable and apply power to the target. | + | - Connect the target through |
+ | - Install | ||
- 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 // | ||
Line 65: | Line 68: | ||
- 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 programm. | ||
- | | + | |
+ | ===== Downloading without Debugger ===== | ||
+ | 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// | ||
+ | Connect a terminal | ||
+ | Please make sure that your image file resides in the right directory on your TFTP server. Finally start your program with < | ||
+ | |||
+ | |||