Watson IoT MSP432E4 Quick Start Guide

Table of Contents

1. Introduction

This guide is intended to assist users in the initial setup and demonstration of a MSP432E4 Watson IoT application using the MSP432E4 Plugin for Watson. The guide explains how to configure the boards, compile the software artifacts, program the MSP432E4 device, and run a Watson IoT application.

2. Prerequisites

The user is expected to have the following:

3. Setup

Software

It is assumed that the MSP432E4 SDK has already been installed in a directory we will refer to as MSP432E4_SDK_INSTALL_DIR.

Installing MSP432E4 Watson IoT Plugin in CCS

  1. Download and open the MSP432E4 Watson IoT Plugin Installer (replace x’s with version number):
    • Windows: watson_msp432e4_x_xx_xx_xx.exe
    • Linux: watson_msp432e4_x_xx_xx_xx.run
  2. Select an installation directory. This will be referred to as WATSON_INSTALL_DIR in the rest of this document. It’s recommended that you install it in your CCS installation directory (default c:/ti) so it can be discovered automatically.

  3. Click Next > and finish the installation

  4. Open CCS (close and re-open if already running).

  5. If you see the Install Discovered Products window, select the MSP432E4 Watson IoT Plugin and click Install. Otherwise you can verify that the plugin appears in the list of installed products under Window menu > Preferences > CCS > Products.

Hardware

This example does not require special jumpers settings. Please refer to the SimpleLink MSP432E4 SDK documentation for more information if desired.

An Ethernet cable should be connected to the Ethernet port on the LaunchPad to provide it with Internet access.

Setting up a serial terminal

  1. Plug the MSP432E4 LaunchPad into a USB port on your PC.

  2. Open a serial session to the appropriate COM port with the following settings:

    Baudrate:     115200
    Data bits:       8
    Stop bits:       1
    Parity:       None
    Flow Control: None
  3. The output of the examples will be displayed in the terminal.

Watson IoT Cloud

The IBM Watson Platform offers a QuickStart service which allows devices to connect without being registered, in order to evaluate the Platform and verify connection setup. The examples leverage this service out-of-box.

4. Configure/modify examples

No modification is required to run the example out-of-box.

5. Build examples

Examples can be built using either the CCS IDE, the IAR IDE or makefiles. Please refer to the appropriate section below based on your preference.

CCS

Build and run

Several examples are provided in the MSP432E4 Plugin and can be found in the examples/ subdirectory.

  1. It is assumed that the MSP432E4 SDK has already been installed in a directory we will refer to as MSP432E4_SDK_INSTALL_DIR. You should install it if you have not already done so, as the MSP432E4 Watson IoT Plugin depends on the MSP432E4 SDK.

  2. Open Code Composer Studio.

  3. In CCS, import the watson_mqttclient example by first selecting File > Import…

  4. In the Import window, select C/C++ > CCS Projects and hit the Next button

  5. In the Import CCS Eclipse Projects window, hit the browse button to browse to the location corresponding to WATSON_INSTALL_DIR\examples\rtos\MSP_EXP432E401Y\watson\watson_mqttclient. Select the checkbox next to the watson_mqttclient example for tirtos for CCS and hit the Finish button.

  6. Two projects should appear in the Project Explorer tab in CCS: one for the watson_mqttclient example itself (ie. watson_mqttclient_MSP_EXP432E401Y_tirtos_ccs), and the other is a project corresponding to the OS chosen (e.g. tirtos_builds_MSP_EXP432E401Y_release_ccs if TIRTOS is your OS). You can simply right-click on the watson_mqttclient project, and select Build Project to build.

Setting Up Code Composer Studio Before Running The Examples

  1. In Code Composer Studio, open the CCS Debug Perspective - Windows menu > Perspective > Open Perspective > CCS Debug

  2. Open the Target Configurations View - Windows menu > Show View > Target Configurations

  3. Right-click on User Defined. Select New Target Configuration.

  4. Use MSP432E4.ccxml as “File name”. Hit Finish.

  5. In the Basic window, select “Texas Instruments XDS110 USB Debug Probe” as the “Connection”, and then type MSP432E401Y in the “Board or Device” text field. Check the box next to “MSP432E401Y”. Hit Save.

  6. Right-click “MSP432E4.ccxml” in the Target Configurations View. Hit Launch Selected Configuration.

  7. Under the Debug View, right-click on “Texas Instruments XDS110 USB Debug Probe_0/Cortex_M4_0”. Select “Connect Target”.

Running an Example in CCS

  1. Select Run menu > Load > Load Program…, and browse to the file watson_mqttclient_MSP_EXP432E401Y_tirtos_ccs.out, found in your project. Hit OK. This will load the program onto the board.

  2. Run the application by pressing F8. The Example output is displayed in the serial terminal, as shown here.

