Software Installation

This page contains instructions to install and test the software required for ENGR-2350. A video version of the instructions may be found on Youtube: ENGR-2350 Software Install Video.

1. Code Composer Studio Installation

Code Composer Studio (CCS) is a free integrated development environment (IDE) that is designed to be used with Texas Instruments products and is based on Eclipse. Please follow the instructions below to install. These instructions describe the process within Windows; however, the process within Linux or MacOS should be similar.

  1. Go to the CCS Downloads page and download the CCSTUDIO on-demand (web) installer for CCS IDE for your OS. To find the on-demand installers, click the Download options for the CCSTUDIO entry, not CCSUDIO-Theia. Make sure to not select the Launch option, which will start the undesired cloud-based IDE.

  2. Run the installer. It should be named ccs_setup_<version>.exe.

  3. Click Next as needed until it starts the download and install process. You generally can accept the default options unless noted below:

    1. Of course you need to accept the license in order to continue.

    2. You may change the installation directory if desired. The default is fine.

    3. Ensure that Custom Installation (Recommended) is selected when applicable.

    4. On the Select Components view, select the item SimpleLink(TM) MSP432(TM) low power + performance MCUs

_images/selectcomponents.png

Note

The installer may present slightly different dialogs on different OSs. No additional configuration changes than those listed above are needed for Linux or MacOS; therefore, any additional options may be ignored.

  1. The download and install process will take a few minutes or more, depending on the connection speed. As-of the writing of these instructions, the process needed to fetch approximately 880 MB of archives.

  2. During the install process, a prompt may appear asking for the install of one or more device drivers (Windows only). These are needed to communicate with the evaluation board and robotic car, Please click Install for all of them. You may also select Always trust software from “Texas Instruments Incorporated” to prevent being asked again.

_images/drivers.png
  1. If prompted to restart the computer after installation is complete, please do so now.

2. MSP432P4 Software Development Kit (SDK) Installation

In addition to CCS, the SDK for the microcontroller used in this class also needs to be installed:

  1. Download the installer for your OS from here: https://www.ti.com/tool/download/SIMPLELINK-MSP432-SDK#release-notes.

  2. Run the downloaded installer. All default options are acceptable; however, if you changed the default installation path for CCS, you should likewise change the installation path for this package.

  3. Once the installer is complete, CCS needs to be forced to recognize the new software. To do so:

  1. Open Code Composer Studio.

  2. You will be asked to select a workspace; you may leave that as the default for now or select a different folder.

  3. Once CCS is started, navigate to:

    • Windows and Linux: Window → Preferences → Code Composer Studio → Products and click Refresh on the right.

    • MacOS: From the top menu: Code Composer Studio → Preferences → Code Composer Studio → Products and click Refresh on the right.

  4. This should result in CCS recognizing the new software xdctools, which is installed with the SIMPLELINK-MSP432-SDK. Accept the addition of this software.

  5. If CCS does not locate the new software, ensure that the base installed directory for the SIMPLELINK-MSP432-SDK is listed in the directory listing near the top of the Products dialog.

  1. Restart CCS.

3. Test Project

