Using Code Composer Studio IDE with MSP432

Similar documents
Code Composer Studio. MSP Project Setup

F28069 ControlCard Lab1

F28335 ControlCard Lab1

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

MSP430 Interface to LMP91000 Code Library

Migration from HEW to e 2 studio Development Tools > IDEs

Migrating from CubeSuite+ to Eclipse RL78 Family

Using NIOS 2 Embedded Design Suite 10

MSP430 Interface to LMP91000 Code Library

F28027 USB Stick Lab1_3

Section Objective: Acquaint with specifications of Launchpad Acquaint with location of switches, LEDs, power-on switch, powering the board.

Figure 1. Simplicity Studio

APPENDIX A. CODE COMPOSER STUDIO (CCS) v5: A BRIEF TUTORIAL FOR THE DSK6713

Getting Started in C Programming with Keil MDK-ARM Version 5

Getting Started in C Programming with Keil MDK-ARM Version 5

Getting Started in C Programming with Keil MDK-ARM Version 5

Tool Setup. Code Composer Studio

esi-risc Development Suite Getting Started Guide

QUICKSTART CODE COMPOSER STUDIO Stellaris Development and Evaluation Kits for Code Composer Studio

ECE2049 Embedded Computing in Engineering Design. Lab #0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

Register Access. Common - Last updated 7/25/18

Code Composer Studio Operation Manual

Exercise: PWM Generation using the N2HET

Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015.

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

SKP16C26 Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Programming in the MAXQ environment

As CCS starts up, a splash screen similar to one shown below will appear.

BASICS OF THE RENESAS SYNERGY TM

CPE 323: Laboratory Assignment #1 Getting Started with the MSP430 IAR Embedded Workbench

IAR EWARM Quick Start for. Holtek s HT32 Series Microcontrollers

You have a PC with a USB interface, running Microsoft Windows XP (SP2 or greater) or Vista You have the Workshop Installation Software Flash Drive

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003

Embedded Systems - FS 2018

M16C/62P QSK QSK62P Plus Tutorial 1. Software Development Process using HEW4

Embedded Systems - FS 2018

CodeWarrior Development Studio for Power Architecture Processors FAQ Guide

System Framework Overview Guide and Instructions on How to Use the Template Projects

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

C Programming in Atmel Studio 7 Step by Step Tutorial

ATOLLIC TRUESTUDIO FOR STM32 QUICK START GUIDE

MEM MEM Control Applications of DSP. Lab 2. Project Creating & GPIO DSP28355 & CCSv5

CodeWarrior Development Studio for Advanced Packet Processing FAQ Guide

As CCS starts up, a splash screen similar to one shown below will appear.

Module 3: Working with C/C++

Floating-Point Unit. Introduction. Agenda

Introduction to uvision and ARM Cortex M3

RVDS 4.0 Introductory Tutorial

Software Setup and Introductory Assembly programs for the MSP430 *

Codewarrior for ColdFire (Eclipse) 10.0 Setup

Tools Basics. Getting Started with Renesas Development Tools R8C/3LX Family

SKP16C62P Tutorial 2 Creating A New Project Using TM. Renesas Technology America Inc.

BASICS OF THE RENESAS SYNERGY PLATFORM

AURIX family and AUDO Future, AUDO MAX

1.2 - Introduction to the IAR Workbench IDE *

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

TriCore Free Entry Tool Chain. AURIX family and AUDO Future, AUDO MAX

P&E Microcomputer Systems, Inc. PKGPPCNEXUS

ATOLLIC TRUESTUDIO FOR ARM QUICK START GUIDE

Building an Embedded Processor System on Xilinx NEXYS3 FPGA and Profiling an Application: A Tutorial

ECE QNX Real-time Lab

Hands-On with STM32 MCU Francesco Conti

ToolStick-EK TOOLSTICK USER S GUIDE. 1. Kit Contents. 2. ToolStick Overview. Green and Red LEDs. C8051F321 provides USB debug interface.

DAVE 3 Hands on / Quick Start Tutorial. Presentation Tutorial Start 1 v1.1: Creating a simple Project using PWM and Count Apps

6L00IA - Introduction to Synergy Software Package Short Version (SSP v1.2.0) Renesas Synergy Family - S7 Series

Debugging in AVR32 Studio

Creating a New USB project with KSDK and Processor Expert support in KDS

Prerequisites for Eclipse

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2005

Getting Started with the MSP430 IAR Assembly

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.1 Revision: 0 Date: May 3, 2018

Release Notes for ADSP-CM41x EZ-Kit Lite Board Support Package For Keil MDK

TI ARM Lab 2 Bright Light

STM32L100C-Discovery Board Projects

LAB1. Get familiar with Tools and Environment

