IAR Embedded Workbench IDE Version 9.70.2 for MSPM33 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 MSPM33 microcontrollers or the complete development software and hardware systems. For details of these items, see the appropriate TI and IAR documents listed in section Related Documentation From Texas Instruments.
This guide applies to the use of the TI XDS-110 development tools series.
These tools contain the most up-to-date materials available at the time of packaging. For the latest materials (including data sheets, user’s guides, software, and application information), visit the TI MSPM33 website or contact your local TI sales office.
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 MSPM33 MCUs are available to provide open interaction with peer engineers, TI engineers, and other experts. Additional device-specific information can be found on the MSPM33 website.
1. Software Installation¶
IAR Embedded Workbench for Arm (EWARM) IDE is available from the IAR website or the TI IAR kickstart page. MSPM33 microcontrollers and the MSPM33 SDK require EWARM 9.70.2 or higher.
See the MSPM33 SDK documentation for finding the right SDK for your IDE version.
2. Development Flow¶
This chapter describes how to use IAR EWARM to run the demonstration programs, develop application software, and how to use C-SPY to debug it.
2.1 Overview¶
Applications are developed in assembler or C using the Workbench, and they are debugged using C-SPY. C-SPY is seamlessly integrated into the Workbench. However, it is more convenient to make the distinction between the code development environment (Workbench) and the debugger (C-SPY). C-SPY can be configured to operate with a programmer tool such as XDS-110 connected to an MSPM33 device, or with a software simulator of the device. IAR EWARM refers to the Workbench and C-SPY collectively.
Documentation for IAR EWARM is extensive, but the components of IAR EWARM (IDE, debugger, assembler, compiler, linker) are fully documented in <Installation Root>\Embedded Workbench x.x\common\doc and <Installation Root>\Embedded Workbench\arm\doc.
The PDF files located throughout the EWARM directory tree contain the most up-to-date information. In addition, EWARM documentation is available online through the Help tab in the IDE.
Tool |
User’s Guide |
|---|---|
IDE |
EWARM_IDEGuide.ENU.pdf |
Assembler |
EWARM_AssemblerReference.ENU.pdf |
Compiler |
EWARM_DevelopmentGuide.ENU.pdf |
C Library |
EWARM_DevelopmentGuide.ENU.pdf |
Linker and Librarian |
EWARM_DevelopmentGuide.ENU.pdf |
Debugging |
EWARM_DebuggingGuide.ENU.pdf |
2.2 Creating an MSPM33 Project From the MSPM33 SDK¶
Please refer to the MSPM33 SDK QuickStart Guide for IAR which contains instructions on how to install the MSPM33 SDK and importing and building an SDK example in IAR.
2.3 Creating a Project From Scratch¶
Note: Creating a project from scratch is not recommended since creating the project from scratch doesn’t add all of the necessary device support files by default. To start from a blank project, TI recommends importing the Empty Driverlib example project from the MSPM33 SDK.
2.4 Using SysConfig with IAR¶
Some examples in the MSPM33 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 which can be manually integrated into IAR, or can be used via the dev.ti.com cloud tools portal.
The best way to start a SysConfig project in IAR is to import it from the SDK; however, some steps are required to initialize SysConfig in IAR for the first time. Refer to the MSPM33 SDK QuickStart Guide for IAR for more details on installing SysConfig and enabling it for IAR.
For more information about using SysConfig with MSPM33, visit the Using SysConfig with MSPM33 guide.
2.5 Stack and Heap Management and .icf Files¶
The reserved stack and heap size can be configured through direct modification of the .icf linker configuration files. These files are input to the linker and contain statements that control the allocation of device memory (RAM, flash). See the IAR Development Guide documentation for a complete description of these files.
The supplied .icf files can be modified to tune the size of the stack and heap to the needs of the application; edit __ICFEDIT_size_cstack__=xx or __ICFEDIT_size_heap__=xx to allocate xx bytes for the stack or heap.
2.6 How to Generate TI .TXT (and Other Format) Files¶
The linker can be configured to output objects in TI .TXT format for use with programming tools such as UniFlash.
Click Project → Options → Output Converter → Generate additional output → Output format → Texas Instruments TI-TXT. Intel Hex or other formats also can be selected.
2.7 Erasing and Programming NONMAIN for MSPM33¶
Caution: Extreme care should be taken when erasing and programming NONMAIN. If done incorrectly, the device will become locked in a permanently unrecoverable state.
Click Options → Debugger → Download → Override default .board file → Edit.
Select the 2nd element and then click Okay:
Add
--non_main_eraseas an extra parameter:
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 MSPM33 DriverLib which is shown below.
3. Debugging the Application¶
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 MSPM33 LaunchPads.
Note: TI XDS-110 debug probes are enabled for use through the CMSIS-DAP protocol. However, the TI XDS native drivers currently give higher performance.
To use them with EWARM, installation of the XDS emulation package is required. A copy of the emulation package is located in the EWARM installation under \arm\drivers\ti-xds. See the Readme.txt document that is also located in this folder. TI recommends installing the emulation package in c:\ti\xds\ewarm_version. Do not use XDS emulation packages from other EWARM versions, as they might not be compatible and can result in errors when debugging.
To use the TI-XDS debug probes,select Options → Debugger → Driver → TI XDS:
When the emulation package has been installed, XDS debug probes can be selected in Options → Debugger → TI XDS:
Note the selected Emulator. The LaunchPads include an integrated TI XDS110 Emulator.
The selected Interface is SWD which is supported by MSPM33.
Note the TI EmuPack installation path. Override if desired.
The XDS tools use a Flash Loader to download code to the device. Confirm usage in Options → Debugger → Use flash loader(s):
3.2 Breakpoint Types¶
The C-SPY breakpoint mechanism uses a limited number of on-chip debugging resources (specifically 8 hardware breakpoints and 4 hardware watchpoints). Software breakpoints are not supported on MSPM33. This means that a maximum of 8 breakpoints can be set within C-SPY.
Resetting a program and the Run To Cursor operation temporarily require a breakpoint. As a result, only 7 breakpoints can be active. If 8 breakpoints are being used, C-SPY will automatically disable a breakpoint.
If the max number of breakpoints are set, the following warning will be displayed.
3.3 Additional Settings¶
When running a project on the MSPM33 Launchpad, make sure to do the following:
Click Options → TI XDS → Breakpoints and set the Default Breakpoint Type to Hardware. This is to make sure the debugger stops at main().
Click Options → TI XDS → Setup and set Reset to Device Reset.
4. Known Issues and Frequently Asked Questions (FAQs)¶
Please refer to Known Issues and FAQ inside the SDK.