To ensure that the installation worked properly and the computer can program the evaluation board or robotic car, we will attempt to load a test project onto the target:

  1. Download the project archive from here: TestProject.zip. There is no need to extract the zip archive.

  2. Select File → Import… from the CCS Menu.

  3. In the Import dialog, select Code Composer Studio → CCS Projects and click Next>:

    _images/import_testproject.png
  4. In the Import CCS Projects dialog, choose the Select archive file: option and find the downloaded TestProject.zip archive using the file picker to the right.

    _images/import_testproject2.png

    Attention

    If you are unable to select the project to import within this dialog, hover over the project within the Discovered projects: box. Doing so will provide you with a reason for why you cannot select it. By far, the most common issue is:

    A project named 'xxxxx' already exists in the workspace. Please remove them or rename the existing project before importing a project with the same name.
    

    In the context of these instructions; it means you already did this step (that is, the project is already imported) and you can move on. Other times in the class, you may need to follow the suggestions in the error. See Cannot import project ZIP archive.

  5. Click Finish to import the project into the workspace.

  6. Upon success, this should result in the project being visible in the Project Explorer pane. If this pane is not visible, it may be shown by going to View → Project Explorer. The project contents may be shown by expanding the project (either by double clicking on the project name or clicking the arrow to the left).

    _images/imported_testproject.png
  7. The test project code may be considered a complete program; that is, no modifications are necessary for it to run. However, it should be ensured that the program can be compiled successfully. To compile the project:

    • By clicking the button on the top toolbar that resembles a hammer: hammer

    • From the menu: Project → Build Project,

  8. The Console pane will show the progress of the compilation. If all goes well, the console should read:

    Finished building target: "<project_name>.out"
    
    **** Build Finished ****
    

    Attention

    If instead of the above output you receive the error message below within the console, the steps in 2. MSP432P4 Software Development Kit (SDK) Installation were not completed successfully. Revisit those steps as needed.

    Product com.ti.SIMPLELINK_MSP432_SDK v3.40.1.02 is not currently installed and no compatible version is available. ...
    

Note

The remaining steps require either the Launchpad Board or RSLK.

  1. Before proceeding within CCS, the development board must be connected to the computer. When connected, the board will have a green LED (LED102) lit constantly. LED2 may also be blinking RED, depending on the default firmware of the microcontroller.

    • It is suggested that you use the micro-USB cable provided with the development board to connect to the computer; however, all other micro-USB data cables will work just fine. If the steps below do not work properly with a different cable, ensure that the cable used is not strictly a power cable.

    _images/board-plug-in.jpg
  2. With the board connected, the project can be compiled and run. In this class, we will always do this through the Debug interface. Launching the debug interface for the active project (bold project in Project Explorer) may be done many ways. Some methods are:

    • By clicking the button on the top toolbar that resembles a green beetle: bug

    • From the menu: Run → Debug,

    • Pressing the keyboard shortcut F11.

  3. Initiating the debug interface will cause the project to be compiled (turned into a program) and loaded onto the microcontroller. The first time this is done for the development board will likely trigger a request for programmer firmware update. This should be agreed to.

  4. Once the program has been loaded onto the microcontoller, CCS will be in the Debug Perspective showing that the program is paused on the microcontroller, with the paused location shown in the corresponding code file:

    _images/testproject_debug.png
    • The Debug Perspective is simply a layout of CCS that is designed for the debugging process. You will note that the panes of the program have been modified and rearranged and that the top toolbar has had many buttons added. You may switch between Perspectives via the buttons on the right of the top toolbar: perspectives

  5. To run the code, click the Resume toolbar button, run. This should cause LED1 on the development board to blink at a steady rate.

  6. To ensure that changes to the code will be reflected in the downloaded program, modify line 76 within main.c from:

    for(i=1000000; i>0; i--);
    

    to:

    for(i=100000; i>0; i--);
    
  7. Once the code is changed, debug the program again (bug) to recompile and download the program, initiating a new debug session.

    • CCS will ask to “save resources” when doing this if the modified code file was not saved prior to clicking debug. It is suggested to click “Always save resource before launching”.

    • CCS should also ask for confirmation to terminate the current debug session, if it is still active. Answer “yes”.

  8. Run the program: run.

Hint

The “debugger” that we are using is a powerful set of tools that this course will barely scratch the surface of. However, students should be aware of the functionality of these toolbar buttons as well:

  • pause Pause the running program. This will halt the execution of the code at its current point, which will be indicated by a blue arrow, location, to the left of the line of code. The code then may be resumed again by run.

  • stop Stop debugging. This will disconnect the current debug session from the microcontroller. Pressing this will require that a new debug session be started (bug).

  • restart Restart the code from the beginning. This button is very useful to quickly test a program multiple times without having to repeatedly press bug (much slower).

