Getting Started Guide
Getting Started Guide
21
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1 About TI-RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 What is TI-RTOS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 What are the TI-RTOS Components?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 What Boards and Devices Have TI-RTOS Examples?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4 What Drivers Does TI-RTOS Include? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5 What Examples Are Available?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6 For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installing TI-RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Installing Code Composer Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Installing TI-RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Installing TI-RTOS on Windows for Use in Code Composer Studio . . . . . . . . . . . . . . . . . 2.3.2 If TI-RTOS is Installed Outside CCS on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.3 Installing TI-RTOS on Linux for Use in Code Composer Studio . . . . . . . . . . . . . . . . . . . . 2.3.4 Installing TI-RTOS for Use in IAR Embedded Workbench . . . . . . . . . . . . . . . . . . . . . . . . Examples for TI-RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 Creating Example Projects Using the TI Resource Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 Creating an Empty TI-RTOS Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Creating Example Projects to Build via a Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Creating Examples with IAR Embedded Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 Preparing the TI-RTOS Examples for Use in IAR Embedded Workbench . . . . . . . . . . . . 3.3.2 Integrating TI-RTOS Examples with IAR IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3 Creating TI-RTOS Examples with IAR Embedded Workbench . . . . . . . . . . . . . . . . . . . . . 3.3.4 Using TI-RTOS Examples for IAR Embedded Workbench . . . . . . . . . . . . . . . . . . . . . . . . 3.3.5 Using Command Line Builds with TI-RTOS Examples for IAR Embedded Workbench . . 3.3.6 Managing Program Stack Sizes for TI-RTOS Examples for IAR . . . . . . . . . . . . . . . . . . . . 3.4 Summary of Example Peripheral Use and Target Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Concerto TMDXDOCKH52C1 Settings and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1 Setting the MAC Address. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2 USB Host Mode Board Modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 Concerto TMDXDOCK28M36 Settings and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.1 Setting the MAC Address. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7 Tiva EK-TM4C123GXL Settings and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8 Tiva DK-TM4C123G Settings and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9 Tiva DK-TM4C129X Settings and Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10 MSP430 MSP-EXP430F5529LP Settings and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11 MSP430 MSP-EXP430F5529 Settings and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12 BoosterPacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.1 SD Card BoosterPack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5 6 7 7 8 8 12 13 13 14 14 14 15 15 16 17 19 21 22 22 22 23 24 25 26 27 30 32 32 33 34 35 37 41 43 45 46 46
SPRUHD3GJanuary 2014
Contents
Contents
www.ti.com
3.12.2 TMP006 BoosterPack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.3 CC3000 BoosterPacks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.4 RF430CL330 NFC Transponder Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.5 TPL0401EVM Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.13 Installing USB Drivers for the USB Device Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Configuring TI-RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 Starting the Configuration Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Configuring TI-RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Configuring Individual Sub-Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46 47 47 48 48 51 52 53 54
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Contents
SPRUHD3GJanuary 2014
Preface
SPRUHD3GJanuary 2014
Notational Conventions
This document uses the following conventions:
Program listings, program examples, and interactive displays are shown in a special typeface. Examples use a bold version of the special typeface for emphasis. Here is a sample program listing:
#include <xdc/runtime/System.h> Int main(Void) { System_printf("Hello World!\n"); return (0); }
Square brackets ( [ and ] ) identify an optional parameter. If you use an optional parameter, you specify the information within the brackets. Unless the square brackets are in a bold typeface, do not enter the brackets themselves.
Trademarks
Registered trademarks of Texas Instruments include Stellaris and StellarisWare. Trademarks of Texas Instruments include: the Texas Instruments logo, Texas Instruments, TI, TI.COM, C2000, C5000, C6000, Code Composer, Code Composer Studio, Concerto, controlSUITE, DSP/BIOS, SPOX, Tiva, Tivaware, TMS320, TMS320C5000, TMS320C6000 and TMS320C2000. ARM is a registered trademark, and Cortex is a trademark of ARM Limited. Windows is a registered trademark of Microsoft Corporation. Linux is a registered trademark of Linus Torvalds. IAR Systems and IAR Embedded Workbench are registered trademarks of IAR Systems AB: All other brand or product names are trademarks or registered trademarks of their respective companies or organizations.
January 2, 2014
SPRUHD3GJanuary 2014
Chapter 1
SPRUHD3GJanuary 2014
About TI-RTOS
This chapter provides an overview of TI-RTOS.
Page What is TI-RTOS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 What are the TI-RTOS Components? . . . . . . . . . . . . . . . . . . . . . . . . . . 6 What Boards and Devices Have TI-RTOS Examples? . . . . . . . . . . . . . 7 What Drivers Does TI-RTOS Include? . . . . . . . . . . . . . . . . . . . . . . . . . . 7 What Examples Are Available? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1
What is TI-RTOS?
TI-RTOS is a scalable, one-stop embedded tools ecosystem for TI devices. TI-RTOS makes it easier to develop embedded applications that run on TI devices. TI-RTOS contains several software components and examples that use these components together. It provides an OS kernel, communications support, drivers, and more. It is tightly integrated with TIs Code Composer Studio (CCS) development environment. In addition, examples demonstrate how to use each supported device and driver. These can be used as a starting point for your own projects.
SPRUHD3GJanuary 2014
About TI-RTOS
www.ti.com
1.2
SYS/BIOS. SYS/BIOS is a scalable real-time kernel. It is designed to be used by applications that require real-time scheduling and synchronization or real-time instrumentation. It provides preemptive multi-threading, hardware abstraction, real-time analysis, and configuration tools. SYS/BIOS is designed to minimize memory and CPU requirements on the target. The FatFs module used by several examples is part of SYS/BIOS. IPC. This is a component containing packages that are designed to allow communication between processors in a multi-processor environment and communication to peripherals. This communication includes message passing, streams, and linked lists. These work transparently in both uni-processor and multiprocessor configurations. MSP430Ware. This software is an extensive suite of drivers, code examples, and design resources designed to simplify and speed development of MSP430 microcontroller applications. This component is customized and built as a library to support MSP430F5xx_6xx devices with TI-RTOS.1 MWare. The M3 portion of controlSUITE. It includes low level drivers and examples.2 NDK. The Network Developer's Kit (NDK) is a platform for development and demonstration of network enabled applications on TI embedded processors, currently limited to the TMS320C6000 family and ARM processors. TivaWare. This software is an extensive suite of software designed to simplify and speed development of Tiva-based microcontroller applications. (TivaWare was previously called StellarisWare.) This component is rebuilt to include only the portions required by TI-RTOS.2 UIA. The Unified Instrumentation Architecture provides target content that aids in the creation and gathering of instrumentation data (for example, Log data). XDCtools. This component provides the underlying tooling for configuring and building SYS/BIOS, IPC, NDK, and UIA. TI-RTOS installs XDCtools only if the version needed by TI-RTOS has not already been installed as part of a CCS or SYS/BIOS installation. If TI-RTOS installs XDCtools, it places it in the top-level CCS directory (for example, c:\ti), not the TI-RTOS products directory.
To see the release notes for each component, you can select a component in the TI Resource Explorer under TI-RTOS > Products. TI-RTOS installs versions of these components that have been reduced in size by removing files that apply only to device families not supported by TI-RTOS.
1. Customization details for MSP430Ware and instructions for building MSP430Ware's driverlib libraries for MSP430F5xx6xx families are provided in the TI-RTOS.README in the top-level directory of the MSP430Ware component. 2. The MWare and TivaWare libraries distributed with TI-RTOS have been rebuilt with the following compiler option: --define=USE_RTOS. See the TI-RTOS.README file in the top-level folders of the MWare and TivaWare components of TI-RTOS for details.
SPRUHD3GJanuary 2014
About TI-RTOS
www.ti.com
1.3
Both M3 and 28x sides of Concerto boards are supported. If you want to use any of these components with other device families, you will need to download and install the complete component separately. For example, if you want to use SYS/BIOS with a C64x+ device, you will need to download and install the full SYS/BIOS product. Examples are provided specifically for the supported boards, but libraries are provided for each of these device families, so that you can port the examples to similar boards. Porting information for TI-RTOS is provided on the Texas Instruments Wiki, including a topic on Creating TI-RTOS Projects for Other MSP430 Devices. For MSP430 devices, TI-RTOS drivers are prebuilt only for MSP430F5529 devices. TI-RTOS drivers for other MSP430 devices in the MSP430F5xx and MSP430F6xx families must be added into the TI-RTOS build system. See "Rebuilding MSP430Ware's driverlib for TI-RTOS and Its Drivers" in the TI-RTOS Users Guide (SPRUHD4) for details.
1.4
EMAC. Ethernet driver used by the networking stack (NDK) and not intended to be called directly. I2C. API set intended to be used directly by the application or middleware. GPIO. API set intended to be used directly by the application or middleware to manage the GPIO interrupts, pins, and ports. SPI. API set intended to be used directly by the application or middleware to communicate with the Serial Peripheral Interface (SPI) bus. SPI is sometimes called SSI (Synchronous Serial Interface). SDSPI. Driver for SD cards using a SPI (SSI) bus. This driver is used by the FatFS and not intended to be called directly by the application. UART. API set intended to be used directly by the application to communicate with the UART.
About TI-RTOS
SPRUHD3GJanuary 2014
www.ti.com
USBMSCHFatFs. USB MSC Host under FatFS (for Flash drives). This driver is used by FatFS and is not intended to be called directly by the application. Other USB functionality. See the USB examples for reference modules that provide support for the Human Interface Device (HID) class (mouse and keyboard) and Communications Device Class (CDC). This code is provided as part of the examples, not as a separate driver. Watchdog. API set intended to be used directly by the application or middleware to manage the watchdog timer. WiFi. Driver used by a Wi-Fi device's host driver to exchange commands, data, and events between the host MCU and the wireless network processor. Not intended to be called directly.
In addition, TI-RTOS provides the following MessageQ transport: SPIMessageQTransport. MessageQ transport for the SPI driver for use in multicore applications that use the IPC component.
1.5
Most examples use the SysMin System Support module. See the readme files in the individual example projects for details. The empty, demo, and most UART examples use the ti.uia.sysbios.LoggingSetup module with stop mode data collection. The UART Console example uses run-time data collection during Idle thread processing. For more details on data collection, see Chapter 2 of the TI-RTOS Users Guide (SPRUHD4). All examples have the same <board>.c and <board>.h files. These files perform board-specific configuration of the drivers provided by TI-RTOS. For more details, see Chapter 4 of the TI-RTOS Users Guide (SPRUHD4).
1.6
TI-RTOS TI-RTOS Users Guide (SPRUHD4) TI-RTOS on the Texas Instruments Wiki TI-RTOS forum on TIs E2E Community TI-RTOS Porting Guide Embedded Software Download Page
SPRUHD3GJanuary 2014
About TI-RTOS
www.ti.com
Code Composer Studio (CCS) CCS online help CCSv5 on the Texas Instruments Wiki Code Composer forum on TIs E2E Community
SYS/BIOS SYS/BIOS 6 Getting Started Guide at <tirtos_install>/products/bios_#_##_##_##/docs/Bios_Getting_Started_Guide.pdf SYS/BIOS Users Guide (SPRUEX3) SYS/BIOS online reference (also called "CDOC"). Open from CCS help or run <tirtos_install>/products/bios_#_##_##_##/docs/cdoc/index.html. SYS/BIOS on the Texas Instruments Wiki TI-RTOS forum on TIs E2E Community SYS/BIOS 6.x Product Folder
XDCtools XDCtools online reference. Open from CCS help or run <xdc_install>/docs/xdctools.chm. RTSC-Pedia Wiki TI-RTOS forum on TIs E2E Community
IPC IPC Users Guide (SPRUGO6) IPC online API reference. Run <tirtos_install>/products/ipc_#_##_##_##/docs/doxygen/index.html. IPC online configuration reference. Open from CCS help or run <tirtos_install>/products/ipc_#_##_##_##/docs/cdoc/index.html.
NDK NDK Users Guide (SPRU523) NDK Programmers Reference Guide (SPRU524) NDK online API reference. Run <tirtos_install>/products/ndk_#_##_##_##/docs/doxygen/html/index.html. NDK online configuration reference. Open from CCS help or run <tirtos_install>/products/ndk_#_##_##_##/docs/cdoc/index.html. NDK on the Texas Instruments Wiki TI-RTOS forum on TIs E2E Community
UIA System Analyzer Users Guide (SPRUH43) UIA online reference. Open from CCS help or run <tirtos_install>/products/uia_#_##_##_##/docs/cdoc/index.html. System Analyzer on the Texas Instruments Wiki
About TI-RTOS
SPRUHD3GJanuary 2014
www.ti.com
MWare and controlSUITE Documents in <tirtos_install>/products/MWare_##_##_##_##/doc controlSUITE on the Texas Instruments Wiki controlSUITE Product Folder
MSP430Ware Documents in <tirtos_install>/products/MSP430Ware_##/doc MSP430Ware Product Folder TivaWare Documents in <tirtos_install>/products/TivaWare_C_Series-#.#/docs TivaWare Product Folder Online StellarisWare Workshop
FatFS API Open source documentation FatFS for SYS/BIOS wiki page SYS/BIOS online reference (also called "CDOC"). Open from CCS help or run <tirtos_install>/products/bios_#_##_##_##/docs/cdoc/index.html. Navigate to the ti.sysbios.fatfs.FatFS module topic in the SYS/BIOS API reference documentation.
General microcontroller information Microcontrollers forum on TIs E2E Community Concerto boards and devices Concerto F28M35x Technical Reference Manual Concerto F28M36x Technical Reference Manual C2000 on the Texas Instruments Wiki Concerto on the Texas Instruments Wiki Concerto Product Folder H52C1 Concerto Experimenter Kit F28M35H52C Concerto Microcontroller datasheets H63C2 Concerto Experimenter Kit F28M36P63C2 Concerto Microcontroller datasheets
MSP430 boards and devices MSP-EXP430F5529LP LaunchPad Evaluation Kit MSP430 USB Developers Package (which includes the USB Descriptor Tool) MSP430F5529 Microcontroller
SPRUHD3GJanuary 2014
About TI-RTOS
10
www.ti.com
Tiva boards and devices Tiva C Series TM4C123G LaunchPad Evaluation Kit TM4C123GH6PM Tiva C Series Microcontroller EKS-LM4F232 Evaluation Kit TM4C123GH6PGE Tiva C Series Microcontroller
BoosterPacks EM Adapter BoosterPack RF430CL330H NFC Dynamic Tag Target Board SD Card BoosterPack TMP006 BoosterPack I2C TPL0401EVM BoosterPack
SD Cards Specification I2C Specification WiFi SimpleLink Wi-Fi CC3000 Wiki CC3000 Product Folder SimpleLink Wi-Fi SmartConfig Apps
11
About TI-RTOS
SPRUHD3GJanuary 2014
Chapter 2
SPRUHD3GJanuary 2014
Installing TI-RTOS
This chapter covers the required steps needed to install and build TI-RTOS.
SPRUHD3GJanuary 2014
Installing TI-RTOS
12
System Requirements
www.ti.com
2.1
System Requirements
The Windows version of TI-RTOS can be installed on systems running Windows 7, Windows Vista, or Windows XP (SP2 or SP3). A Linux version of TI-RTOS is also available. In order to install TI-RTOS, you must have at least 2 GB of free disk space. (If you have not yet installed Code Composer Studio, you will also need at least 2 GB of disk space for that installation.)
2.2
To install CCS 5.5, go to the product page at http://www.ti.com/tool/ccstudio and follow a link to download the software for your license type. Run the executable installer, and answer the prompts as appropriate. We strongly recommend that you install CCS in the default installation directory of c:\ti. When you are prompted for the type of Setup, select "Complete Feature Set". Note: TI-RTOS installs versions of SYS/BIOS and XDCtools that may be newer than the versions installed by CCS. For TI-RTOS to work properly, you should use the software versions delivered with TI-RTOS.
13
Installing TI-RTOS
SPRUHD3GJanuary 2014
www.ti.com
Installing TI-RTOS
2.3
Installing TI-RTOS
TI-RTOS product comes delivered as an installer that needs to be installed in Code Composer Studio's installation directory. See the Embedded Software Download Page to download the latest installers.
2.3.1
2.3.2
SPRUHD3GJanuary 2014
Installing TI-RTOS
14
Installing TI-RTOS
www.ti.com
2.3.3
2.3.4
15
Installing TI-RTOS
SPRUHD3GJanuary 2014
Chapter 3
SPRUHD3GJanuary 2014
Topic 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13
Page Creating Example Projects Using the TI Resource Explorer . . . . . . 17 Creating Example Projects to Build via a Command Line. . . . . . . . . 21 Creating Examples with IAR Embedded Workbench. . . . . . . . . . . . . 22 Summary of Example Peripheral Use and Target Support . . . . . . . . 27 Concerto TMDXDOCKH52C1 Settings and Resources . . . . . . . . . . . 30 Concerto TMDXDOCK28M36 Settings and Resources . . . . . . . . . . . 33 Tiva EK-TM4C123GXL Settings and Resources . . . . . . . . . . . . . . . . . 35 Tiva DK-TM4C123G Settings and Resources . . . . . . . . . . . . . . . . . . . 37 Tiva DK-TM4C129X Settings and Resources . . . . . . . . . . . . . . . . . . . 41 MSP430 MSP-EXP430F5529LP Settings and Resources. . . . . . . . . . 43 MSP430 MSP-EXP430F5529 Settings and Resources . . . . . . . . . . . . 45 BoosterPacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Installing USB Drivers for the USB Device Examples . . . . . . . . . . . . 48
SPRUHD3GJanuary 2014
16
www.ti.com
3.1
2. Expand the TI-RTOS item in the tree to show the projects available for your board. The examples for a particular board are grouped based on the tool chain (TI or GNU) used for compilation and then based on the peripheral used by the example, such as UART or SPI. 3. Select an example to create. See Section 3.4, Summary of Example Peripheral Use and Target Support and the readme files provided in the example projects for information about each example.
17 Examples for TI-RTOS SPRUHD3GJanuary 2014
www.ti.com
4. Click the Step 1 link in the right pane of the TI Resource Explorer to Import the example project into CCS. This adds a new project to your Project Explorer view. A green checkmark is placed next to each step you have completed for the selected example.
The project created will have a name with the format <example>_<device>.You can expand the project to view or change the source code and configuration file. Note: CCS will not allow two projects with the same name in a workspace. If you want to import both TI and GNU projects for the same board and example in the same workspace, you would need to rename the first project you import before importing the second version. 5. Click the Step 2 link when you are ready to build the project. If you want to change any build options, right click on the project and select Properties from the context menu. For example, you can change compiler, linker, and RTSC (XDCtools) options.
6. When you are ready to debug the example, click the Step 3 link to create a target configuration to connect with the board.
7. You will see the Debugger Configuration dialog. Choose an emulator from the list. For the F28M3x devices, choose the Texas Instruments XDS 100v2 USB Emulator. For Tiva devices, choose the Stellaris In-Circuit Debug Interface. For MSP430 devices, choose the TI MSP430 USB1.
SPRUHD3GJanuary 2014
18
www.ti.com
8. Click the Step 4 link to launch a debug session for the project and switch to the CCS Debug Perspective.
3.1.1
4. In the Connection field, choose the Texas Instruments XDS 100v2 USB Emulator for F28M3x devices. For Tiva devices, choose the Stellaris In-Circuit Debug Interface. For MSP430 devices, choose the TI MSP430 USB1.
19
SPRUHD3GJanuary 2014
www.ti.com
5. In the Project templates and examples list, expand the TI-RTOS category and select the Empty Project item. If TI-RTOS is not in the list, no examples are provided for the device you selected.
6. Click Next. The next page of the new project wizard shows only the TI-RTOS product selected. The SYS/BIOS, IPC, and UIA components do not need to be selected, because they are components that are included with TI-RTOS.
7. Click Finish. The files in the empty project example include: Key C files: empty.c, <board>.c/.h Key configuration files: empty.cfg Linker command file: <board>.cmd 8. Add to the example as needed to implement your application. Note: Additional configuration might be needed as you add to the example. For example, if you add networking, you will likely need to increase the heap sizes.
SPRUHD3GJanuary 2014
20
www.ti.com
3.2
For the destination path, use a UNIX-style path. That is, use forward slashes (/) instead of backslashes (\). For example, DEST="C:/myfiles". The output from this command is a tirtos_1_21_##_##_examples directory tree containing folders for the supported boards. Each board folder contains folders for all the examples available for that board. Examples for TI, IAR and GNU are generated for boards supported by TI-RTOS. Each board directory contains a makedefs file that can be modified to specify other installation paths or compiler/linker options and a makefile that can be used to build all the examples for that board. Each example directory has its own makefile that can be used to build that example specifically.
21
SPRUHD3GJanuary 2014
www.ti.com
3.3
3.3.1
3.3.2
SPRUHD3GJanuary 2014
22
www.ti.com
3.3.3
6. In the partners table, click the Example Projects button in the Texas Instruments row.
7. Click the "example applications" link to open the Texas Instruments -- TI-RTOS Examples page. 8. Click the link to browse example applications. 9. Expand the list of examples. Click on an example to add files for that example to your current project.
23
SPRUHD3GJanuary 2014
www.ti.com
10. Right-click on the project file, and choose Options. Select the Debugger category, and change the Driver to FET Debugger in the Setup tab.
11. Move to the Plugins tab and put a checkmark in the box next to TI-RTOS. This enables the RTOS Object View (ROV) plugin tools. Click OK. Note that you will need to change these Debugger options separately for each TI-RTOS project you create in IAR. 12. If you are using an ARM target, move to the Download tab and put a checkmark in the Use flash loader(s) box. 13. Choose File > Save Workspace from the IAR menus. 14. Browse to the location where you want to save this workspace, and type a name for the workspace file (*.eww). It is common to save the project and workspace in the same directory. Click Save.
3.3.4
SPRUHD3GJanuary 2014
24
www.ti.com
3.3.5
Using Command Line Builds with TI-RTOS Examples for IAR Embedded Workbench
You can import, build, and run TI-RTOS examples from within IAR Workbench as described in the previous section. Alternately, if you want to build TI-RTOS examples from the command line, you can use the provided makefiles outside the IAR Embedded Workbench IDE. The executable files you build will have a *.out file extension. To build an example project from the command line, follow these steps: 1. Move to the board-level directory of the destination you specified for the examplesgen command. For example, if you built the examples tree in C:\myfiles and you are using the MSP-EXP430F5529 board, move to the C:\myfiles\tirtos_1_21_##_##_examples\IAR\MSP_EXP430F5529 directory. 2. Use a text editor to edit the makedefs file in that directory. 3. Modify the CODEGEN_INSTALLATION_DIR variable in the makedefs file as needed to make it point to the location of the IAR compiler. For example:
CODEGEN_INSTALLATION_DIR = C:/Program Files (x86)/IAR Systems/Embedded Workbench 6.5/430 or CODEGEN_INSTALLATION_DIR = C:/Program Files (x86)/IAR Systems/Embedded Workbench 6.5/arm
4. To build all the examples for a particular board, navigate to that board's directory and run the following command, where <xdctools_dir> is the location of the XDCtools component that was installed with TI-RTOS. For example, C:\myfiles\xdctools_3_25_##_##.
> <xdctools_dir>\gmake all
5. To build only one example, go to that examples directory and run the same gmake all command. After you build a TI-RTOS example from the command line, follow these steps to use IAR to load the externally-built executable onto the target and debug the application: 1. Choose Project > Create New Project from the IAR menus. 2. Select the Tool chain, and choose the Externally built executable template. Click OK. 3. Browse to the location where you want to save this project, and type a name for the project file (*.ewp). Click Save. 4. Delete any readme.txt file that is added to the project. 5. Choose File > Save Workspace from the IAR menus. Browse to the location where you want to save this workspace, and type a file name for the workspace file (*.eww). Click Save. 6. Choose Project > Options. 7. In the General Options category, go to the Target tab and select your specific Device. 8. In the Debugger category of the Options dialog, replace the default Simulator driver with the appropriate TI debugger. Choose the FET Debugger for MSP430 and the TI Stellaris debugger for a Tiva or Stellaris board. Click OK. 9. Choose Project > Add Files. Change the file types filter to show All Files (*.*). 10. Browse to the location of the executable file you built. Select the <examplename>.out executable file and click Open. 11. Choose Project > Download and Debug to load the executable onto the target hardware. 12. Use the debugging features in IAR to debug the application.
25
SPRUHD3GJanuary 2014
www.ti.com
3.3.6
For ARM boards, the *.icf linker command file has lines like the following to set the program stack size:
/*-Sizes-*/ define symbol __ICFEDIT_size_cstack__ define symbol __ICFEDIT_size_heap__
= 0x1000; = 0x2000;
Note: The default stack sizes provided are sufficient for the TI-RTOS examples. SYS/BIOS manages its own heap via the BIOS.heapSize configuration parameter. Therefore, the IAR heap can be set to 0.
SPRUHD3GJanuary 2014
26
www.ti.com
3.4
SYS/BIOS
USB CDC
USB HID
NDK / EMAC
UART
GPIO
WiFi
UIA
X X X X X X X
Example Empty and Empty (Minimal) Projects Demo [M3] / Demo [C28] IPC SPI Master / Slave Demo Graphic Library Demo TCP Echo (IPv4 and IPv6) TCP Echo for CC3000 CC3000 Patcher UDP Echo (IPv4 and IPv6) UDP Echo for CC3000 SPI Loopback FatSD: File Copy FatSD Raw: File Copy & FatFs APIs FatSD USB Copy: SD Card & USB Drive GPIO Interrupt I2C EEPROM I2C RF430CL330 Load (with BoosterPack) I2C TMP006(with BoosterPack) I2C TPL0401EVM(with BoosterPack) UART Console UART Echo UART Logging USB Keyboard Device USB Keyboard Host USB Mouse Device USB Mouse Host USB Serial Device USB CDC Mouse Device Watchdog
X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X
I2 C
X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X
X X
27
SPRUHD3GJanuary 2014
IPC
SPI
www.ti.com
The boards for which TI-RTOS examples are provided are shown in the following table. Table 3-2. Example Availability by Board
MSP-EXP430F5529LP MSP-EXP430F5529 X X X X X X X X X X X X X X X X
28
TMDXDOCKH52C1
TMDXDOCK28M36
EK-TM4C123GXL / EK-LM4F120XL
DK-TM4C123G / EKS-LM4F232 X
Example Empty and Empty (Minimal) TI-RTOS Projects Demo [M3] / Demo [C28] IPC SPI Master / Slave Graphic Library Demo TCP Echo TCP Echo for CC3000 1 CC3000 Patcher 1 UDP Echo UDP Echo for CC3000 1 SPI Loopback FatSD: FatFs File Copy FatSD Raw: FatFs File Copy using FatFs APIs FatSD USB Copy: (SD Card and USB Drive) GPIO Interrupt I2C EEPROM I2C RF430CL330 Load 3 I2C TMP006 4 I2C TPL0401EVM 5 UART Console UART Echo UART Logging USB Keyboard Device USB Keyboard Host USB Mouse Device USB Mouse Host USB Serial Device USB CDC Mouse Device Watchdog
X X X
X X
DK-TM4C129X X
X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X2 X2 X X X X X X X X X X X X X2 X2 X X X X X X X
SPRUHD3GJanuary 2014
www.ti.com
1This example requires either a CC3000 EM board or CC3000 BoosterPack. See the "Jumper Settings:
There is a separate <example_name>_readme file for each of the examples. These files are added to your CCS project when you use the TI Resource Explorer to create a project. The <example_name>_readme files contain the following types of information:
Actions performed by functions in the example. Hardware-specific descriptions of buttons, LEDs, etc Which external components are (or may be) needed to run with particular examples.
The sections that follow list settings required to run the TI-RTOS examples on the supported boards. They also list the hardware resources that TI-RTOS and its dependent components use by default. Some of these resources offer flexible options, whereas others are fixed in the current design or implementation.
29
SPRUHD3GJanuary 2014
www.ti.com
3.5
Board_LED0 (TMDXDOCKH52C1_LD2)
GPIO12: Some examples use this pin as an button input. Shorting this pin to ground (GND) simulates a button press of Board_BUTTON0 (TMDXDOCKH52C1_BUTTON). Board_BUTTON1 is the same as Board_BUTTON0.
The USB connector for devices can accept a Micro-B cable for USB Device examples and a Micro-A dongle for USB Host examples. Jumper settings:
J01-J15: B-C position (Ethernet) J20-J21: B-C position (I2C EEPROM) J6: 2-3 position (I2C EEPROM Write protection off) J22-J25: B-C position (SPI/SSI SD Card slot) J30-J31: B-C position (USB Host and Device) A board modification is required for the USB host examples (see Section 3.5.2)
Switch settings:
SW1: Open all 4 switches by bringing them into the "down" position. This allows the M3 (master subsystem) to boot out of Flash memory. GPIO12: Some examples use this pin as an input. When shorting this pin to ground (GND), it will simulate a button press.
Examples for TI-RTOS 30
SPRUHD3GJanuary 2014
www.ti.com
SPI Loopback example pin connections: When wiring for SPI loopback, pins on a single board are wired to other pins on the same board.
Master SPI Pin (Function) 02 (SPI0CLK) 03 (SPI0FSS) 04 (SPI0RX) 05 (SPI0TX) Slave SPI Pin (Function) 24 (SPI1CLK) 25 (SPI1FSS) 27 (SPI1TX) 26 (SPI1RX)
SPI IPC Master/Slave example pin connections: When wiring for the IPC SPI Master/Slave example, two boards are used:
Resources Used: The following list shows which TMDXDOCKH52C1 resources are used by TI-RTOS examples that make use of a particular component or peripheral.
SYS/BIOS. Uses the first general-purpose timer available and that timers associated interrupts. Generally, this will be Timer 0. SYS/BIOS manages the Interrupt Vector Table. IPC. Uses the IPC registers including their associated interrupts. TI-RTOS. Ethernet. Uses the EMAC driver and its associated interrupts with NDK to support networking. SD Card. Uses FatFs and the SDSPI driver on SSI0 without interrupts to read and write to files on an SD Card. EEPROM. Uses the I2C driver on I2C0 with its associated interrupts to read and write to the onboard EEPROM. GPIOs. The GPIO driver is used on 2 onboard LEDs: LD2 (PC6_GPIO70) and LD3 (PC7_GPIO71) as output pins and one pin as an input pin PB4_GPIO12. Serial. The UART driver uses UART0 which is attached to the FTDI USB chip to facilitate serial communications. SPI. The SPI driver uses SPI0 for Board SPI0 and SPI1 for Board SPI1. SPIMessageQTransport. The master SSI peripheral uses SPI0, and the slave SSI peripheral uses SPI1. USB. The USB reference examples use the USB library and the USB controller with its associated interrupts. Watchdog. The Watchdog driver example uses Watchdog Timer 0 and its associated interrupt.
31
SPRUHD3GJanuary 2014
www.ti.com
3.5.1
For example, the following would set the MAC address to A8-63-F2-00-05-1A:
UInt8 macAddress[6] = {0xA8, 0x63, 0xF2, 0x00, 0x05, 0x1A};
3.5.2
Remove and short resistor R230 on the control card. This modification allows the USB_VBUS pin to correctly detect the VBUS voltage level; preventing a false VBUS_ERR from being generated by the USB controller.
SPRUHD3GJanuary 2014
32
www.ti.com
3.6
microSD card
Ethernet
Power (5V) Power selector Power (USB) MAC address sticker (on reverse side)
The USB connector for devices can accept a Micro-B cable for USB Device examples and a Micro-A dongle for USB Host examples. Jumper settings:
Switch settings: A:SWI: Both switches should be in the ON position SW1: Place all switches in the 1 (up) position to allow the M3 to boot out of Flash memory. GPIO 58: Some examples use pin 58 as it is labeled on the docking station as an input. Shorting this pin to ground (GND) will simulate a button press.
33
SPRUHD3GJanuary 2014
www.ti.com
SPI Loopback example pin connections: When wiring for SPI loopback, pins on a single board are wired to other pins on the same board.
Master SPI Pin (Function) 71 (SPI0CLK) 73 (SPI0FSS) 69 (SPI0RX) 67 (SPI0TX) Slave SPI Pin (Function) 75 (SPI1CLK) 77 (SPI1FSS) 81 (SPI1TX) 79 (SPI1RX)
Resources Used: The following list shows which TMDXDOCK28M36 resources are used by TI-RTOS examples that make use of a particular component or peripheral.
SYS/BIOS. Uses the first general-purpose timer available and that timers associated interrupts. Generally, this will be Timer 0. SYS/BIOS manages the Interrupt Vector Table. IPC. Uses the IPC registers including their associated interrupts. TI-RTOS. Ethernet. Uses the EMAC driver and its associated interrupts with the NDK for networking. SD Card. Uses FatFs and the SDSPI driver on SSI3 without interrupts to read and write to files. GPIOs. The GPIO driver is used on 2 onboard LEDs: D1 (PE7_GPIO31) and D2 (PF2_GPIO34) as output pins and one pin as an input pin PB4_GPIO12, pin 58 on the docking station. Serial. The UART driver uses UART0, which is attached to the FTDI USB chip. SPI. The SPI driver uses SPI0 for Board SPI0 and SPI1 for Board SPI1. USB. The USB reference examples use the USB library and the USB controller with its associated interrupts. Watchdog. The Watchdog driver example uses Watchdog Timer 0 and its associated interrupt.
3.6.1
SPRUHD3GJanuary 2014
34
www.ti.com
3.7
Micro-B USB for devices (such as USB examples) This is a Micro-AB connector on the Tiva EK-TM4C123GXLboard
Board_BUTTON0 (EK_LM4F120XL_SW1)
Board_BUTTON1 (EK_LM4F120XL_SW2)
The Micro-B connector on the Stellaris EK-LM4F120XL LaunchPad can be used for USB Device connections only. The Micro-AB connector on the Tiva EK-TM4C123GXL LaunchPad can be used for both USB Device and USB Host connections. Jumper settings: Examples that use the WiFi driverfor example, the TCP Echo and UDP Echo examples for CC3000 require a CC3000 BoosterPack. This BoosterPack fits over J1 and J2. Switch settings:
SW1: Some examples use PF4 as an input. SW2: Some examples use PF0 as an input
35
SPRUHD3GJanuary 2014
www.ti.com
SPI Loopback example pin connections: When wiring for SPI loopback, pins on a single board are wired to other pins on the same board.
Master SPI Pin (Function) PA2 (SPI0CLK) PA3 (SPI0FSS) PA4 (SPI0RX) PA5 (SPI0TX) Slave SPI Pin (Function) PD0 (SPI3CLK) PD1 (SPI3FSS) PD3 (SPI3TX) PD2 (SPI3RX)
Resources Used: The following list shows which EK-TM4C123GXL resources are used by TI-RTOS examples that make use of a particular component or peripheral.
SYS/BIOS. Uses the first general-purpose timer available and that timers associated interrupts. Generally, this will be Timer 0. SYS/BIOS manages the Interrupt Vector Table. TI-RTOS. GPIOs. The GPIO driver uses 3 output pins for the onboard RGB LED (R:PF1 G:FP3 B:PF2) and 2 input pins for switches SW1 (PF4) and SW2 (PF0). I2C. The I2C driver is configured on I2C3 to support with various BoosterPacks. Serial. The UART driver uses UART0 which is attached to the FTDI USB chip to facilitate serial communications. SPI. The SPI driver uses SPI0 for Board SPI0 and SPI3 for Board SPI1. USB. The USB reference examples use the USB library and the USB controller with its associated interrupts. These boards only support USB in device mode. (The EK-TM4C123GXL LaunchPad can be made to support USB Host, but only with hardware modifications.) USB Host examples are not provided for either of these boards. Watchdog. The Watchdog driver example uses Watchdog Timer 0 and its associated interrupt. WiFi. The WiFi examples for use with the CC3000 use GPIO pins PB2, PB5, and PE0 as well as the GPIO interrupt for port B. They also use the SPI driver on SSI2 with interrupts and the associated uDMA channels.
SPRUHD3GJanuary 2014
36
www.ti.com
3.8
Board_BUTTON1 (DK_TM4C123G_SW4) Board_BUTTON0 (DK_TM4C123G_SW3) Micro-AB USB for USB Device and USB Host
microSD card
The USB connector for devices can accept a Micro-B cable for USB Device examples and a Micro-A dongle for USB Host examples. Jumper settings: N/A Examples that use the WiFi driverfor example, the TCP Echo and UDP Echo examples for CC3000 and the CC3000 Patcher examplerequire a CC3000 evaluation module with EM headers. These EM headers are typically installed as part of the DK-TM4C123G Evaluation Kit, but they are not included with the EKS-LM4F232 Evaluation Kit. The EM Headers can be ordered from various third-party suppliers, including Samtex (part TFM-110-02-S-D). EM headers for the EKS-LM4F232 go on the bottom of the board at J9 and J10. Switch settings:
SW3: Some examples use PM2 as an input SW4: Some examples use PM3 as an input
37
SPRUHD3GJanuary 2014
www.ti.com
SPI Loopback example pin connections: When wiring for SPI loopback, pins on a single board are wired to other pins on the same board.
Master SPI Pin (Function) PF2 (SPI1CLK) PF3 (SPI1FSS) PF0 (SPI1RX) PF1 (SPI1TX) Slave SPI Pin (Function) PK0 (SPI3CLK) PK1 (SPI3FSS) PK3 (SPI3TX) PK2 (SPI3RX)
Resources Used: The following list shows which DK-TM4C123G resources are used by TI-RTOS examples that make use of a particular component or peripheral.
SYS/BIOS. Uses the first general-purpose timer available and that timer's associated interrupts. Generally, this will be Timer 0. SYS/BIOS manages the Interrupt Vector Table. TI-RTOS. SD Card. Uses FatFs and the SDSPI driver on SSI0 without interrupts to read and write to files. GPIOs. The GPIO driver is used on the onboard User LED (PG2) as an output pin and on 5 input pins SW1-SW5 (PM0-4). Serial. The UART driver uses UART0 which is attached to the FTDI USB chip to facilitate serial communications. SPI. The SPI driver uses SPI1 for Board SPI0 and SPI3 for Board SPI1. USB. The USB reference examples use the USB library and the USB controller with its associated interrupts. Watchdog. The Watchdog driver example uses Watchdog Timer 0 and its associated interrupt. WiFi. The WiFi examples for use with the CC3000 use GPIO pins PC7, PH1, and PC6 as well as the GPIO interrupt for port C. It also uses the SPI driver on SSI3 with interrupts and the associated uDMA channels.
USB connection and ports: Connect the power/CDI USB connector on the board to a USB port on your host PC. This connection is used for both emulation and the serial output. If you would also like to see instrumentation (UIA), also connect the Host/Device/OTG USB connector on the board to your host PC. See the Stellaris LM4F232 Evaluation Board Users Manual (SPMU272) for details about USB connectors.
SPRUHD3GJanuary 2014
38
www.ti.com
After you connect both USB ports, you can make sure the Stellaris drivers are installed correctly by opening the Windows Device Manager. To do this, right-click on Computer in Windows Explorer and select Properties. Choose the Device Manager. You should see a device list similar to the following:
39
SPRUHD3GJanuary 2014
www.ti.com
The virtual serial port (in the previous figure, COM4) will be used for serial output. You will need to set up a terminal emulator to see the console output from the TI-RTOS UART Console example. Use a serial connection to the Virtual Serial Port of your device, with 115200 bps, 8 data bits, 1 stop bit, and no parity. For example, if you had the Virtual Serial Port, COM4, using the PuTTY terminal emulator, you would set it up as follows:
SPRUHD3GJanuary 2014
40
www.ti.com
3.9
Micro-AB USB for USB Device and USB Host 5V power (can use ICDI instead)
Ethernet
J36
J37
Board_BUTTON1 (DK_TM4C129X_BUTTON_UP)
Board_BUTTON2 (DK_TM4C129X_BUTTON_DOWN)
Board_BUTTON0 (DK_TM4C129X_BUTTON_SELECT)
Jumper settings:
J7: To use SPI/SSI SD Card slot: Close SD_CS, SPI_CLK, SPI_DAT0, SPI_DAT1 To run SPI loopback example: Open SD_CS, SPI_CLK, SPI_DAT0, SPI_DAT1
41
J37: Close SEL, DOWN, UP (enables Switches) J36: Close GREEN, BLUE, RED (enables LEDs)
SPRUHD3GJanuary 2014
www.ti.com
SPI Loopback example pin connections: When wiring for SPI loopback, pins on a single board are wired to other pins on the same board.
Master Pin (Function) PQ0 (SPI3CLK) PQ1 (SPI3FSS) PF0 (SPI3DAT1 (RX)) PQ2 (SPI3DAT0 (TX)) Slave Pin (Function) PD3 (SPI2CLK) PD2 (SPI2FSS) PG5 (SPI2DAT0 (TX)) PG4 (SPI2DAT1 (RX))
Resources Used: The following list shows which DK-TM4C129Xperipheral resources are used by TI-RTOS applications on that platform. TI-RTOS examples control which peripherals (and which ports) are used
SYS/BIOS. Uses the first general-purpose timer available and that timer's associated interrupts. Generally, this will be Timer 0. SYS/BIOS manages the Interrupt Vector Table. TI-RTOS. SD Card. Uses FatFs and the SDSPI driver on QSSI3 without interrupts to read and write to files. GPIOs. The GPIO driver is used on the onboard user LEDs LED0-2 (PK4, PK6, and PF1) as output pins and on three input switches UP, DOWN, and SEL (PN3, PE5, and PP1). I2C. The I2C driver is configured on I2C3 to support with various BoosterPacks. Serial. The UART driver uses UART0 which is attached to the FTDI USB chip to facilitate serial communications. SPI. The SPI driver uses QSSI3 for Board SPI0 and QSSI2 for Board SPI1. USB. The USB reference examples use the USB library and the USB controller with its associated interrupts. Watchdog. The Watchdog driver example uses Watchdog Timer 0 and its associated interrupt.
SPRUHD3GJanuary 2014
42
www.ti.com
3.10
Micro-B USB for power, emulation, UART examples, and USB examples
Jumper settings:
Set RXD << and TXD >> to provide UART communications via the onboard USB debugger.
Examples that use the WiFi driverfor example, the TCP Echo and UDP Echo examples for CC3000 require a CC3000 BoosterPack. This BoosterPack fits over J1 and J5. SPI Loopback example pin connections: The SPI loopback example is not supported on MSP430F5529.
43
SPRUHD3GJanuary 2014
www.ti.com
Resources Used: The following list shows which MSP_EXP430F5529LP resources are used by TI-RTOS applications on that platform. TI-RTOS examples control which peripherals (and which ports) are used.
SYS/BIOS. Uses the first general-purpose timer available and that timer's associated interrupts. Generally, this will be Timer0_A0. SYS/BIOS manages the interrupt controller statically without an interrupt dispatcher. TI-RTOS. SD Card. Uses FatFs and the SDSPI driver on USCI_B0 without interrupts to read and write to files. I2C. The I2C driver is configured on USCI_B0 to support various BoosterPacks. GPIOs. The GPIO driver is used on 2 onboard LEDs: LED1 (P1.0) and LED2 (P4.7) as output pins and 2 switches SW1 P2.1 and SW2 P1.1 as inputs. Serial. The UART driver uses USCI_A1, which is attached to the onboard EZ-FET MSP430 USB chip to facilitate serial communications. SPI. The SPI driver is configured to use USCI_B1 and USCI_B0 for SPI communications. Each instance requires 2 DMA channels; therefore, only one SPI instance can be used at a time. USB. The USB reference examples use the USB library and the USB controller with its associated interrupts. Watchdog. The Watchdog driver example uses Watchdog Timer A. WiFi. The WiFi examples for use with the CC3000 use GPIO pins P2.0, P2.2, and P6.5 as well as the GPIO interrupt for port 2. In addition, it uses P3.0 and P3.2 for SPI communications.
For MSP430, USB drivers are stored in the USB_config folder in TI-RTOS USB examples in CCS. The USB reference modules for MSP430 use a set of descriptor files that were generated with the MSP430 USB Descriptor Tool.
SPRUHD3GJanuary 2014
44
www.ti.com
3.11
microSD card
Board_LED0 (MSP_EXP430F5529_LED1)
Jumper settings:
Set RXD and TXD to provide UART communications via the onboard USB debugger.
Examples that use the WiFi driverfor example, the TCP Echo and UDP Echo examples for CC3000 and the CC3000 Patcher examplerequire a CC3000 evaluation module, which fits on the RF1 and RF2 headers. SPI Loopback example pin connections: The SPI loopback example is not supported on MSP430F5529.
45
SPRUHD3GJanuary 2014
www.ti.com
BoosterPacks
Resources Used: The following list shows which MSP_EXP430F5529 resources are used by TI-RTOS applications on that platform. TI-RTOS examples control which peripherals (and which ports) are used.
SYS/BIOS. Uses the first general-purpose timer available and that timer's associated interrupts. Generally, this will be Timer0_A0. SYS/BIOS manages the interrupt controller statically without an interrupt dispatcher. TI-RTOS. SD Card. Uses FatFs and the SDSPI driver on USCI_B1 without interrupts to read and write to files. I2C. The I2C driver is configured on USCI_B0 and USCI_B1. GPIOs. The GPIO driver is used on 8 onboard LEDs: LED1 (P1.0), LED2 (P8.1), LED3 (P8.2), PAD1 (P1.1), PAD2 (P1.2), PAD3 (P1.3), PAD4 (P1.4), and PAD5 (P1.5) as output pins and 2 switches S1 (P2.7) and S2 (P2.2) as inputs. Serial. The UART driver uses USCI_A1, which is attached to the onboard EZ-FET MSP430 USB chip to facilitate serial communications. SPI. The SPI driver is configured to use USCI_B1 and USCI_B0 for SPI communications. Each instance requires 2 DMA channels; therefore, only one SPI instance can be used at a time. USB. The USB reference examples use the USB library and the USB controller with its associated interrupts. Watchdog. The Watchdog driver example uses Watchdog Timer A. WiFi. The WiFi examples for use with the CC3000 use GPIO pins P2.4, P2.6, and P2.3 as well as the GPIO interrupt for port 2. In addition, it uses P3.0 and P3.2 for SPI communications.
For MSP430, USB drivers are stored in the USB_config folder in TI-RTOS USB examples in CCS. The USB reference modules for MSP430 use a set of descriptor files that were generated with the MSP430 USB Descriptor Tool.
3.12
BoosterPacks
Several BoosterPack boards are used with the TI-RTOS examples. This section described those boards and provides any special notes about installing the board.
3.12.1
SD Card BoosterPack
An SD Card BoosterPack should be used with examples that require an SD Card reader on target boards that do not include an SD Card reader. This board may be used with the EK-TM4C123GXL, EKLM4F120XL, and MSP-EXP430F5529LP.
3.12.2
TMP006 BoosterPack
The I2C TMP006 example uses the TMP006 BoosterPack to connect the TMP006EVM circuit board to the LaunchPad. The TMP006 BoosterPack kit, which includes a TMP006EVM circuit board, is available online. This board may be used with the EK-TM4C123GXL, EK-LM4F120XL, DK-TM4C129X, and MSPEXP430F5529LP.
SPRUHD3GJanuary 2014
46
BoosterPacks
www.ti.com
3.12.3
CC3000 BoosterPacks
The TI CC3000 is a self-contained wireless network processor that simplifies the implementation of Internet connectivity. TIs SimpleLink Wi-Fi solution minimizes the software requirements of the host microcontroller (MCU) and is thus the ideal solution for embedded applications using any low-cost and low-power MCU. Two types of CC3000 BoosterPacks are currently available:
CC3000 BoosterPack, which can be used with the following boards: EK-LM4F120XL EK-TM4C123GXL MSP-EXP430F5529LP
CC3000 Evaluation Module (EM), which can be used with the following boards: DK-TM4C123G EKS-LM4F232 MSP-EXP430F5529
3.12.4
R12
47
SPRUHD3GJanuary 2014
www.ti.com
3.12.5
TPL0401EVM Board
The I2C TPL0401EVM example requires an attached TPL0401EVM board. This board may be used with the EK-TM4C123GXL, EK-LM4F120XL, DK-TM4C129X, and MSP-EXP430F5529LP. A wire like the one shown in the following figure should be added to provide power to the TPL0401EVM board. This figure shows the wire on an MSP-EXP430F5529LP board. Similar wiring is required to connect the TPL0401EVM board to other boards supported by this example. A 5V power supply is recommended to provide sufficient LED brightness.
+5V +5V
3.13
The Windows menus and dialogs you see may be slightly different from those shown here, depending on your version of Windows. To install the USB driver, follow these steps: 1. Load and run a USB device reference exampleUSB Keyboard Device, USB Mouse Device, or USB CDC Mouse Device. 2. While the example is running, connect the device to the Windows PC via a USB cable. At this point, Windows will detect the device and attempt to enumerate it.
SPRUHD3GJanuary 2014
48
www.ti.com
3. Open the Windows Device Manager by right-clicking on the My Computer desktop icon or Computer in the Start Menu and selecting Manage.
4. If you are prompted by a security warning in Windows 7, click Yes. 5. Select the Device Manager category in the left pane. 6. In the center pane, select the unknown driver that you are trying to install. For example, the device shown here is for the USB CDC driver.
49
SPRUHD3GJanuary 2014
www.ti.com
7. Right-click on the device, and select Update Driver Software. 8. Select Browse my computer for driver software and browse to the location of the Windows USB drivers, <tirtos_install>/products/TivaWare_C_Series-1.#/windows_drivers. Make sure the box to Include subfolders is checked. 9. Click Next to run the installation wizard. If you see a Window Security prompt, click Install. 10. After the driver is installed, you can determine the COM port number for the CDC (Virtual COM Port) device.
SPRUHD3GJanuary 2014
50
Chapter 4
SPRUHD3GJanuary 2014
Configuring TI-RTOS
This chapter describes how to configure how TI-RTOS and its components will be used by your application.
Page Starting the Configuration Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Configuring TI-RTOS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Configuring Individual Sub-Components . . . . . . . . . . . . . . . . . . . . . . 54
SPRUHD3GJanuary 2014
Configuring TI-RTOS
51
www.ti.com
4.1
To use CCS to open the graphical tool for editing configuration files (XGCONF), follow these steps: 1. Make sure you are in the C/C++ perspective of CCS. If you are not in that perspective, click the C/C++ icon to switch back. 2. Double-click on the *.cfg configuration file for a TI-RTOS example project in the Project Explorer tree. (See Section 3.1 if you need to create an example project.) While XGCONF is opening, the CCS status bar shows that the configuration is being processed and validated. 3. When XGCONF opens, you see the Welcome sheet for TI-RTOS. This sheet provides links to TIRTOS documentation resources. 4. Click the System Overview button to see a handy overview of the components available through the TI-RTOS. The green check marks indicate which modules are being used by the application.
SPRUHD3GJanuary 2014
Configuring TI-RTOS
52
Configuring TI-RTOS
www.ti.com
5. Click a blue box in the System Overview to go to the Welcome sheet for that component or the configuration page for a driver. If a feature is not supported for your target, you cannot click it. For example, you cannot click TCP/IP for MSP430. Note: If the configuration is shown in a text editor instead of XGCONF, close the text editor window. Then, right-click on the .cfg file and choose Open With > XGCONF. If you are comfortable editing configuration scripts with a text editor, you can do that. However, you should not have the file open in both types of editor at the same time.
For details about how to use XGCONF, see Chapter 2 of the SYS/BIOS Users Guide (SPRUEX3).
4.2
Configuring TI-RTOS
When you open a configuration file in XGCONF, you see a list of Available Products. The components listed here are the same components that were checked in the RTSC Configuration Settings page when you created a new CCS project using one of the TI-RTOS project templates. Under the TI-RTOS item, you can select one of the modules listed to configure it. Most of these modules are peripheral drivers. For each driver, you can select to use either the instrumented or noninstrumented libraries when linking. The instrumented libraries process Log events while the non-instrumented libraries do not. See the section on "Using Instrumented or Non-Instrumented Libraries" in the TI-RTOS Users Guide (SPRUHD4) for more information. The following drivers and transports can be configured:
EMAC. Driver for Ethernet with the NDK. See Section 3.5.1 for how to set the MAC address. GPIO. Driver for the GPIO pins (and therefore the LEDs). I2C. Driver for the I2C peripheral. SDSPI. Driver for the SD card using a SPI (SSI) bus and the FatFS. SPI. Driver for the Serial Peripheral Interface (SPI) bus. SPIMessageQTransport. MessageQ transport for the SPI driver for use in multicore applications. UART. Driver for the UART peripheral. USBMSCHFatFs. Driver for the USB MSC Host controller. Watchdog. Driver for the watchdog timer. WiFi. Driver to communicate with TI Wi-Fi device such as a SimpleLink Wi-Fi CC3000.
The SysCallback module lets you configure the functions that handle System outputfor example, System_printf() and System_abort(). This module handles transmissions to System output only; it does not handle responses received. See the chapter on "TI-RTOS Utilities" in the TI-RTOS Users Guide (SPRUHD4) for more about the SysCallback module.
53
Configuring TI-RTOS
SPRUHD3GJanuary 2014
www.ti.com
SysMin stores System_printf() strings in an internal buffer in RAM. SysMin requires RAM, so it not ideal for devices with minimal RAM. SysStd writes System_printf() strings to STDOUT (the CCS Console window). By default, SysStd allows System_printf() to be called from Tasks only (not Swis or hardware interrupts); it can be modified to allow calls from Swis and Hwis, but this impacts real-time performance.
4.3
SPRUHD3GJanuary 2014
Configuring TI-RTOS
54
Appendix A
SPRUHD3GJanuary 2014
Revision History
Table A1 lists the changes made since the previous version of this document. Table A1. Revision History
Revision SPRUHD3G Chapter Preface About Examples Section 1.3 Section 3.1 Location Additions/Modifications/Deletions Current software version number is v1.21. Added MSP-EXP430F5529 Experimenter Board. TI-RTOS examples for compilation with TI or GNU code generation tools are now available for certain boards in TI Resource Explorer. Minimal memory version of the Empty Project is now available. Added section on generating the examples directory. Revised section on using examples with IAR Embedded Workbench substantially. Added MSP-EXP430F5529 Experimenter Board. Distinguished between boards that require a CC3000 EM board or a CC3000 BoosterPack. See "Jumper Settings" in each section. Also identified when EM headers may need to be ordered separately. Added MSP-EXP430F5529 Experimenter Board. Added description of CC3000 BoosterPacks. Current software version number is v1.20. Section 1.2 Section 1.3 MSP430Ware component added. Several new boards added, including an MSP430 board. Also added information about building drivers for MSP430 boards other than MSP430F5529. New section added to give an overview of the examples. Information about hardware resources previously in this section has been moved to Chapter 3. Links to information about MSP430Ware, MSP430 boards, and BoosterPacks added.
Section 3.1.1 Section 3.2 Section 3.3 to Section 3.3.4 Section 3.4 Section 3.7 to Section 3.11
Section 1.5
Section 1.6
SPRUHD3GJanuary 2014
Revision History
55
www.ti.com
Section 2.3.2
Section 2.3.4
Examples
Section 3.1.1 Section 3.3 to Section 3.3.6 Table 3-1 Table 3-2 Section 3.5 to Section 3.10
SPRUHD3GJanuary 2014
Revision History
56
Index
SPRUHD3GJanuary 2014
Index
A
Available Products list 53 resources used 31, 34 Empty Project example 19 empty.c file 20 Ethernet driver 7 examples 8, 16 building 18 creating projects 17 debugging 18 overview 27
B
BoosterPacks 46 RF430CL330 47 SD Card 46 TMP006 46 building examples 18
F
F28M35H52C1 7, 30 F28M36P63C2 7, 33 FatFs API, documentation Flash drives 8 forum 8 10
C
C28x support 7 CCS installation 13 other documentation CDC device 8 example 27 components 6 Concerto 7 other documentation resources used 31 configuration 51 graphical editor 52 controlSUITE 6 other documentation
G
GPIO driver 7 configuration 53 examples 27 resources used 31, 34, 36, 38, 42, 44, 46
10
H
10 HID device 8 example 27
D
debugging examples 18 disk space 13 DK-TM4C123G 7, 37 DK-TM4C129X 7, 41 documentation 8
I
I2C driver 7 configuration 53 example 27 resources used 31 installation CCS 13 directory 13 TI-RTOS 14 instrumented libraries 53 IPC 6 example 27 other documentation 9 resources used 31 SPI driver for multicore applications
E
EK-LM4F120XL 7, 35 EKS-LM4F232 7, 28, 37 EK-TM4C123GXL 7, 28, 35 resources used 36 EMAC driver 7 configuration 53
Index
57
www.ti.com
L
LaunchPad EK-LM4F120XL 35 EK-TM4C123GXL 35 MSP-EXP430F5529LP 43 LEDs managed by GPIO driver 7 LM4F120H5QR 7, 35 LM4F232H5QD 7, 37 LoggingSetup module 8
SYS/BIOS 6 examples 27 other documentation 9 resources used 31 SysCallback module, configuration 53 SysMin module 8 System Overview configuration 52 system requirements 13
T
target configuration file 18 TM4C123GH6PGE 7, 37 TM4C123GH6PM 7, 35 TM4C129XNCZAD 7, 41 TMDXDOCK28M36 7, 28, 33 TMDXDOCKH52C1 7, 28, 30 resources used 31 TMP006 BoosterPack 46 TPL0401EVM board 48
M
MAC address 32, 34 MessageQ 8 MSC device 8 MSP430F5529 7, 43, 45 MSP430Ware 6 MSP-EXP430F5529 45 MSP-EXP430F5529LP 7, 43 multicore applications 8 MWare 6, 10
U
UART driver 7 configuration 53 examples 27 resources used 31, 34, 36, 38, 42, 44, 46 UIA 6 example 27 other documentation 9 USB Descriptor Tool 44, 46 USB driver example 27 resources used 31, 34, 36, 38, 42, 44, 46 USB_config folder 44, 46 USBMSCHFatFs driver 8 configuration 53
N
NDK 6 example 27 MAC address 32, 34 other documentation 9 non-instrumented libraries 53
P
products directory 6
R
readme.txt file 8, 29 RF430CL330 module 47
W
Watchdog driver 8 configuration 53 examples 27 resources used 31, 34, 36, 38, 42, 44, 46 WiFi driver 8 configuration 53 examples 27 resources used 36, 38, 44, 46 wiki 8
S
SD Card BoosterPack 46 SD driver, example 27 SDSPI driver 7 configuration 53 resources used 31, 34, 38, 42, 44, 46 SPI driver 7 configuration 53 examples 27 resources used 31, 34, 36, 38, 42, 44, 46 SPIMessageQTransport driver configuration 53 resources used 31 SPIMessageQTransport transport 8 StellarisWare 6
X
XDCtools 6 other documentation 9 XGCONF configuring other components 54 configuring TI-RTOS modules 53 starting 52
58
Index
IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All semiconductor products (also referred to herein as components) are sold subject to TIs terms and conditions of sale supplied at the time of order acknowledgment. TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TIs terms and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily performed. TI assumes no liability for applications assistance or the design of Buyers products. Buyers are responsible for their products and applications using TI components. To minimize the risks associated with Buyers products and applications, Buyers should provide adequate design and operating safeguards. TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI. Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional restrictions. Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements. Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use of any TI components in safety-critical applications. In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TIs goal is to help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and requirements. Nonetheless, such components are subject to these terms. No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties have executed a special agreement specifically governing such use. Only those TI components which TI has specifically designated as military grade or enhanced plastic are designed and intended for use in military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and regulatory requirements in connection with such use. TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of non-designated products, TI will not be responsible for any failure to meet ISO/TS16949. Products Audio Amplifiers Data Converters DLP Products DSP Clocks and Timers Interface Logic Power Mgmt Microcontrollers RFID www.ti.com/audio amplifier.ti.com dataconverter.ti.com www.dlp.com dsp.ti.com www.ti.com/clocks interface.ti.com logic.ti.com power.ti.com microcontroller.ti.com www.ti-rfid.com Applications Automotive and Transportation Communications and Telecom Computers and Peripherals Consumer Electronics Energy and Lighting Industrial Medical Security Space, Avionics and Defense Video & Imaging www.ti.com/automotive www.ti.com/communications www.ti.com/computers www.ti.com/consumer-apps www.ti.com/energy www.ti.com/industrial www.ti.com/medical www.ti.com/security www.ti.com/space-avionics-defense www.ti.com/video e2e.ti.com
Mailing Address: Texas Instruments, Post Office Box 655303 Dallas, Texas 75265 Copyright 2014, Texas Instruments Incorporated