Skip to content

Getting Started with embARC Using GNU on Windows

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

Note:

  • embARC 2017.12 (or higher) and ARC GNU 2017.09 (or higher) are required.
  • Go to emARC OSP Documentation for more details.

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 embARC OSP release page.

  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 ARC GNU tools release page.

  2. Run the installer to install the IDE in default location: C:\arc_gnu.

  3. Use Zadig to replace FTDI driver with WinUSB driver. Go to How to Use OpenOCD on Windows for more information.

Note

  • This location is required for the example scripts to run properly.
  • Zadig is required to use OpenOCD on Windows.

Building and Running Your First Example

The blinky example is used here in exmaple/baremetal/blinky. The same build and run steps are useful for other examples on different ARC-based boards. For additional documentation, see doc/embARC_Document.html in the source code archive.

This demo uses the following:

  • Baremetal exmaple running on EMSK
  • GPIO drivers on EMSK

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

Using ARC GNU IDE

  1. Open the ARC GNU IDE and set the workspace location to ide_projects/<board_name>_<board_version>/<toolchain>, for example ide_project/emsk_11/gnu in the embARC source root.

  2. Click File->New->Makefile Project with Existing Code to open the New Project wizard.

  3. In the Import Existing Code step, Set blinky in the Project Name and <embARC_root>/exmaple/baremetal/blinky in the Existing Code Location. Check C and C++ in the Languages. Set proper toolchain in the Toolchain for Indexer Settings, for example, GNU Toolchain for ARC EM for EMSK.

  4. Open the makefile in exmaple/baremetal/blinky. Add the following code in it, where BOARD is board name supported in embARC, BD_VER is board version, and CUR_CORE is core name.

TOOLCHAIN=gnu
BOARD=emsk
BD_VER=11
CUR_CORE=arcem6
  1. Bulid the project in the ARC GNU IDE. When the build process is finished, open Debug Configurations.

    • Click Run->Debug Configurations.... Create a new debug configuration for this project.
    • In the label Main, choose blinky in correct elf file in the C/C++ Application, for example obj_emsk_11/gnu_arcem6/blinky_gnu_arcem6.elf.
    • In the label Debugger, go to Debugger Options->Gdbserver Settings. Choose JTAG via OpenOCD in ARC GDB Server. In the JTAG via OpenOCD setting, choose EM Start Kit v2.2 for EMSK 2.3 and EM Start Kit v1.X for EMSK 1.1 in Development system.
    • Click Debug to begin the debug process.
  2. Click the red Terminate button on the toolbar and return to the C/C++ perspective.

Using Command Line

  1. Change to <embARC_root>/exmaple/baremetal/blinky and type the following commands in the command line.
make TOOLCHAIN=gnu BOARD=emsk BD_VER=11 CUR_CORE=arcem6 clean
make TOOLCHAIN=gnu BOARD=emsk BD_VER=11 CUR_CORE=arcem6
  1. Type the following command to invoke GDB to debug the project.
make TOOLCHAIN=gnu BOARD=emsk BD_VER=11 CUR_CORE=arcem6 gui
Clone this wiki locally