4. Serial Terminal

We will be using a serial terminal emulator to interact with the microcontroller when a program is running. Code Composer Studio has a built-in serial terminal emulator which provides all necessary functionality except a logging capability to automatically save output to a file. Alternatively, an external program may be used, which will be dependent on your operating system. See below for the suggested programs for each OS. Note that there are many programs capable of performing this task and if you are comfortable with a different one, feel free to use it instead.

An active connection is only possible with the development board attached to the computer. If the board is removed and reattached, the serial terminal connection must be reestablished.

To test the serial terminal connection, the Test Project may be run again.

All OSes - CCS Terminal

The CCS Terminal is a basic terminal built into CCS and can be made part of the perspective (e.g., the Debug Perspective). As it is built-in, installation is not required and connection is fairly straight forward:

  1. Open the Terminal view by finding it within the View menu or by clicking on the term icon.

  2. This will create a new Terminal pane and/or tab in the CCS window. To connect to the development board, click the Open a Terminal term button (same icon from main toolbar, but now located in the Terminal pane) to show the Launch Terminal dialog:

    _images/launch_terminal.png
  3. Ensure that “Serial Terminal” is selected under Chose terminal:.

  4. Determine and select the correct serial port to select. Instructions for determining the correct serial port are provided in Finding Serial Port.

  5. Ensure that the remaining options match those provided below (and in the figure above).

    • Baud rate: 115200

    • Data size: 8

    • Parity: None

    • Stop bits: 1

    • Encoding: Default (ISO-8859-1)

  6. Click “OK”.

As noted, a logging feature is not available within the CCS Terminal. If the data printed needs to be saved, it is possible to simply copy and paste the required text into a text file.

Important

A common issue when debugging is that students may open the terminal pane but forget to create the connection. Remember to connect the terminal!

Finding Serial Port

The development board presents itself as two independent serial port devices, among others that may exist. Determining the appropriate name or path for the serial port is dependent on the OS.

Windows
  1. Ensure that the development board is connected to the computer.

  2. Open the Windows Device Manager.

  3. Under Ports, find the entry XDS110 Class Application/User UART (COMx). The cooresponding COMx name and number is the required serial port. This value may change when the device is remove and readded to the computer, though if plugged into the same USB port, it usually will stay the same.

Linux

Determining the serial port on Linux can be done several ways. Here are two: 1. Using dmesg:

  1. Prior to plugging the development board in, run dmesg in the follow mode:

$ dmesg -w
  1. Plug the development board into the computer. This should result in a dmesg output of something along the lines of this:

usb 1-4: USB disconnect, device number 27
usb 1-4: new full-speed USB device number 28 using xhci_hcd
usb 1-4: New USB device found, idVendor=0451, idProduct=bef3, bcdDevice= 1.00
usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-4: Product: XDS110 (03.00.00.07) Embed with CMSIS-DAP
usb 1-4: Manufacturer: Texas Instruments
usb 1-4: SerialNumber: M4321005
cdc_acm 1-4:1.0: ttyACM0: USB ACM device
cdc_acm 1-4:1.3: ttyACM1: USB ACM device
hid-generic 0003:0451:BEF3.000E: hiddev1,hidraw2: USB HID v1.11 Device [Texas Instruments XDS110 (03.00.00.07) Embed with CMSIS-DAP] on usb-0000:00:14.0-4/input5
  1. Determine the target serial port from the dmesg output: The lines of interest are highlighted above. The board provides two serial ports when connected; in this case, these are ttyACM0 and ttyACM1. The correct one is the one that is listed first. Therefore, for this case: ttyACM0 is the target serial port. The full path to this port is /dev/ttyACM0

  1. Directory listing:

    1. Prior to plugging the development board in, list the contents of the /dev/ directory looking for any entries that start with either ttyACM or ttyUSB:

    $ ls /dev/tty{ACM*,USB*} 2> /dev/null
    
    1. Take note of the any entries listed from the output of this command. These are the existing serial ports.

    2. Plug in the development board and run the above command again.

    3. Two new entries should appear in the output. Select the lowest numbered new entry as the target serial port.

  • Note that the target serial port will not change upon removal and reconnection of the development board as long as:

    1. A different device that presents itself as a serial port was added to the computer, or

    2. An active serial terminal session was not exited at reconnection.

