Getting Started with embARC Using GNU on Windows 2017 - foss-for-synopsys-dwc-arc-processors/embarc_osp GitHub Wiki
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.
- 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.
Downloading and Installing the Eclipse IDE with GNU Toolchain for ARC
Prebuilt versions of the ARC GNU tools are available from the GitHub website.
- Download the latest release installer from https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases.
- 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:
Importing may take several minutes, so it is best to import only a few projects at one time. These instructions use the Contiki projects.
- Locate the ARC GNU IDE folder in your Start menu and click the Eclipse icon to launch the IDE.
- In the Workspace Launcher dialog that appears, select the workspace location
ide_projects/emsk_22/gnu
. - Select the File menu and navigate down to 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
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. - Select all the examples that start with
emsk_contiki*
and click Finish. - 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
- Launch the 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.
Running the Application
- 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 ARC 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.
- 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.
- At a new command prompt, change directory to
embARC\example\emsk\contiki\sensor
. - Type
make BD_VER=22 CUR_CORE=arcem11d TOOLCHAIN=gnu run
Testing the Application
- Go to PuTTY and confirm that you see the "Powered By embARC" screen.
- 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
.