Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Getting Started on Arduino* 101/Genuino* 101 with Intel® System Studio for Microcontrollers using the Flyswatter* 2 JTAG* debugger

$
0
0

Getting Started on Arduino* 101/Genuino* 101 with Intel® System Studio for Microcontrollers using the Flyswatter* 2 JTAG* debugger

 

Prerequisites

Hardware Requirements

Software Requirements

Set up

Hardware Setup

  1. Power the Arduino 101/Genuino 101 board by connecting it to the host PC with a USB-A-B-cable (the green LED will light up).
  2. Power the Flyswatter 2 by connecting it to the host PC with a USB-A-B-cable (the green LED will light up).
  3. [To enable flashing]  Connect JTAG header on the board to the Flyswatter 2 via the ARM-JTAG-20-10 adapter.  Match pin 1 to pin 1 as shown in Diagram A.
  4. [To enable serial]  Connect the USB type A end of the FDTI cable to the host PC and use jumper wires to connect the other end to the board as listed below and pictured in Diagram A.
    1. Connect the Serial Cable RX pin to the Arduino 101's TX pin (Pin 1)
    2. Connect the Serial Cable TX pin to the Arduino 101's RX pin (Pin 0)
    3. Connect the Serial Cable GND pin to one of the Arduino 101's GND pins

Diagram A:

Image of board setup

 

Once you have your board connected, you can verify your setup in the Device Manager by confirming you see these entries (highlighted below for reference):

Device Manager

If you do not see these, you may need to install the FTDI driver. To install the driver see the link in Hardware Requirements section under the FTDI entry.

The USB Serial Port entries are for the serial connection to the board.  One of these is the Flyswatter* 2’s onboard serial port which you can use if you have an adapter.  The second one is the external FTDI cable we are using.  Your system will automatically assign COM port numbers, so check to see which ones you have. The last thing you’ll see is the OpenOCD* JTAG entry in the Universal Serial Bus devices category, this is the connection from the Flyswatter 2 to your board which allows you to upload your code. 

 

Software Setup

Intel® System Studio for Microcontrollers Update 1

  1. Download Intel® System Studio for Microcontrollers
  2. Run the installer you downloaded and enable Arduino* 101/Genuino* 101 Board Support. Do this by selecting the “Customize” option on the installation summary screen.  See example below:

 Installer option

 

Zephyr Development Environment Setup

Intel® System Studio for Microcontrollers Update 1 provides the Real Time Operating System (RTOS) Zephyr* in the installation package.  This guide uses a Zephyr-based application for the Arduino 101/Genuino 101.  Zephyr works out of the box on Linux* but to run this on Windows, you will need to install the prerequisites shown here:

To install MinGW, visit the site MinGW Home and install the following packages with their installer mingw-get-setup.exe

  • mingw-developer-toolkit
  • mingw32-base
  • msys-base
  • msys-binutils
  • msys-console
  • msys-w32api

Then launch the MSYS console. The installer does not create shortcuts for you, but the script to launch it is located here by default:

 

C:\MinGW\msys\1.0\msys.bat

 

From in this console you will then need to replace the default fstab file as shown:

 

cp /etc/fstab.sample /etc/fstab

 

Then, in the same console run these commands to install the final prerequisites:

 

mingw-get update
mingw-get install libpthread msys-libregex-dev --all-related 

 

Now you are ready to create your first Arduino* 101 / Genuino 101 project with Intel® System Studio for Microcontrollers!

 

Creating your First Application

Follow the steps below to create your Arduino* 101 / Genuino 101 application.

Launch Intel® System Studio for Microcontrollers Update 1

Intel® System Studio for Microcontrollers can be launched from the desktop icon or the start menu entry or by browsing to the install directory and running the launcher.

By default this can be found here:

 

C:\IntelSWTools\ISSM_2016.1.067\iss_mcu_ ide_eclipse-launcher.bat

 

Creating a new project

Go to File > New > Intel Project for Microcontroller… and follow the prompts to create a new project for the Arduino* 101/Genuino 101 board. 

Create Project

Note: Missing Arduino Board in the Create a new Project menu

If you did not choose a custom install during the options portion of the installation to select the Arduino* 101/Genuino* 101 it will not show up as a developer board option in the Create a New Project view.

 

If you missed this step when you installed the tools then simply:

1. Re-launch the installer

2. Select “Modify”

Modify Install

Then install the Arduino* 101/Genuino 101 Board support:

Arduino Board Support

 

Customize and select example template

After selecting the Arduino* 101 / Genuino* 101 you may customize the various settings of the project and choose which example template to use.  For this guide we selected the Hello World example template.

Hello World Project

Build the Project

To build the project select the hammer icon.

Debug Build

Note: Build Errors

If you see errors building one of the provided projects then go back to "Zephyr Development Environment Setup on Windows" and make sure each component is installed properly.

 

Flash the project to the Arduino* 101/ Genuino* 101

After the build is complete, flash (upload) your application onto the microcontroller with the (flashing) option in the drop down menu of the debug icon:

Debug Flashing

 

After flashing, the application will halt automatically with a temporary breakpoint at the start.

 

Setup your serial connection through the FTDI cable 

In the bottom right corner of Intel® System Studio for Microcontrollers you will see the “Serial Terminal”.  If the window is closed then you can reopen it from Window > Show view > Serial Terminal …

Serial Terminal

In this window select the green “+ and select the COM port of the Serial cable.  If you’re not sure which one it is then try replugging the FTDI cable and see which one changes in the device manager. 

Now click Resume to start running the program:

Resume

You should now see output in the serial terminal window:

Hello World Output

 

Congratulations, your application is now up and running on your board!  You now can build applications and view serial output on the Arduino* 101/Genuino* 101 with Intel® System Studio for Microcontrollers Update 1. 

 

Reference Information

Intel® System Studio for Microcontrollers Product Page

Intel® System Studio 2016 for Microcontrollers User and Reference Guide

Zephyr Environment Setup on Windows

 

*Other names and brands may be claimed as the property of others.


Viewing all articles
Browse latest Browse all 3384

Trending Articles