Therefore, the device determined above may generally be used for all subsequent connections.

MacOS

The correct port for MacOS seems to be generated directly from the device hardware and/or product IDs, and is usually listed as /dev/cu.usbmodemM43210051. If this is not listed as an available port, select the lowest numbered /dev/cu.usbmodemM432 device.

Windows - PuTTY

Warning

Installation of PuTTY is only necessary if not using the built-in terminal within CCS. If using the CCS built-in terminal, ignore the instructions below.

Installation

Download the most recent version of PuTTY from the PuTTY Downloads page. Either the MSI Installer or just putty.exe will work. The 64-bit x86 version is the applicable version for almost all Windows based computers.

  • If the MSI Installer was selected, follow the installation instructions. This version will place the PuTTY program (among others: PuTTYgen, PSFTP, etc.) within the Windows program menu.

  • If using putty.exe, it is highly suggested to pin the program to the taskbar to make accessing the program easy and quick.

Connecting

  1. Launch PuTTY. If installed using MSI Installer, select the PuTTY application from the program menu and not PuTTYgen, PSFTP, etc.

  2. In the window that appears, do the following:

    1. Select the Serial radio button near the upper right, not the “Serial” option on the bottom left.

    2. Change Speed to 115200.

    3. Change Serial line to the necessary COM port as determined by Finding Serial Port.

    4. Click Open. This will launch a terminal session if configured properly.

  3. If the development board was removed and reconnected, the terminal session may be restarted by right clicking the PuTTY window title and selecting

Saving Settings

PuTTY can save a session configurations to avoid having to repeat the above steps each time. However, it is possible that the COM port will not be consistent across different sessions. To save settings:

  1. Complete the Connecting instrutions above up to step 2.

  2. Type a name into the Saved Sessions box.

  3. Click Save on the right.

  4. A new item will appear with the name provided in the Saved Sessions box below.

Loading Settings

There are two options here:

  1. Double-click on the saved settings that are desired. This will automatically start the terminal session using these sessions.

  2. Single-click on the saved settings that are desired.

    1. Click Load

    2. Change any settings (such as the desired COM port)

    3. Click Open.

Logging Output

Logging of PuTTY sessions is useful in cases where the data needs to be saved. To do this: 1. Prior to launching the session, click Logging under Session on the left after loading/configuring the settings. 2. Change Session logging to Printable output. 3. Select the file to save the output to under Log file name. 4. Change any other settings here as desired. Note that these logging settings will be saved with the saved settings mentioned above. 5. Click Open to launch the logged session.

Linux – picocom

picocom is a small command line program to support serial connections.

Tip

This step is only necessary if not using the built in Terminal within CCS.

Installation

Use your distribution’s preferred method for installing programs. This is a common program and should exist in most distribution repositories. For example, if using apt (command line):

$ sudo apt install picocom

Connecting

  1. Determine the target serial device via the instructions in Finding Serial Port.

  2. Launch picocom to connect to the target serial device with a baud rate of 115200. Note that the full path to the target serial port is required. For example:

    picocom -b 115200 /dev/ttyACM0
    
  3. To exit picocom, either close the active terminal window or press Control+a followed by Control+q.

Logging Output

Logging of picocom sessions is useful in cases where the data needs to be saved. To do this, add the logging flag and a target filename, -g LOGFILENAME to the command:

picocom -b 115200 /dev/ttyACM0 -g test.log

MacOS - ????

Tip

This step is only necessary if not using the built in Terminal within CCS.

Instructions Coming Soon…