Getting Started with embARC Using MetaWare on Windows 2017 - foss-for-synopsys-dwc-arc-processors/embarc_osp GitHub Wiki
The ARC EM Starter Kit is an FPGA-based solution for rapid software development, code porting, software debugging, and profiling, preloaded with images for the ARC EM Family of processors: EM4 and EM6 on EMSK v1.1, EM5D and EM7D on EMSK v2.0 and v2.1, EM9D and EM11D on EMSK v2.2. It can be extended using Digilent® Peripheral Modules (Pmods™).
This page tells how to get started with the MetaWare Development Toolkit or MetaWare Lite on Windows.
For Linux instructions, see Getting Started with embARC Using MetaWare on Linux.
This section tells you how to download and install the embARC Open Software Platform.
- To download the embARC Software, visit our User Forums section and create an account to access the download location.
- Unzip the software to your preferred location, such as
C:\ARC
. This step creates a subfolder calledembARC
.
Note: There should be no whitespace in the path to the embARC location. Whitespace causes problems when you build the examples using the provided makefiles.
Synopsys's premium toolchain for use with the ARC EM family of processors is the MetaWare Development Toolkit.
- Go to https://www.synopsys.com/dw/ipdir.php?ds=sw_metaware.
- Click Request Information or Order the DesignWare ARC MetaWare Development Toolkit and fill in the form to receive a quote.
- After the purchase is complete, run the installer you receive, and follow the on-screen instructions.
The MetaWare Development Toolkit requires a license from Synopsys. Follow instructions provided with the toolkit to set up a license. For additional help, see the MetaWare Quick Start Guide in the installed docs/pdf
folder.
The MetaWare Toolkit Lite Edition may also be used for evaluation purposes on Microsoft Windows. With it, you can build applications 32 K or less in size. See the Release Notes provided with the MetaWare Lite toolchain for additional restrictions.
- To download MetaWare Lite, register at https://www.synopsys.com/cgi-bin/arcmwtk_lite/reg1.cgi.
- After you click Continue, a download link with the activation key is sent to the registered email address.
- Click the download link in the welcome mail to download the software.
Ensure you have the following information before proceeding with the installation:
- Email address registered with Synopsys, Inc. to download MetaWare Lite.
- Activation key: You can find this information in the confirmation email from Synopsys, Inc.
- Double-click the executable file when the download completes.
- Follow the on-screen instructions to complete the installation process.
This page tells you how to build a simple example for EM7D using the MetaWare IDE. This functionality is the same in the MetaWare Development Toolkit and MetaWare Lite. For details on building and running your own applications, see also the MetaWare documentation in MetaWare/arc/docs/PDF
.
Each toolchain subfolder includes wide range of example folders containing embARC project files and pre-generated build and debug configurations for each example, pre-packaged as an Eclipse project.
This page uses the Contiki sensor demo as a tutorial. Other examples follow the same build and run steps. For additional documentation, see doc/embARC_Document.html
in the source-code archive.
This demo uses the following:
- Contiki OS running on EMSK
- Pmod temperature sensor and associated device driver
- GPIO drivers on EMSK
It is also a good simple test to confirm that the temperature sensor module is working and that your debugger connection is working correctly.
The embARC Software includes a folder called ide_projects
containing a subfolder for your EMSK board version (emsk_<xx>
). Each version subfolder contains subfolders for the desired toolchain (GNU or MetaWare). Each toolchain subfolder contains a wide range of examples, each in its own folder, with embARC project files and pre-generated build and debug configurations for the example, pre-packaged as an eclipse project.
All IDE projects for EMSK 1.1 are configured to target the ARC EM6 configuration by default. The default configuration for EMSK 2.0 and 2.1 is ARC EM7D. The default configuration for EMSK 2.2 is ARC EM11D.
- Open the MetaWare IDE and use the Workspace Launcher to choose
<embARC ROOT>/ide_projects/<emsk_xx>/metaware
, where<emsk_xx>
stands for the EMSK board version. This example uses EMSK 2.2 with MetaWare IDE, and the workspace is found under<embARC ROOT>/ide_projects/emsk_22/metaware
.
- Close the Welcome perspective if it appears.
- Select File > Import....
- Expand General and select Existing Projects into Workspace, then click Next.
- Use the Browse button to navigate to the location where you unzipped the embARC distribution and look for the
ide_projects/emsk_22/metaware
subdirectory (for example,/home/user/ARC/embARC/ide_projects/emsk_22/metaware
). The list of embARC example projects appear in the Projects section of the dialog. - Select the example that named
emsk_contiki_sensor
and click Finish. Importing may take several minutes, so it fastest to only import the desired projects.
- Confirm that the
emsk_contiki_sensor
example project appears in the Project Explorer on the left.
- Launch the MetaWare IDE and select the workspace where you previously imported embARC projects for your EMSK version and toolchain.
- In the Project Explorer, find the
emsk_contiki_sensor
project in the list. - If the project is closed (small icon showing a closed folder), double-click on the project name to open it.
- Right click on the project name, then select Build Configurations->Set Active->arcem7d.
- Right-click on emsk_contiki_sensor in the Project Explorer and choose Clean Project.
- Click on Console tab on the bottom of the screen to see the progress.
- Right-click on emsk_contiki_sensor in the Project Explorer and choose Build Project.
- Right click on the project name, then select Debug As > Debug Configurations.... The Debug Configurations dialog appears.
- Select emsk_contiki_sensor-arcem7d from the list under C/C++ application and click Debug.
- Confirm that the Debug perspective opens (if not, select the Debug perspective manually to see why not) and that execution has stopped at main().
- Click the Resume button (green arrow with yellow bar) on the toolbar to start program execution.
- Go to terminal window and confirm that you see the "Powered By embARC" banner and example print messages.
- Experiment with the buttons/LEDs/temperature sensor (touch it with your finger to change temperature) to confirm GPIO and the temperature sensor are working. Button 1 is the button labeled 'L,' button 2 is the button labeled 'R,' and button 3 is the button above the 'A' in the ARC logo.
- When finished, click the red Terminate button on the toolbar and return to the C/C++ Perspective.
The embARC Software includes a folder called example
containing all the source code and makefiles for the embARC example. The EMSK subfolder contains all the available examples for the EMSK board. For the Contiki sensor example, the example folder path is <embARC ROOT>/example/emsk/contiki/sensor
. You can build and run the example in command-line mode from inside the subfolder.
Note: For each example, you can use defined make
options BOARD
, BD_VER
, CUR_CORE
and TOOLCHAIN
to select different board versions, core configurations and development toolchains. For detailed documentation on each make options, refer to the example section of embARC documentation.
-
Open a Command Prompt, and
cd
to the Contiki sensor example folder:<embARC ROOT>/example/emsk/contiki/sensor
.c:\>cd c:\arc\embarc\example\emsk\contiki\sensor c:\ARC\embARC\example\emsk\contiki\sensor>dir Volume in drive C has no label. Volume Serial Number is 6A10-6445 Directory of c:\ARC\embARC\example\emsk\contiki\sensor 01/16/2016 02:54 PM <DIR> . 01/16/2016 02:54 PM <DIR> .. 01/08/2016 05:06 PM 701 makefile 01/08/2016 05:06 PM 4,623 sensor_example.c 2 File(s) 5,324 bytes 2 Dir(s) 77,525,000,192 bytes free
-
Type the following command to build the Contiki sensor example for ARC EM9D on the EMSK v2.2:
gmake BD_VER=22 CUR_CORE=arcem9d TOOLCHAIN=mw
The build progress is displayed.... "Compiling : " ../../../../arc/arc_exception.c ENTER DROP_DEAD_IF_EXPIRED stat from BOMBER_IS_EXPIRED=0 "Compiling : " ../../../../arc/arc_timer.c ENTER DROP_DEAD_IF_EXPIRED stat from BOMBER_IS_EXPIRED=0 "Assembling : " ../../../../arc/arc_exc_asm.s "Assembling : " ../../../../arc/arc_startup.s "Archiving : " obj_emsk_22/mw_arcem9d/libarc.a "Archiving : " obj_emsk_22/mw_arcem9d/libembarc.a "Linking : " obj_emsk_22/mw_arcem9d/sensor_example_mw_arcem9d.elf
-
Type the following command to run the Contiki sensor example in command line:
gmake BD_VER=22 CUR_CORE=arcem11d TOOLCHAIN=mw -j4 run
The command-line debugger launches:... "Download & Run obj_emsk_22/mw_arcem11d/sensor_example_mw_arcem11d.elf" mdb -run -arcv2em -nooptions -nogoifmain -toggle=include_local_symbols=1 -hard --+ -prop=dig_speed=5000000 obj_ emsk_22/mw_arcem11d/sensor_example_mw_arcem11d.elf [DIGILENT] This device supports JTAG7 scan formats. [DIGILENT] Device enumeration: #0 is `TE0604-03'=JTAG-ONB4. [DIGILENT] We choose device : #0 `TE0604-03' from 1 possible devices. [DIGILENT] Product=508 variant=1 fwid=57 firmware-version=10a. [DIGILENT] It is possible to set the JTAG speed. [DIGILENT] Current speed is 10000000 Hz. [DIGILENT] Attempting to set speed to 5000000 Hz. [DIGILENT] Speed was set to 5000000 Hz. [DIGILENT] Suppress these messages with environment variable DIG_VERBOSE=0.
The application launches in the terminal, and you see the "Powered By embARC" banner and example print messages.
-
Experiment with the buttons, LEDs, and temperature sensor (touch the sensor with your finger to change the temperature) to confirm that GPIO and the temperature sensor are working. Button 1 is the button labeled 'L,' button 2 is the button labeled 'R,' and button 3 is the button above the 'A' in the ARC logo.
-
When you are finished, press CTRL + c in the terminal where the command is being executed. Enter 'q' and press enter to exit the debugger.
-
Enter 'q' and press enter to exit the debugger.