DOMAIN TECHNOLOGIES. Getting Started Guide Version 1.1. BoxView IDE. Integrated Development Environment

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.0 Revision: 0 Date: September 18, 2017

Getting Started with the Texas Instruments ez430

Create and Add the Source File

2 ABOUT VISUALDSP++ In This Chapter. Figure 2-0. Table 2-0. Listing 2-0.

Software Installation Guide for S32 Design Studio IDE (S32DS): FRDM-KEAZ128Q80 FRDM-KEAZ64Q64 FRDM-KEAZN32Q64

ELEC 3040/3050 Lab Manual Lab 2 Revised 8/20/14. LAB 2: Developing and Debugging C Programs in MDK-ARM for the STM32L100RC Microcontroller

CS520 Setting Up the Programming Environment for Windows Suresh Kalathur. For Windows users, download the Java8 SDK as shown below.

Hibernation Module. Introduction. Agenda

The board contains the connector for SWD bus to implement SWD method of programming. Fig. K190 VDD 2 GND 4

Texas Instruments Code Composer and ez-dsp Setup Notes

Embedded Systems. 2. Software Development. Lothar Thiele. Computer Engineering and Networks Laboratory

Getting Started with Qorivva Fast

April 4, 2001: Debugging Your C24x DSP Design Using Code Composer Studio Real-Time Monitor

ArduCAM CC3200 UNO board

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI

ECE 492 WINTER 2015 GROUP 2. Texas Instruments MSP430-FR Bit ADC Setup Guide

Resource 2 Embedded computer and development environment

Lab 1: First Steps in C++ - Eclipse

Lab 3-2: Exploring the Heap

Section 2: Getting Started with a FPU Demo Project using EK-LM4F232

TI ARM Lab 4 Digilent Orbit Board

IAR C-SPY Hardware Debugger Systems User Guide

EW The Source Browser might fail to start data collection properly in large projects until the Source Browser window is opened manually.

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2010

Transcription:

Using Code Composer Studio IDE with MSP432 Quick Start Guide Embedded System Course LAP IC EPFL 2010-2018 Version 1.2 René Beuchat Alex Jourdan 1 Installation and documentation Main information in this document has been be found in the Ti User Guide - Getting started 1 guide. It is also available in the resources explorer in Code Composer Studio v8 (see link above for more details). This guide has been prepared to help students following the Embedded System Course in IC by René Beuchat at EPFL. Code Composer Studio can be downloaded for free at http://processors.wiki.ti.com/index.php/download_ccs. Important: If you want to install CCS on your own computer, do not forget to install the MSP432 modules to be able to use the Board! 1 http://dev.ti.com/tirex/#/?link=development%20tools%2fintegrated%20development%20environments%2fcode%20c omposer%20studio%2fuser's%20guide%2fgetting%20started

2 Launching Code Composer Studio After installing Code Composer Studio, there are several ways to open the IDE, double click on Code Composer Studio 8.x.x icon on your desktop, or go to your installed directory and open the file eclipse.exe in eclipse directory, or type Code Composer Studio in the windows search bar. A prompt will appear to ask for a workspace location that contains your project. Choose your workspace, then click OK button. Put it in your own personal directory, but NOT on C:, as for network stations, your project will not be available on another station in a next session or will be deleted. The exact location changes according to your section, for example could be located in \\filesx\data\<username>\my Documents\..., in Z:\... Fig. 1. Select a Workspace A welcome page will display some information about the IDE, also with some getting started information, for example, links to others resource and so forth. When you finish this welcome page, you can enter to the main IDE workbench by closing this welcome page. Fig. 2. Empty code Composer Studio window 18/09/2018 P a g e 2

3 New MSP432 Project 3.1 Create MSP432 Project To create new MSP432 project, select menu File New CCS Project Fig. 3. Then, you can configure the new project as shown in figure 4. Target: MSP432 Family Device: MSP432P401R Connection: TI XDS110 USB Debug Probe Project name: Labo_GPIOToggle Create a CCS project Select the default location for the project, it will create a folder in your workspace, and select an empty project as template. 18/09/2018 P a g e 3

Fig. 4. Configure the new project The contents of the project will be visible from the Project explorer view, even on re-launching Code Composer Studio IDE, as long as the workspace folder is not changed. 18/09/2018 P a g e 4

3.2 Adding a source file To add a source file, choose menu File New Source file Fig. 5. New source file Then enter the filename in the opening dialog, e.g. GPIO_Toggle.c. Then click Finish to create the file, the file is added automatically the project if we do not modify the Source Folder textbox. Save this file after editing the code in the next step. 18/09/2018 P a g e 5

