Codewarrior for ColdFire (Eclipse) 10.0 Setup

Similar documents
Controller Continuum. for Microcontrollers V6.3. Quick Start

Quick Start Guide TWR-S08PT60. 5-Volt S08P Family of 8-bit MCUs for Industrial and Appliance Applications TOWER SYSTEM

Assignment 1 Board Configuration, Compiling, Debugging, and Executable Files CSE 325, Fall 2010

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

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

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

CodeWarrior Development Studio for Freescale 68HC12/HCS12/HCS12X/XGATE Microcontrollers Quick Start SYSTEM REQUIREMENTS Hardware Operating System 200

Quick Start Guide TWR-S08DC-PT60. Tower System Daughter Card for the 5-Volt 8-bit MC9S08P Family TOWER SYSTEM

Introduction to Netburner Network Development Kit (NNDK) MOD5282

Freescale, the Freescale logo and CodeWarrior are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Xtrinsic is a trademark of

NEW CEIBO DEBUGGER. Menus and Commands

Evaluation board for NXP LPC2103. User Guide. Preliminary Version updated 27 th Aug TechToys Company All Rights Reserved

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

LAB #1: The CSM12C32 Module and PBMCUSLK Project Board

Lab Guide Rev. 0 TWRWIFIG1011MILAB

DOMAIN TECHNOLOGIES INC. Users Guide Version 2.0 SB-USB2. Emulator

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

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

LPCXpresso User Guide. Rev October, 2013

CodeWarrior Development Studio for Power Architecture Processors FAQ Guide

BASICS OF THE RENESAS SYNERGY PLATFORM

RVDS 3.0 Introductory Tutorial

Programming in the MAXQ environment

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

CodeWarrior Development Studio for Microcontrollers V10.x Getting Started Guide

STM32 Ecosystem Workshop. T.O.M.A.S Team

Quick Start Guide for TWR-MCF5225X TOWER SYSTEM. MCF5225X ColdFire connectivity MCUs

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

Changing the Embedded World TM. Module 3: Getting Started Debugging

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

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

Experiment 1. Development Platform. Ahmad Khayyat, Hazem Selmi, Saleh AlSaleh

1.2 - Introduction to the IAR Workbench IDE *

A brief intro to MQX Lite. Real work: hands-on labs. Overview, Main features and Code Size

A Quick Introduction to MPLAB SIM

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

Disassemble the machine code present in any memory region. Single step through each assembly language instruction in the Nios II application.

Debugging in AVR32 Studio

for ColdFire Architectures V7.2 Quick Start

Migrating from CubeSuite+ to Eclipse RL78 Family

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

RVDS 4.0 Introductory Tutorial

Red Suite 4 Getting Started. Applies to Red Suite 4.22 or greater

Using Virtual EEPROM and Flash API for Renesas MCUs RX600 Series

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

F2MC-8FX EEPROM Library

indart -HCS08 In-Circuit Debugger/Programmer for Freescale HCS08 Family FLASH Devices User s Manual Rev. 2.0

Fujitsu 2010 FAE Training Lab Sunnyvale, CA

Quick Start Guide TRK-KEA. Kinetis EA Series MCUs for Automotive Electronics Applications. StarterTRAK

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

EKK-LM3S811 QUICKSTART

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

C Support for myrio 5.0 User Guide

User Guide. Introduction. Requirements. Installing and Configuring. C Interface for NI myrio

Using Code Composer Studio IDE with MSP432

Contents. About This Guide... 2 Audience... 2 Revision History... 2 Conventions... 3 Definitions, Acronyms, and Abbreviations... 3

At the shell prompt, enter idlde

Eclipse Tutorial. For Introduction to Java Programming By Y. Daniel Liang

STM32 Ecosystem workshop. T.O.M.A.S Team

EE 357 Lab 1 Some Assembly Required

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

ECE 362 Experiment 3: General Purpose I/O

Resource 2 Embedded computer and development environment

embos Real Time Operating System CPU & Compiler specifics for ARM core with ARM RealView Developer Suite 3.0 Document Rev. 1

