Code Composer Studio Theia IDE Version 1.0+ for MSPM0 MCUs

Table of Contents

Read This First

How to Use This Guide

This guide describes only the setup and basic operation of the software development environment, but it does not fully describe the MSPM0 microcontrollers or the complete development software and hardware systems. For details of these items, see the appropriate TI and CCS documents listed in section Related Documentation From Texas Instruments.

Information About Cautions

This guide may contain cautions.

Caution - This is an example of a caution statement. A caution statement describes a situation that could potentially damage your software or equipment.

Read each caution carefully.

If You Need Assistance

The E2E Community Support Forums for MSPM0 MCUs are available to provide open interaction with peer engineers, TI engineers, and other experts. Additional device-specific information can be found on the MSPM0 website.

1. Software Installation

Code Composer Studio Theia IDE is available from TI.com.

MSPM0 microcontrollers and the MSPM0 SDK require CCS Theia 1.0.1 or higher.

See the MSPM0 SDK documentation for finding the right SDK for your IDE version.

2. Development Flow

This chapter describes how to use CCS Theia to run the demonstration programs and develop application software.

2.1 Overview

Code Composer Studio (CCS) Theia is an integrated development environment (IDE) that supports TI’s Microcontroller and Embedded Processors portfolio. Code Composer Studio Theia comprises a suite of tools used to develop and debug embedded applications.

This guide only explains some features and capabilities of the Code Composer Studio Theia IDE using MSPM0.

More documentation for CCS Theia is available at TI.com or in the Help menu included in the IDE.

2.2 Creating a New Project using Project Wizard

CCS Theia includes a new project wizard which provides an intuitive and easy way to create new project.

  1. Select FileCreate New Project

  2. Select the board or device and use filters as needed

  3. Select a project and click on Create image0

Note that CCS Theia will automatically detect any dependencies, including SDKs and compilers, and it will request installation if needed.

2.3 Using TI Resource Explorer in CCS Theia

TI Resource Explorer (TI-Rex) helps you find all the latest examples, libraries, demo applications, datasheets, and more for your chosen platform.

This tool is available at https://dev.ti.com/tirex, but it’s also integrated into CCS Theia allowing for a more integrated user experience.

  1. Select HelpGetting Started. Note that CCS Theia can automatically detect your LaunchPad for easier navigation.

  2. Click on Browse software and examples with Resource Explorer

  3. The navigation panel can be used to view different TI products, documentation, software, etc.

  4. TI Resource Explorer also allows to select a specific SDK version by clicking next to a product and selecting Manage Versions. Note that installed products are also shown with a green check mark.

  5. Use the integrated search to filter by device (i.e. MSPM0L), middleware (i.e. DriverLib), or solution (i.e. LIN).

  6. Selecting an example will show a useful Readme document with a description of the example, peripheral and pin usage and how to run it. image1

  7. Select a CCS project for the example and click on Import to add it to your workspace.

Note that CCS Theia will automatically detect any dependencies, including SDKs and compilers, and it will request installation if needed.

2.4 Using SysConfig with CCS Theia

Some examples in the MSPM0 SDK have SysConfig support. SysConfig is an intuitive and comprehensive collection of graphical utilities for configuring pins, peripherals, radios, subsystems, and other components. SysConfig helps you manage, expose, and resolve conflicts visually so that you have more time to create differentiated applications.

The SysConfig tool is delivered as a standalone installer, it can be used on the cloud at dev.ti.com, or it’s integrated into CCS Theia for better and easier experience.

After importing a MSPM0 project in CCS Theia, simply double-click the .syscfg file and this will open SysConfig. image2

For more information about using SysConfig with MSPM0, visit the Using SysConfig with MSPM0 guide.

2.5 Migrating Between MSPM0 Derivatives

SysConfig allows for an easier migration between MSPM0 derivatives; however some manual modifications are required. The steps below apply to TI Arm Clang but similar steps apply to Arm GCC.

  1. In SysConfig, enable the Device View and click on SWITCH

  1. Select the corresponding options for the new MSPM0 device and click CONFIRM.

  1. Note that SysConfig will highlight any conflicts with the migration, such as unavailable pins and peripherals. Fix any conflicts as needed.

  2. CCS Theia will automatically migrate the device variant and will add a corresponding .ccxml file.

  1. In the project properties, select BuildArm CompilerPredefined Symbols. Select the device definition and update it.

  1. Update the linker and startup files. The MSPM0 SDK includes default files for all MSPM0 derivatives at <sdk>\source\ti\devices\msp\m0p\linker_files\ticlang and <sdk>\source\ti\devices\msp\m0p\startup_system_files\ticlang respectively.

Note that previous files should be excluded or removed from the project.

  1. Resolve any other dependencies such as incompatible libraries and source code.

Note: Steps 1-3 don’t apply when not using SysConfig, and step 4 needs to be done manually.

2.6 Stack and Heap Management and Linker Files

The reserved stack and heap size can be configured using project settings or in the linker files.

2.6.1 Configure Stack and Heap using TI Arm Clang compiler

Right-click on a project and select Properties. Select Build ToolsArm LinkerBasic Options and set the stack and heap accordingly. image3

The stack and heap can also be modified directly on the linker .cmd file by adding or editing --stack_size=xx or --heap_size=xx.

2.6.2 Configure Stack and Heap using Arm GCC