Fig. 6. New source file specification 4 Program example to start The simple program example blink a LED on the Launchpad board. The LED is connected on the Port2 of the MSP432. An active loop delay allows a visible blinking of the LEDs. On the MSP432P401R, the GPIO Port2 has 8 bits: P2.7 P2.0, bits 0 to 2 are not available on a pin. On the Launchpad board, bits P2.2 to P2.0 are directly connected to LEDs on the development kit. In this example, the program toggle Port 2, bits 0, of the target device after a specific time, done by an active loop. 18/09/2018 P a g e 6

4.1 Example program The code below is a simple program to access a GPIO and toggle the bit P2.0. It can be copied on the editor. #include "msp.h" void main(void) { int i; WDT_A->CTL = WDT_A_CTL_PW WDT_A_CTL_HOLD; // stop watchdog timer P2->DIR= 0xFF; //set Port 2 to output direction P2->OUT= (1<<0); //set bit 0 of port 2 (LED), clear others bits } while(1) { P2->OUT ^= (1<<0); // Toggles the bit 0 of the output register for(i=0; i<100000; i++); // Wait } Fig. 7. GPIO Toggle program Other way to do it: P2->OUT = ~P2->OUT & 0x01; // (1<<0) equivalent @ 0x01, first way is better to see that bit 0 is activated Fig. 8. Tools windows 4.2 Header file msp432p401r.h The header file msp432p401r.h is provided by the IDE and can be found in directory C:/ti/ccsv8/ccs_base/arm/include from your installation location. This file contains the definition of all macro 18/09/2018 P a g e 7

names that are used for the MSP432P401R device. In order to view this file, you can double click on this filename in the Outline windows of the IDE. /****************************************************************************** * Peripheral declaration * ******************************************************************************/ /** @addtogroup MSP432P401R_PeripheralDecl MSP432P401R Peripheral Declaration @{ */ #define ADC14 #define AES256 #define CAPTIO0 #define CAPTIO1 #define COMP_E0 #define COMP_E1 #define CRC32 #define CS Fig. 9. ((ADC14_Type *) ADC14_BASE) ((AES256_Type *) AES256_BASE) ((CAPTIO_Type *) CAPTIO0_BASE) ((CAPTIO_Type *) CAPTIO1_BASE) ((COMP_E_Type *) COMP_E0_BASE) ((COMP_E_Type *) COMP_E1_BASE) ((CRC32_Type *) CRC32_BASE) ((CS_Type *) CS_BASE) msp432p401r.h extraction Previous Fig. defines some accesses for peripherals at specific addresses. ADC_BASE, are addresses that match the physical location of the peripherals, and which are also defined in the file msp432p401r.h: #define FLASH_BASE ((uint32_t)0x00000000) /*!< Main Flash memory start address */ #define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM memory start address */ #define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripherals start address */ #define PERIPH_BASE2 ((uint32_t)0xe0000000) /*!< Peripherals start address */ #define ADC14_BASE (PERIPH_BASE +0x00012000) /*!< Base address of module ADC14 registers */ #define AES256_BASE (PERIPH_BASE +0x00003C00) /*!< Base address of module AES256 registers */ #define CAPTIO0_BASE (PERIPH_BASE +0x00005400) /*!< Base address of module CAPTIO0 registers */ #define CAPTIO1_BASE (PERIPH_BASE +0x00005800) /*!< Base address of module CAPTIO1 registers */ #define COMP_E0_BASE (PERIPH_BASE +0x00003400) /*!< Base address of module COMP_E0 registers */ #define COMP_E1_BASE (PERIPH_BASE +0x00003800) /*!< Base address of module COMP_E1 registers */ #define CRC32_BASE (PERIPH_BASE +0x00004000) /*!< Base address of module CRC32 registers */ #define CS_BASE (PERIPH_BASE +0x00010400) /*!< Base address of module CS registers */ Fig. 10. msp432p401r.h extraction 18/09/2018 P a g e 8