Quick Start Guide TWR-56F8400. The Ultimate Solution in Performance and Precision for Energy-Efficient Innovation TOWER SYSTEM

P&E Microcomputer Systems, Inc. PKGPPCNEXUS

Laboratory Assignment #4 Debugging in Eclipse CDT 1

EE475 Lab #3 Fall Memory Placement and Interrupts

Flash Loader Utility for the Z8 Encore! XP MCU

Quick Start Guide. TWR 56F8200 Tower System Module for MC56F823xx and MC56F827xx. Digital Signal Controllers TOWER SYSTEM

CodeWarrior Development Studio for Advanced Packet Processing FAQ Guide

AE483: Lab #1 Sensor Data Collection and Analysis

EPM900 - Overview. Features. Technical Data

Software Setup and Introductory Assembly programs for the MSP430 *

GETTING STARTED WITH ECLIPSE Caitrin Armstrong

Component validity and internal error checking functionality to ensure reliable operation

Required Setup for 32-bit Applications

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

ADS MultiTrace Tutorial v2.0

M52259DEMOKIT One-stop-shop connectivity MCU with USB, Ethernet and CAN, featuring Freescale MQX software solutions

Lesson 5 Arduino Prototype Development Platforms. Chapter-8 L05: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

Application Note. Startup DevKit16. History 19 th June 00 TKa V1.0 started 20 th June 00 TKa V1.1 Some minor text corrections

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

Pre-Lab due: at 3 p.m. Post-Lab due: at 5 p.m. Name:... Forename:... Initials:...

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

ECE QNX Real-time Lab

CodeWarrior Development Studio for etpu v10.x Quick Start SYSTEM REQUIREMENTS

PK-HCS12C32 Starter Kit for Motorola MC9S12C32 User s Manual

Create and Debug a CCSv5.5 Project for DSK6713- or DUETT-Board1

EUROScope lite 16FX Reference Manual

BasicScript 2.25 User s Guide. May 29, 1996

Getting started with the PowerPC tools:

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

Lab 1 Introduction to Microcontroller

TRACE32 Debugger Getting Started... ICD Tutorial About the Tutorial... 2

Figure 1. Simplicity Studio

NIOS CPU Based Embedded Computer System on Programmable Chip

)8-,768'HY.LW 2YHUYLHZ. )XMLWVX0LNURHOHNWURQLN*PE+ Am Siebenstein Dreieich-Buchschlag, Germany

Transcription:

Codewarrior for ColdFire (Eclipse) 10.0 Setup 1. Goal This document is designed to ensure that your Codewarrior for Coldfire v10.0 environment is correctly setup and to orient you to it basic functionality of programming and debugging C and assembly based programs. 2. Introduction The Codewarrior for Coldfire v10.0 is an integrated development environment (IDE) for the Freescale Coldfire line of microcontrollers. This microcontroller uses a core processor that implements the Coldfire instruction set. In addition, the Coldfire MCF52259 processor has 512KB of Flash memory for non-volatile program storage, a small amount of RAM (64KB), integrated interrupt controller, timers, UART (serial) ports, USB and Ethernet ports, several channels of A-to-D converters, and many other peripheral devices including the ability to use several dozen I/O pins as general purpose I/O. You will learn more about these features throughout the semester. Information regarding the control of 52259 is available online through its reference manual. The reference manual is broken into chapters for each I/O block and provides bit-by-bit explanations for relevant control registers. To configure and test embedded software, the MCF52259 processor has been integrated onto the 52259 board. The board includes some on-board I/O such as a few pushbuttons, a potentiometer, and LED s. It also provides a power supply and regulator, a debugging control chip (BDM chip), and a place for a 40-pin I/O connector. To develop software for the Coldfire microcontroller, Freescale provides an Eclipsebased IDE (Integrated Development Environment), named Codewarrior. This IDE provides a 52259 C compiler and assembler along with integrated debugging tools to allow you to run and debug your application code by single-stepping, setting breakpoints, and viewing register and memory contents. 3. Codewarrior Setup and Installation a. The Codewarrior IDE has been installed on the computers in the RTH classrooms. However, it is not currently installed in any of the computer user rooms on campus. Instead, you can install Codewarrior on your own PC/laptop by going to the following link: http://cache.freescale.com/lgfiles/devsuites/mcu/cw_mcu_v10.0_windows_se.exe?fpsp=1. We highly encourage you to install this software on your own PC so you can work on your lab outside of discussion times. You should be able to use the standard install options without issue. At the end of installation, it will ask to install several hardware drivers to connect to your board. Say yes to all of these driver install packages. Though it is Windows-based we have had previous versions running via Parallels and/or Bootcamp on Mac s. Also, the software should work on either 32-bit or 64-bit OS version but if you have any issues, please consult the TA and discussion boards.

