Software Installation

This page contains instructions to install and test the software required for ENGR-2350.

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. 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. Download the CCS installer for your OS from the TI website: CCSTUDIO Downloads

    1. On this page, select Download options to the right of CCSTUDIO.

    2. Download the applicable installer. Note that this download is large (>1.0 GB).

  2. Extract and run the installer.

  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 only the item MSPM0 Arm® Cortex®-M0+ microcontrollers.

_images/ccs_components.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 install process will take a several minutes.

2. MSPM0 Software Development Kit (SDK) Installation

In addition to CCS, the SDK for the microcontroller used in this class also needs to be installed. This may be done directly through CCS following the instructions below.

  1. First, launch CCS.

  2. Open the Resource Explorer. This may be done through View → Resource Explorer.

  3. Within the Resource Explorer, expand the Arm®-based microcontrollers folder on the left pane, open the subfolder Embedded Software, and select MSPM0 SDK - 2.##.##.##.

_images/ccs_mspm0sdk.png
  1. Click Download and Install on the top-right of the right pane.

  2. You will be asked to confirm the installation of the SDK along with another packages, SysConfig. Proceed with the installation with the default selections.

  3. Again, the install process will take several minutes. The progress can be monitored with the Resource Explorer (a small busy icon will appear).

  4. Verify that the install completed. Navigate again to the Resource Explorer and the MSPM0 SDK - 2.##.##.## item. If the item has a check next to it, all is good and you may move on. If it does not, click Downlaod and Install again and repeat the process noted above.

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.

  2. Extract the zip archive to a temporary location. This location should be accessible but it is not important where. When imported into CCS, it will be copied into the current workspace folder and the extracted version is not used.

  3. Select File → Import Project(s)… from the CCS Menu.

  4. In the Import dialog, select the folder where you extracted the project:

  5. Select the project from the listed Discovered projects and click Finish to import the project.

    Attention

    If a project with the same name as the project to import already exists in the workspace, the dialog will prevent another import. You must first rename the project in the current workspace to be able to import another copy.

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

  7. Upon success, this should result in the project being visible in the EXPLORER pane. If this pane is not visible, it may be shown by going to View → Explorer or selecting the Explorer icon on the left toolbar.

  8. 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:

    • First, ensure that the necessary toolbar is visible. If the toolbar shown below is not visible, enable it via View → Toggle Toolbar.

    _images/toolbar.png
    • Next, click the button on the toolbar that resembles a hammer and screwdriver crossed: compile, by Project → Build Project(s), or by pressing the CTRL+B shortcut.

    • From the menu: Project → Build Project,

  9. The Console pane will show the progress of the compilation. If all goes well, the console should read something similar as shown below:

    ...
    Building target: "TestProject.out"
    Invoking: Arm Linker
    "C:/ti/ccs2020/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS/bin/tiarmclang.exe" -march=thumbv6m -mcpu=cortex-m0plus -mfloat-abi=soft -mlittle-endian -mthumb -O0 -D__MSPM0G3507__ -gdwarf-3 -Wl,-m"TestProject.map" -Wl,--heap_size=0x800 -Wl,-i"C:/ti/mspm0_sdk_2_05_01_00/source" -Wl,-i"C:/Users/Wilt/workspace_ccstheia/TestProject" -Wl,-i"C:/ti/ccs2020/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS/lib" -Wl,--diag_wrap=off -Wl,--display_error_number -Wl,--warn_sections -Wl,--xml_link_info="TestProject_linkInfo.xml" -Wl,--rom_model -o "TestProject.out" "./main.o" "./inc/startup_mspm0g350x_ticlang.o" "./src/engr2350_gpio.o" "./src/engr2350_mspm0.o" "./src/ti_msp_dl_config.o" "../inc/mspm0g3507.cmd"  -Wl,-l"C:/ti/mspm0_sdk_2_05_01_00/source/ti/driverlib/lib/ticlang/m0p/mspm0g1x0x_g3x0x/driverlib.a" -Wl,-llibc.a
    Finished building target: "TestProject.out"
    
    **** Build Finished
    

    Attention

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

    Buildfile generation error occurred..
    Product MSPM0-SDK v2.5.1.00 is not currently installed and no compatible version is available. Please install this product or a compatible version.
    Build stopped..
    

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. LED1 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 downloaded and run. For this class, we will always do this through “Debugging”. To start debugging:

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

    • From the menu: Run → Debug Project,

    • Pressing the keyboard shortcut F5.

Note

If more than one project is in the workspace, care must be taken to ensure that the correct project is debugged! CCS may launch a different project then the one intended.

  1. Initiating the debug interface will cause the project to be compiled (turned into a program) if not done so already 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.

  2. Once the program has been loaded onto the microcontoller, the toolbar will change to show run controls. Further, the left pane may be changed automatically to the Debug view, which has the same controls.

    _images/testproject_debug.png
  3. To run the code, click the Continue toolbar button, run (F5). This should cause LED1 on the development board to blink at a steady rate.

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

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

    to:

    for(i=1000000; i>0; i--);
    
  5. Once the code is changed, debug the program again (bug) to recompile and download the program, initiating a new debug session. Alternatively, if you simple recompile (compile) the code, CCS will ask if you want to load the new version of the program in the current debug session. The latter method is slightly faster, especially if Remember my decision is selected.

  6. 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 (F6). This will halt the execution of the code at its current point, which will be indicated by a yellow arrow, location, to the left of the line of code. The code then may be resumed again by run.

  • stop Stop debugging (Shift+F5). This will disconnect the current debug session from the microcontroller but will not stop the code from running. Pressing this will require that a new debug session be started (bug).

  • restart Restart the code from the beginning (Ctrl+Shift+F5). 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.

Important

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.