Each peripheral is associated to a C structure that defines each of its registers. For example, the ADC Registers can be accessed using the following structure: (note: the code in figure 9 defines a pointer to this structure) typedef struct { IO uint32_t CTL0; /*!< Control 0 Register */ IO uint32_t CTL1; /*!< Control 1 Register */ IO uint32_t LO0; /*!< Window Comparator Low Threshold 0 Register */ IO uint32_t HI0; /*!< Window Comparator High Threshold 0 Register */ IO uint32_t LO1; /*!< Window Comparator Low Threshold 1 Register */ IO uint32_t HI1; /*!< Window Comparator High Threshold 1 Register */ IO uint32_t MCTL[32]; /*!< Conversion Memory Control Register */ IO uint32_t MEM[32]; /*!< Conversion Memory Register */ uint32_t RESERVED0[9]; IO uint32_t IER0; /*!< Interrupt Enable 0 Register */ IO uint32_t IER1; /*!< Interrupt Enable 1 Register */ I uint32_t IFGR0; /*!< Interrupt Flag 0 Register */ I uint32_t IFGR1; /*!< Interrupt Flag 1 Register */ O uint32_t CLRIFGR0; /*!< Clear Interrupt Flag 0 Register */ IO uint32_t CLRIFGR1; /*!< Clear Interrupt Flag 1 Register */ IO uint32_t IV; /*!< Interrupt Vector Register */ } ADC14_Type; Fig. 11. This header can be used to write more readable code. msp432p401r.h extraction 4.3 Linker file msp432p401r.cmd The linker file msp432p401r.cmd, allocates the virtual memory space to the code, heap, stack, global variables, interruptions, and should match the physical memory constraints of the chip. For example, the interruption vector and startup code.intvecs should be placed at address 0x00000000 so that the code can be executed normally: /* Section allocation in memory */ SECTIONS {.intvecs: > 0x00000000.text : > MAIN.const : > MAIN.cinit : > MAIN.pinit : > MAIN.init_array : > MAIN.binit : {} > MAIN /* The following sections show the usage of the INFO flash memory */ /* INFO flash memory is intended to be used for the following */ /* device specific purposes: */ /* Flash mailbox for device security operations */.flashmailbox : > 0x00200000 /* TLV table for device identification and characterization */.tlvtable : > 0x00201000 /* BSL area for device bootstrap loader */.bslarea : > 0x00202000.vtable : > 0x20000000.data : > SRAM_DATA.bss : > SRAM_DATA.sysmem : > SRAM_DATA 18/09/2018 P a g e 9

.stack : > SRAM_DATA (HIGH) #ifdef TI_COMPILER_VERSION #if TI_COMPILER_VERSION >= 15009000.TI.ramfunc : {} load=main, run=sram_code, table(binit) #endif #endif } 4.4 Project compilation After saving the source file, the project can be compiled by choosing menu Project Build Project. Fig. 12. Build active project If there are more than one project in the workspace, you must be sure that the right project is compiled, left click on the project name in the Project explorer window to set the project as Active Project. Some files in the project can be excluded from build: right click on the file and select Exclude from Build. To make sure that a project is not built, one should close the project: Right click on the project and select Close Project. A faster way to compile the project is right click on the project name and choose Build Project. When the IDE is compiling the project, the Console and Problem windows will output the compilation result. 18/09/2018 P a g e 10

Fig. 13. Compilation result Once the compilation and the linking processes are done, the project can be debugged. 18/09/2018 P a g e 11

4.5 Debug MSP432 Project with the XDS110 on-board Debug Probe This step assumes that the XDS110 debug probe driver was successfully installed before. Connect the PC and the development board using the micro-usb adapter. Choose menu Run Debug to debug the project, make sure you have the board connected before you try to debug the code. Fig. 14. Setting Debug mode After that, the XDS110 tool will download compiled code to the micro-controller and enter to debug window. In this window, you can choose an appropriate debug command. For example, click Resume button to run your program. Click on the Terminate button to stop debugging and return to C/C++ compose section. While debugging, we can observe the variable value in Local window. Some windows can be opened to visualize source code, disassembly code, memory, variables, etc. 18/09/2018 P a g e 12

Fig. 15. Debugger windows The code execution can be done at the C level or at the assembly language level (you can display the Disassembly window with Window Show View Disassembly ). Breakpoints can be put on the source code to stop the program execution in case of Run (green button to start running) by double clicking on the desired code line number. Make sure you feel comfortable with CSS before you start the Lab, and do not hesitate to ask questions to the TAs! 18/09/2018 P a g e 13

Summary 1 Installation and documentation... 1 2 Launching Code Composer Studio... 2 3 New MSP432 Project... 3 3.1 Create MSP432 Project... 3 3.2 Adding a source file... 5 4 Program example to start... 6 4.1 Example program... 7 4.2 Header file msp432p401r.h... 7 4.3 Linker file msp432p401r.cmd... 9 4.4 Project compilation... 10 4.5 Debug MSP432 Project with the XDS110 on-board Debug Probe... 12 List of Figures... 15 18/09/2018 P a g e 14

List of Figures Fig. 1. Select a Workspace... 2 Fig. 2. Empty code Composer Studio window... 2 Fig. 3. Create a CCS project... 3 Fig. 4. Configure the new project... 4 Fig. 5. New source file... 5 Fig. 6. New source file specification... 6 Fig. 7. GPIO Toggle program... 7 Fig. 8. Tools windows... 7 Fig. 9. msp432p401r.h extraction... 8 Fig. 10. msp432p401r.h extraction... 8 Fig. 11. msp432p401r.h extraction... 9 Fig. 12. Build active project... 10 Fig. 13. Compilation result... 11 Fig. 14. Setting Debug mode... 12 Fig. 15. Debugger windows... 13 18/09/2018 P a g e 15