The stack can be modified directly on the linker .lds file by adding or editing _Min_Heap_Size = xx or _Min_Stack_Size = xx.

2.7 How to Generate TI .TXT (and Other Format) Files

CCS Theia includes the Arm Hex Utility which can be used to generate output objects in TI .TXT format for use with programming tools such as MSP-GANG and UniFlash.

Right-click on a project and select Properties. Select Build ToolsArm Hex UtilityOutput Format Options. Then select the TI-TXT hex (–ti_txt) option.

This same process can be used to generate other formats; however, some formats might require other parameters.

A common one is Intel HEX format which in addition to selecting the output format Intel hex (–intel, -i), requires to specify the memory and ROM width as parameters.

When using Intel HEX for MSPM0, select a memory and ROM width of 8 in Build ToolsArm Hex UtilityGeneral Options.

For more information, visit Hex utility in CCS.

2.8 Overriding Pre-built Libraries

Projects might include pre-built libraries which simplify development and build time; however, they don’t allow developers to modify source code easily.

An example of such libraries is the MSPM0 DriverLib which is shown below.

One option to override the library is to simply add any or all source files to the project. The MSPM0 SDK includes the empty_driverlib_src example which includes all DriverLib source by default:

3. Debugging the Application

The following debug probes have been tested successfully with Code Composer Studio Theia IDE.

  • TI XDS Tools, including the XDS-110 integrated into MSPM0 LaunchPads.

3.1 Using TI XDS Tools

TI offers a range of debug probes for Arm-based devices, including the XDS-110 which is integrated with MSPM0 LaunchPads.

To use the TI-XDS debug probes, open the project options, click on GeneralConnection and select Texas Instruments XDS110 USB Debug Probe.

3.1.1 Flash Loader

The Flash Loader settings allow to configure some settings when programming and erasing the device.

To view and modify these settings, open the project properties and select DebugCategory:MSPM0 Flash Settings.

The Flash Loader has the following options:

  • Reset Configuration: allows to perform soft or hard reset before and after programming.

  • Program Configuration: enables/disables CRC verification while programming. Note that CRC validation of NONMAIN is performed when programming/erasing NONMAIN regardless of this setting.

  • Erase Configuration: configures the behavior when erasing memory. The options are:

    • Erase MAIN memory only: Only MAIN memory will be mass erased. An error will be thrown when attempting to write NONMAIN.

    • Erase MAIN and NONMAIN memory: Both MAIN and NONMAIN will be mass erased. See Erasing and Updating NONMAIN Memory for information about NONMAIN usage.

    • Erase MAIN and NONMAIN necessary sectors only: Only sectors being updated will be erased, including both MAIN and NONMAIN. Check the device datasheet for information on the size of flash sectors. See Erasing and Updating NONMAIN Memory for information about NONMAIN usage.

    • Erase MAIN memory sectors by range: Only sectors defined between Sector Erase Start Address and Sector Erase End Address will be erased. Check the device datasheet for information on the size of flash sectors and note that the addresses are inclusive. For example, a region from 0x0000_0100 to 0x0000_0400 on a MSPM0 device with 1kB sectors will erase sectors 0x0000_0000-0x0000_03FF and 0x0000_0400-0x0000_07FF. Note that only sectors in MAIN will be erased. An error will be thrown when attempting to write NONMAIN.

    • Do not erase Flash memory: Flash will not be erased. An error will be thrown when attempting to write NONMAIN without erasing.

  • Advanced Configuration: disables validating the device ID. Used for debugging purposes and not recommended to disable.

  • Enable Verbose Output: enables showing debug information while running the flash loader.

3.1.2 Erasing and Updating NONMAIN Memory

Caution: Extreme care should be taken when erasing and programming NONMAIN. If done incorrectly, the device will become locked in a permanently unrecoverable state.

NONMAIN is a dedicated region of flash memory which stores configuration data which define the behavior of the device after booting. NONMAIN should not be used for any other purpose. See the device Technical Reference Manual for more information.

TI recommends using the NONMAIN configurator available in SysConfig when configuring NONMAIN. See Using SysConfig with MSPM0 for more information.

As described in the Flash Loader section, NONMAIN is erased by selecting Erase main and NON-MAIN memory or Erase MAIN and NONMAIN necessary sectors only in the erase configuration.

Note that the Flash Loader will erase NONMAIN if any of these options are enabled; however, it will run a CRC after the programming sequence is completed, and it will attempt to restore default values if NONMAIN is corrupted.

3.2 Breakpoint Types

The CCS Theia debugger uses a limited number of on-chip debugging resources (specifically 4 hardware breakpoints and 2 hardware watchpoints). Software breakpoints in Flash are not supported on MSPM0. This means that a maximum of 4 hardware breakpoints can be set within CCS Theia.

CCS Theia can use a breakpoint to stop at main or halt the device at exit. These settings can be updated in the project properties by selecting DebugCategory:Program/Memory Load Options.

If the max number of breakpoints are set, the following warning will be displayed.

3.3 Connecting to an Incorrect Device

CCS Theia will show an error if an unsupported device is connected as shown below:

image4 image5

Programming an incorrect device is not recommended and can lead to unexpected and unrecoverable behavior.

4. Known Issues and Frequently Asked Questions (FAQs)

Please refer to Known Issues and FAQ inside the SDK.