IAR

Download and Installation of IAR

For instructions on downloading and setting up IAR properly for use with the MSP432E4 SDK, please refer to the Quick Start Guide document that is included in the SimpleLink MSP432E4 SDK.

Configuring the IAR environmental variables for the Watson IoT Plugin

Before starting to work with any of the Watson IoT example projects, you need to load a set of environment variables that will be set to your current workspace (custom argvars). We are assuming here you have already loaded the custom argvars for the MSP432E4 SDK as instructed in the Quick Start Guide document that is included in the SimpleLink MSP432E4 SDK.

  1. The custom argvars can be found at <WATSON_INSTALL_DIR>/tools/iar/WATSON_MSP432E4_SDK.custom_argvars. If you need to modify the default path for the plugin’s installation directory, edit the variable WATSON_MSP432E4_INSTALL_DIR in the file with the correct path.

  2. Open the IAR IDE

  3. Choose Tools > Configure Custom Argument Variables

  4. Click Global > Import

  5. Browse to <WATSON_INSTALL_DIR>/tools/iar. Import the custom argvars from the plugin.

  6. Restart IAR

Importing your First Project

All Code Examples that are shipped with the plugin under the examples directory come with an IAR workspace. Double-Clicking the specific workspace (e.g. watson_mqttclient.template.eww) from the file manager allows you to open the project on disk and build it.

Start a debug session

  1. Select Project > options from the menu, and select the Debugger category.

  2. By default, the project Debug settings are configured for the TI XDS110, but the user may change them as needed.

  3. Check the Use flash loader(s) checkbox in the Debugger > Download tab.

  4. Go to the TI XDS Category, the settings should be TI XDS110 Emulator as the emulator, and SWD as the interface

  5. You can override the path for code composer studio base according to the code composer installation path.

Load and run the Example

  1. Select Project > Download and Debug

  2. Click the Go button in IAR to run the Example

  3. The Example output is displayed in the serial terminal, as shown here.

makefiles

To build the watson_mqttclient example on the command-line using the provided makefile:

  1. Update the imports.mak file in the <WATSON_INSTALL_DIR> root folder with the appropriate path(s). This file relies on the settings in the imports.mak file of the MSP432E4 SDK, so please ensure you have updated the latter with the appropriate paths as well if you have not done so previously.

  2. Navigate to the OS directory corresponding to your OS and toolchain of choice. For example, <MSP432E4_SDK_INSTALL_DIR>/kernel/tirtos/builds/MSP_EXP432E401Y/release/ccs for tirtos and TI compiler.

  3. Run ‘make’ to build the OS. If you develop on a Windows machine and do not have the ‘make’ utility, you can alternatively run ‘gmake’ from your TI XDCTOOLS installation (e.g. ‘C:\ti\xdctools_x_xx_xx_xx_core\gmake.exe’). Normally XDCTOOLS are installed along with the MSP432E4 SDK, but if you need to download it, it is available here

  4. Navigate to the example folder specific to your OS and toolchain <WATSON_INSTALL_DIR>/examples/rtos/MSP_EXP432E401Y/watson/watson_mqttclient/tirtos/ccs

  5. To build, run ‘make’ to generate watson_mqttclient.out

  6. You can load and debug the generated watson_mqttclient.out in CCS

6. Run Examples

  1. Rebuild and run the example as described above for your particular environment. You should see the following on the serial console.

    Service Status: DHCPC    : Enabled  :          : 000
    
    Service Status: DHCPC    : Enabled  : Running  : 000
    
    Network Added:
    If-1:192.168.1.106
    
    Service Status: DHCPC    : Enabled  : Running  : 017
    
    Starting the Watson MQTT client example
    
    
    ============================================
       MQTT client Example Ver: 1.1.1
    ============================================
    
    
     MAC address: 07:00:28:5a:58:9b
    
    
    ============================================
    
    
       MQTT ClientId: d:7ppa04:ti-simplelink:0700285a589b
    
    
    
    
    
                     *************************************************
                        SimpleLink MQTT client Application
                     *************************************************
    
    
    
    .
    startSNTP: Current time: Fri Apr 27 00:02:52 2018
    
    
    .
    .
    CONNACK:
    Connection Success
    Connection to broker is successful
    .
  2. Each time the User button (SW1) is pressed, a message with the button state will be sent.

     Publishes the following message
    Topic: iot-2/evt/status/fmt/json
    Data: {"d":{"button":1}}
  3. Visualizing the data using IBM QuickStart

IBM

Congratulations! Your TI SimpleLink LaunchPad is now connected to the IBM Watson IoT Platform!

7. Other Info

More CCS project information can be found here and here.