4. Creating Projects in Codewarrior Usually you will be provided with an incomplete (skeleton) set of source files. You will then create a project through Codewarrior and then copy and add those source files. Details for creating a new project are described below. a. Start Codewarrior and Select File > New > Project. The New Project dialog box appears. Select Bareboard Project and click Next. The Create an MCU Bareboard Project page appears. Type your desired project name and in location set the parent directory where you would like your project folder. Figure 1 - New MCU Project Page b. Next, we will tell Codewarrior what part we are using. In the window pane find Coldfire V2.. MCF5225X MCF52259. Click Next. The connections page appears. Check the Open Source BDM box. Click Next. Figure 2 Setting the part Figure 3 Setting the Connection Type c. Skip through the next window (we will add source files later). d. In the next window select Minimal Hardware Support for Hardware Startup. Select Easy Debug for the Optimization Level. Click Next.

Figure 4 Start startup code generation option e. In the next window regarding the Processor Expert, click None and then Click Finish. 5. C and Assembly Projects a. We have provided several files that include other helpful functionality in both C-based or assembly-based projects. On Blackboard..Assignments..Labs, download the Codewarrior 52259 Assembly Template Files.zip file or Codewarrior 52259 C Template Files. Unzip it to a temporary location. Follow the procedure below for EVERY new project you create in this course. b. For C projects: In Windows Explorer, take the source files you unzipped and copy the usc_support.h file to Project_name/Project Headers folder and the usc_support.c file to the Project_name/Sources folder. All files in the sources folder are automatically included in the project. Now from within the Eclipse project, open/edit main.c. To use our USC specific functionality, please add the following line to main.c just under the #include <stdio.h> line: #include usc_support.h You can begin editing main.c and write your program. For I/O, we have written our own version of printf and called it myprintf while scanf remains unchanged. You can use normal printf and scanf I/O functions but please reference the note below. Note: There are known problems with Codewarrior s Console I/O that require every string and integer input and output to be terminated or followed by a newline (LF). c. For ASSEMBLY-ONLY projects: In Windows Explorer, take the source files you unzipped, copy usc_support.h and ee357_asm_lib_hdr.s and ee357_exceptions.h to Project_name/Project Headers. Then copy usc_support.c, ee357_asm_lib.s, main.s, to the Project_name/Sources folder. Next, from within the Eclipse project, find the main.c file in the Project_name/sources folder. Right-click on the file. Select Exclude from build. Click Select all then Ok. Your main program is now ready to be edited in main.s. From within your main.s code, you can perform I/O from the HW

board to your PC. In assembly this can be followed by calling the appropriate subroutines via the jsr instruction and pre-loading certain register with the necessary arguments. See the table below and reference the note above in the C section which also applies to assembly projects. I/O Operation Calling Instruction Arguments Return Value Print a null-terminated ASCII A1 = Pointer to first jsr ee357_put_str None string character of string Print an integer jsr ee357_put_int D1 = Value to print None D1 = Number of A1 = Pointer to Get the specified number of characters received memory buffer to ASCII characters from the PC (including the LF ). jsr ee357_get_str place string keyboard. Must terminate with Unused characters in D1 = Max characters the Enter key (ASCII LF char.) the buffer will be to receive zeroed (NULL). 1 Get an integer from the PC keyboard. Must terminate with the Enter key. jsr ee357_get_int None Integer from keyboard Figure 5 The codewarrior project navigation pane shows all the source files of the project. 1 When getting a string (ASCII characters), make sure the value passed in D1 is 1 less than the size of the buffer so that a NULL character can be added (which is necessary if this will be printed or processed as a traditional string). If more characters are entered than the value passed in D1, characters beyond the limit will be discarded (including the newline/lf character)

