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:
- MSP432E401Y LaunchPad
- A computer running a supported operating system listed in the Release Notes
- SimpleLink MSP432E4 SDK 2.40
- At least one of the following IDEs supported by the SimpleLink MSP432E4 SDK:
- FreeRTOSv10.0.0 (Optional)
- If the User wants to use FreeRTOS with the SDK, the user is expected to download the FreeRTOS sources from www.freertos.org
- Please refer to the SimpleLink MSP432E4 SDK documentation for more information about setting up FreeRTOS
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
- 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
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.Click Next > and finish the installation
Open CCS (close and re-open if already running).
If you see the
Install Discovered Products
window, select theMSP432E4 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
Plug the MSP432E4 LaunchPad into a USB port on your PC.
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
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.
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.Open Code Composer Studio.
In CCS, import the
watson_mqttclient
example by first selecting File > Import…In the Import window, select C/C++ > CCS Projects and hit the Next button
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 thewatson_mqttclient
example for tirtos for CCS and hit the Finish button.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 thewatson_mqttclient
project, and select Build Project to build.
Setting Up Code Composer Studio Before Running The Examples
In Code Composer Studio, open the CCS Debug Perspective - Windows menu > Perspective > Open Perspective > CCS Debug
Open the Target Configurations View - Windows menu > Show View > Target Configurations
Right-click on User Defined. Select New Target Configuration.
Use
MSP432E4.ccxml
as “File name”. Hit Finish.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.Right-click “MSP432E4.ccxml” in the Target Configurations View. Hit Launch Selected Configuration.
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
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.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.
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 variableWATSON_MSP432E4_INSTALL_DIR
in the file with the correct path.Open the IAR IDE
Choose Tools > Configure Custom Argument Variables
Click Global > Import
Browse to
<WATSON_INSTALL_DIR>/tools/iar
. Import the custom argvars from the plugin.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
Select Project > options from the menu, and select the Debugger category.
By default, the project Debug settings are configured for the TI XDS110, but the user may change them as needed.
Check the Use flash loader(s) checkbox in the Debugger > Download tab.
Go to the TI XDS Category, the settings should be TI XDS110 Emulator as the emulator, and SWD as the interface
You can override the path for code composer studio base according to the code composer installation path.
Load and run the Example
Select Project > Download and Debug
Click the
Go
button in IAR to run the ExampleThe 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:
Update the
imports.mak
file in the<WATSON_INSTALL_DIR>
root folder with the appropriate path(s). This file relies on the settings in theimports.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.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.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
Navigate to the example folder specific to your OS and toolchain
<WATSON_INSTALL_DIR>/examples/rtos/MSP_EXP432E401Y/watson/watson_mqttclient/tirtos/ccs
To build, run ‘make’ to generate
watson_mqttclient.out
You can load and debug the generated
watson_mqttclient.out
in CCS
6. Run Examples
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 .
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}}
- Visualizing the data using IBM QuickStart
- Now connect to IBM QuickStart to view the data by navigating to this link in your web browser: https://quickstart.internetofthings.ibmcloud.com/
- Use the MAC address of the LaunchPad as shown on the serial console as device id to see the data! You will need to remove the colons (:) from the MAC address. A graph is updated every time the button state is published:
Congratulations! Your TI SimpleLink LaunchPad is now connected to the IBM Watson IoT Platform!