Skip to content

Getting Started with embARC Using GNU on Windows 2017

Qiang Gu edited this page Feb 22, 2018 · 2 revisions

Note: This page is only available for embARC 2017.03.


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™).

For Linux instructions, see Getting Started with embARC Using GNU on Linux.

Downloading and Installing

Downloading and Installing the embARC Software

This section tells you how to download and install the embARC Open Software Platform.

  1. To download the embARC Software, visit our User Forums section and create an account to access the download location.
  2. Unzip the software to your preferred location, such as C:\ARC. This step creates a subfolder called embARC.
    Installed embARC Directory

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.

Downloading and Installing the Eclipse IDE with GNU Toolchain for ARC

Prebuilt versions of the ARC GNU tools are available from the GitHub website.

  1. Download the latest release installer from https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases.
    GNU Toolchain for ARC Download Page
  2. Run the installer and install the IDE in default location: C:\arc_gnu Note: This location is required for the example scripts to run properly.

Building and Running Your First Example

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.

This tutorial assumes that you have set up the EMSK hardware and installed PuTTY or equivalent, as described in Setting up the EM Starter Kit.

Using the IDE

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.

Importing the Project

Importing the Example IDE Projects

The embARC Software includes a folder called ide_projects, with subfolders for the supported EM Starter Kit versions, subdivided into each toolchain:

Example Projects

Importing may take several minutes, so it is best to import only a few projects at one time. These instructions use the Contiki projects.

  1. Locate the ARC GNU IDE folder in your Start menu and click the Eclipse icon to launch the IDE.
    GNU Eclipse Launch Icon
  2. In the Workspace Launcher dialog that appears, select the workspace location ide_projects/emsk_22/gnu.
  3. Select the File menu and navigate down to Import...
  4. Expand General and select Existing Projects into Workspace, then click Next.
  5. Use the Browse button to navigate to the location where you unzipped the embARC distribution and look for the ide_projects subdirectory that matches your EMSK version and toolchain (for example, C:\ARC\embARC\ide_projects\emsk_22\gnu). The list of embARC example projects appears in the Projects section of the dialog.
  6. Select all the examples that start with emsk_contiki* and click Finish.
  7. Close the Welcome view if necessary and confirm that you can see a list of embARC example projects in the Project Explorer on the left.

Note: All EMSK v2.0 and 2.1 IDE projects are configured to target the arcem7d configuration by default. For EMSK v1.1, IDE projects are configured to target the arcem6 configuration by default. For EMSK v2.2, IDE projects are configured to target the arcem11d configuration by default.

Building the Project

  1. Launch the IDE and select the workspace where you previously imported embARC projects for your EMSK version and toolchain.
  2. In the Project Explorer, find the emsk_contiki_sensor project in the list.
    Contiki Sensor Project
  3. If the project is closed (small icon showing a closed folder), double-click on the project name to open it.
  4. Right click on the project name, then select Build Configurations->Set Active->arcem7d.
    Set Active Build Configuration
  5. Right-click on emsk_contiki_sensor in the Project Explorer and choose Clean Project.
  6. Click on Console tab on the bottom of the screen to see the progress.
  7. Right-click on emsk_contiki_sensor in the Project Explorer and choose Build Project.

Running the Application

  1. Right click on the project name, then select Debug As > Debug Configurations.... The Debug Configurations dialog appears.
  2. Select emsk_contiki_sensor-arcem7d from the list under ARC C/C++ application and click Debug.
    Debug Configurations Dialog
  3. Confirm that the Debug perspective opens (if not, select the Debug perspective manually to see why not) and that execution has stopped at main().
  4. Click the Resume button (green arrow with yellow bar) on the toolbar to start program execution.
  5. Go to terminal window and confirm that you see the "Powered By embARC" banner and example print messages.
    Powered By embARC
  6. Experiment with the buttons/LEDs/temperature sensor (touch it with your finger to change temperature) to confirm GPIO and the temperature sensor are working.
  7. When finished, click the red Terminate button on the toolbar and return to the C/C++ Perspective.

Using the Command Line

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.

Building the Demo

Change to embARC\example\emsk\contiki\sensor and type the following:

make clean
make BD_VER=22 CUR_CORE=arcem9d TOOLCHAIN=gnu

The default toolchain is MetaWare; this example specifies the GNU toolchain.

Running the Demo with GDB

By default, the example makefiles use the MetaWare debugger. You can invoke GDB directly, as shown in this section.

  1. At a new command prompt, change directory to embARC\example\emsk\contiki\sensor.
  2. Type make BD_VER=22 CUR_CORE=arcem11d TOOLCHAIN=gnu run

GNU Command-Line Debug

Testing the Application

  1. Go to PuTTY and confirm that you see the "Powered By embARC" screen.
    Powered By embARC
  2. Experiment with the buttons to confirm GPIO and the temperature sensor are working.

For details on building and running your own applications, see also the ARC GNU documentation in arc_gnu/share/doc.

Clone this wiki locally