6. Compiling and Debugging Projects a. A few buttons will be useful when compiling and debugging your code. Build (Compile) Icon Debug Icon b. First, you must select the target I/O system and code location. This can be done by right-clicking on the project name in the project navigation pane (shown above). Select Build Configurations > Set Active > MCF52259_CONSOLE_INTERNAL_RAM. You should normally ensure this is set to CONSOLE_INTERNAL_RAM. Information about each option is listed below: i) CONSOLE_INTERNAL_RAM : Unless otherwise directed be sure that this option is selected. This allows you to execute I/O functions (either the assembly versions or C I/O functions like myprintf() and have the output be redirected to the Codewarrior Console window. ii) INTERNAL_RAM : This option does not include the standard C I/O libraries and places code in system RAM. iii) INTERNAL FLASH : This option should NEVER be selected. (Because we are only debugging our code, we will always want it loaded into RAM. In the real world, once you have debugged your code and want to embed it in the 5211 processor, the final code can be permanently burned to ROM.) c. Select your project in the project navigation pane. Then click the build button. d. If you are running an assembly-based project, it is highly recommended that you set a breakpoint at the main label / first instruction by clicking in the left margin of the line. A red dot will appear indicating the breakpoint. If you do not set the breakpoint, the program will simply run and not allow you to step through your code. C-based projects will automatically load the program and stop at the main() function and allow you to run the program or step through it. For assembly projects, click in the left margin to set a breakpoint at main. Figure 6 Set a breakpoint in assembly projects to prevent run-away execution or your code when the debugger is started e. You will be running the code on your board, first connect the USB cable from the PC to the M52259 board. (Note: Be aware that the first time you connect your board, the PC may need to install a driver.) The PC should recognize the USB

device at which point you can click the Debug button. Select the configuration <projectname>_console_internal_ram to download and run your code to the board. f. The Debug perspective will appear and execution should break at the breakpoint in your assembly code or, for C projects, the first line of your main routine. Note you can switch between the Debug perspective and the default perspective(c/c++) by selecting the desired one in the upper right-hand corner. Figure 7 The Debug Perspective g. The debug perspective by default shows you the assembly code that is generated by the C compiler. As shown in figure 7. h. The available commands are accessed using the toolbar at the top of the debug window. The commands are summarized below. Run/Resume Suspend Kill / Terminate Step Over Step Into Step Out Runs the program until it is stopped or encounters a breakpoint. Breaks/stops program execution. Kills the execution and stops debug mode Steps through code and over function calls (executes the entire function moving on to the next statement.) Steps through code and into function calls. Completes execution of the current function and back to the calling routine. Figure 8 Debug Toolbar Commands i. Breakpoints: Breakpoints can be set by double-clicking on the far left of each statement. When a breakpoint is enabled, a check mark appears indicating the

execution will stop at that statement. Double-clicking on the check mark will remove the breakpoint and the check mark will disappear. Figure 9 Setting Breakpoints j. Watching Variables (C programs only): If you set a breakpoint or step through your code, you can see the value of live variables in the upper right window pane of the debug perspective. k. Viewing Registers: Register values including most I/O control registers can be viewed by selecting Registers in the upper right window pane. The register window will appear and can be used to navigate to the desired processor and I/O register. When using the actual boards, all I/O registers for controlling integrated peripherals will also be visible. Figure 10 - Register Window l. Viewing Memory: Memory can be viewed by selecting Memory Browser in the bottom window pane. You can navigate to the desired address range by typing the address in the Display textbox. Note that addresses should be typed in C hex format (i.e. prepended with 0x40000000). Alternatively, you can right click on address registers (An) in the register window and view the memory contents starting at the address to which they are pointing. Also, the.data section of memory for the 52259 starts at 0x20003004. Figure 11 Memory Window