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

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

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

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

Migration from HEW to e 2 studio Development Tools > IDEs

Old Company Name in Catalogs and Other Documents

R8C/Tiny. StarterKit Plus SKP8CMINI-15, SKP8CMINI-17. Clock Stop Detect

NEW CEIBO DEBUGGER. Menus and Commands

HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS

Old Company Name in Catalogs and Other Documents

Quick-Start Guide. BNS Solutions. QSK62P Plus

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP2

Old Company Name in Catalogs and Other Documents

Figure 1. Simplicity Studio

Quick Start Guide to Convert Files Generated by SANGO to HEW. Installation of Sango Part I.

3 TUTORIAL. In This Chapter. Figure 1-0. Table 1-0. Listing 1-0.

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP9

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

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

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

Code Composer Studio IDE Getting Started Guide. User's Guide

Code Composer Studio Development Tools v3.3. Getting Started Guide

Software Setup and Introductory Assembly programs for the MSP430 *

Section 1 AVR Studio User Guide

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

2 TUTORIAL. Overview. VisualDSP Getting Started Guide 2-1 for SHARC DSPs

An Introduction to Komodo

Quick Start Guide for the Turbo upsd DK3300-ELCD Development Kit- RIDE

M16C R8C FoUSB/UART Debugger. User Manual REJ10J

Migrating from CubeSuite+ to Eclipse RL78 Family

IAR C-SPY Hardware Debugger Systems User Guide

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

Module 3: Working with C/C++

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

AndeSight. User Manual. Working with AndESLive. Version 1.0

CodeWarrior Development Studio for Power Architecture Processors FAQ Guide

Code::Blocks Student Manual

Computer Basics: Step-by-Step Guide (Session 2)

P&E Microcomputer Systems, Inc. PKGPPCNEXUS

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

Debugging in AVR32 Studio

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

AN1369 APPLICATION NOTE

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

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

NIOS CPU Based Embedded Computer System on Programmable Chip

AGH University of Science and Technology Cracow Department of Electronics

In the HEW, open a new project by selecting New workspace from the main menu.

Nios II Studio Help System

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

Keil TM MDK-ARM Quick Start for. Holtek s HT32 Series Microcontrollers

ECE QNX Real-time Lab

AURIX family and AUDO Future, AUDO MAX

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

IAR EWARM Quick Start for. Holtek s HT32 Series Microcontrollers

Getting Started (1.8.7) 9/2/2009

CodeWarrior Development Studio for Advanced Packet Processing FAQ Guide

Getting Started with STK200 Dragon

Xilinx Vivado/SDK Tutorial

Introduction. Purpose. Objectives. Content. Learning Time

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP21

Handout Objectives: a. b. c. d. 3. a. b. c. d. e a. b. 6. a. b. c. d. Overview:

Resource 2 Embedded computer and development environment

Using the KD30 Debugger

M16C R8C FoUSB/UART Debugger. User s Manual REJ10J

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

BASICS OF THE RENESAS SYNERGY TM

Project Debugging with MDK-ARM

1 Preface About this Manual Intended Audience Revision History Document Conventions Version...

Code::Blocks Student Manual

Codewarrior for ColdFire (Eclipse) 10.0 Setup

Introduction. This tutorial introduces the following SingleStep features:

At the shell prompt, enter idlde

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

AutoCAD 2009 User InterfaceChapter1:

Discovering Computers & Microsoft Office Office 2010 and Windows 7: Essential Concepts and Skills

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

Getting started with the PowerPC tools:

NSCC SUMMER LEARNING SESSIONS MICROSOFT OFFICE SESSION

Using Virtual EEPROM and Flash API for Renesas MCUs RX600 Series

S32R274RRUEVB AND S32R372RRSEVB SOFTWARE INTEGRATION GUIDE (SWIG)

One possible window configuration preferences for debug cycles

CS+ for CA,CX V

Computer Essentials Session 1 Lesson Plan

BASICS OF THE RENESAS SYNERGY PLATFORM

F28335 ControlCard Lab1

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

Assembly Programming in Atmel Studio 7 Step by Step Tutorial

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

REJ10J High-performance Embedded Workshop V User's Manual. Renesas Microcomputer Development Environment System

Renesas E8 On-Chip Debugging Emulator

OpenForms360 Validation User Guide Notable Solutions Inc.

1 Introduction to MARS

IT Essentials v6.0 Windows 10 Software Labs

_ V Renesas R8C In-Circuit Emulation. Contents. Technical Notes

EMUL-PPC-PC. Getting Started Guide. Version 1.0

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

Visual Studio.NET. Although it is possible to program.net using only the command OVERVIEW OF VISUAL STUDIO.NET

A Quick Introduction to MPLAB SIM

User Manual Portable Laptop Console Crash Cart Adapter

Transcription:

Getting Started with Renesas Development Tools R8C/3LX Family Description: The purpose of this lab is to allow a user new to the Renesas development environment to quickly come up to speed on the basic features of the tools available for creating, managing, and debugging embedded software. This lab will step through starting the development environment, creating a new project, investigating several key features of the tool management window, building a simple project, and then debugging the project. Lab Objectives 1. Examine key features of the development system 2. User project wizards to build workspace 3. Connect to target with debugger 4. Perform simple debug operations to see basic operations of HEW and tools Lab Materials Please verify you have the following materials at your lab station. Laptop PC with Renesas tools pre-installed R8C/L3A LCD Demo Platform E8a debugger and cables This lab sheet Skill Level 1. Beginner/new to Renesas Tools Time to Complete Lab 120 Minutes Lab Sections 1 Creating an Empty Application... 2 2 Maps, External Files, Desktops, Customizations... 7 3 Project Wizard Creation... 10 4 Basic Project Navigation... 12 5 File Control... 14 6 Menu Bar Options... 16 7 Sessions and Configurations... 22 8 Connecting to the Target... 25 9 Basic Debugging... 28 Answer Sheet... 35 Getting Started with Renesas Development Tools Page 1 of 35

1 Creating an Empty Application Overview: This section will create a new project using the C based Startup file wizard for an R8C/23. Source files will then be added to the project and the project will be built. The map of the resulting linked code will then be investigated using the MapView feature of HEW Procedural Steps Step 1.1 Start the development environment (hereafter called High Performance embedded Workshop or HEW) by clicking Start->Programs->Renesas->High Performance Embedded Workshop-> High Performance Embedded Workshop or by clicking the HEW icon from the Windows Desktop. This will start the HEW and a window similar to below will appear: Within the smaller active window, you are presented with the Welcome! window with several choices to select from. These are typical of any development environment and include, Create a new project workspace, Open a recent project workspace, and Browse to another project workspace. Additionally an Administration button appears. This allows the user to see currently installed tools and debugger components without having to invoke a project. Let s take a look at this feature closer. Getting Started with Renesas Development Tools Page 2 of 35

Step 1.2 Click on the Administration button to bring up the Tools Administration window. It will appear similar to below: In this window, you can open the various folders to see the currently installed versions of tools that are available for use. Here s an example: Step 1.3 In the Tools Administration window, open the Toolchains, System Tools, and Extension Components folders. You will see entries similar to what is shown in the picture below. As you can see, compiler, debugger, and other development tools that are installed and controlled by the HEW environment and their current version numbers can easily be seen here and verified before starting a project. Also new tools can be registered or uninstalled from the HEW environment from this window. This feature can be important when working with older projects or ensuring that your installed tools are the latest available from Renesas. Getting Started with Renesas Development Tools Page 3 of 35

Now let s move to creating your first project with Renesas developments tools using the HEW development environment. Step 1.4 Select Cancel from the Tools Administration window to exit the administration pane Step 1.5 Select Create a New Project Workspace on the Welcome screen and click OK. Step 1.6 Select or Fill-in the following on the next dialog screen Workspace Name = Dev_Tools_Lab Project Name = This will fill in with the above do not change Directory= This will fill in with the above do not change CPU Family = M16C ToolChain = Renesas M16C Standard Project Type = C source startup Application Several Project Types choices can be seen here depending on what tools are installed and registered in the HEW environment. A short summary of these are: Application: Assembly Startup (toolchain dependent) files are used for low level device initialization C source startup Application: C-based startup files are used for low level device initialization Empty Application: Project shell and folders are created. No startup files are created Import Makefile: Externally HMAKE make files can be imported Library: Library modules can be created RSKxxx: Prebuilt projects and wizards that are installed with new Renesas RSK platforms Debugger Only: HEW controlled debug sessions are created. Third party tools that output Renesas compatible debug format files can be used here A number of these are advanced features and will be covered in later lab sessions. The available features will change depending on selections made in the Tool chain pull-down menu. Let s continue with creating a simple project using the project wizard. Step 1.7 Step 1.8 Click OK On the next screen Select CPU Series = R8C/Tiny CPU Group = L3AA Getting Started with Renesas Development Tools Page 4 of 35

The Toolchain selection on this screen will default to the latest installed Toolchain. We will leave it for this lab but if you look at the selections on the pulldown for that item you will see all applicable toolchain versions which could be used Step 1.9 Click Next Step 1.10 On the next screen Verify or Modify to match the image shown below then Click Next: Step 1.11 On the Setting the Stack Area screen Verify : Use User Stack checkbox is selected Both User Stack Pointer and Interrupt Stack Pointer sizes are 0x80 Then click Next Step 1.12 On the Setting the Target System for Debugging screen Targets - Click M16C R8C Simulator checkbox External Debugger Verify None Target Type Verify R8C/Tiny Target CPU Verify L3AA Then click Next Getting Started with Renesas Development Tools Page 5 of 35

No debug session will be created here, but by selecting the check boxes, you can create default debugger sessions from this wizard. Step 1.13 Click Finish on the File Names to be Created screen Step 1.14 Click OK on the Summary screen which describes the files that will be built Step 1.15 On the tool bar click the build button to build the project, the 1 st button on the right in the below picture. Alternatively you can click Build->Build All from the menu bar in the HEW environment. A picture of the menu bar is shown below Note that there are multiple options for building the project. This can range from: Build File: build current highlighted file in the workspace pane Build: builds out of date project files Build All: builds all project files regardless of date YOU VE JUST BUILT YOUR 1 st RENESAS PROJECT!!! We now have a worksapce that has basic files required for a project. These include C environment startup files and interrupt vector generation files. Getting Started with Renesas Development Tools Page 6 of 35

2 Maps, External Files, Desktops, Customizations Overview: This section of the lab will demonstrate some of the powerful features of HEW. This section will demonstrate the ability to link files other than source code files into a project and will highlight the Virtual Desktop feature and how to customize the keyboard interface Procedural Steps: Step 2.1 Step 2.2 Step 2.3 To see a linker map of the project that was just built select menu from the menu bar View>>Map Verify that the Map Section Information is selected in the Select Map Window Type dialog and click OK Adjust the window so you can see the relevant information The Section Map view gives you an overall view of the sections that exist in the project and where they are located Step 2.4 Step 2.5 Close the Map Window Now re-open the Map Window but Select Map Symbol Information Questions: 1) What information is provided in the Map Symbol Information view? Sometimes it is nice or necessary to have one of the panes large so the information can be viewed but this does not allow much room for the editor window and all other windows. This is the case with the Map window. Once it is sized so the information is readable it does not leave much room for the project, build and editor windows. We will use the virtual Desktop feature of HEW to show how you can work with these large windows without having to constantly move or resize portions of the screen Step 2.6 Make sure the Map Window is still Open, if it is not open it back up Step 2.7 Near the bottom of the screen you will see the Virtual Desktop Icons, Click between desktop 2 and desktop 1 and notice the difference in the screens Getting Started with Renesas Development Tools Page 7 of 35

Txt t Step 2.8 Step 2.9 From the menu select Setup>>Customize Choose the Keyboard Tab Step 2.10 Change the category pulldown to Global Step 2.11 Under Commands Select the Virtual Desktop 1 entry Step 2.12 The current keyboard shortcut is CTRL+ALT+1, highlight the New Keyboard Shortcut box and then press CTRL and F12. Notice that under the pull-down the current assignment of that key is <none>, if it was assigned or reserved it would be indicated. You can try other key combinations to see the difference. Notice that there are many different functions in HEW which have keyboard shortcuts assigned and the shortcuts can be customized. A complete list of the Default assigments can be found in the Help File Step 2.13 With the New Keyboard Shortcut showing CTRL and F12 click the Assign button. Step 2.14 Now assign ALT F12 to Virtual Desktop 2 Step 2.15 Click OK to exit the Customize Dialog Step 2.16 Use CTRL+F12 and ALT+F12 to toggle between the desktops Another convenient feature of HEW is the ability to add files other than project files to the workspace for easy reference. We will now add the R8C/35A hardware manual, RSK schematic, and a text file which shows the header and device pinouts to the project. The text file we are including is in each project on the RSK as a Readme.txt entry in the project if the Project Wizard is used. Getting Started with Renesas Development Tools Page 8 of 35

Step 2.17 Select menu Project>>Add Files Step 2.18 In the dialog box first select All Files for File Types Step 2.19 Browse to C:\ Workspace\Tools_Add_Files\ Step 2.20 Unselect Relative Path Step 2.21 Select all the files and Click ADD Step 2.22 Notice that the files are now added to the project. Double-click each entry and see what happens Questions: 2) What programs were used to open the text file and hardware manual(s)? Step 2.23 Since the RSK_Header.txt file is only text it would be nice to open it within the HEW editor. Do this by selecting menu Project>>File Extensions Step 2.24 Notice that *.txt is not in the current list of extensions so the Windows default will be used. To change this select Add Step 2.25 Modify the dialog box that comes up to that match the box shown below and click OK Getting Started with Renesas Development Tools Page 9 of 35

Step 2.26 Click OK to exit the tile extension dialog Step 2.27 Double-Click on the RSK_Header.txt entry in the project and you should see that it opens using the HEW editor 3 Project Wizard Creation Overview: This lab section will walk the user through startup of the development environment, basic administration of the HEW environment, and basic project creation with the included project wizards. Procedural Steps Step 3.1 Step 3.2 Click Close Workspace in the HEW file bar to close the workspace. Click YES to agree to all the saving of files Select the Create a new project workspace and click OK. This will start a new project workspace but we will use the integrated project wizards built into HEW. A window will open similar to the one shown below: Getting Started with Renesas Development Tools Page 10 of 35

Step 3.3 Step 3.4 Step 3.5 Step 3.6 Step 3.7 Ensure that CPU Family is M16C. Click on RSKR8CL3AC in the Project Types window. Click in the Workspace Name entry box and enter R8CL3A_Sample for the workspace name. Note that the project directory will also be named this. That selection can be changed if desired. Ensure that Tool chain: is Renesas M16C Standard Click OK to start the project wizard. A new window will appear which will bring up the RSK project generation wizard. This window is shown below: Use the following steps to step through the wizard and complete your first Renesas project. Step 3.8 Ensure Tutorial is selected and click the Next button. A new window will appear as shown in the below picture. Getting Started with Renesas Development Tools Page 11 of 35

This window depicts what files will be created by the project wizard. As can be seen, various C files are being added to the project based upon prebuilt configurations that are a part of the RSK platform. These prebuilt projects are intended to show the various configurations of the peripherals on the microcontroller and can be used as sample reference for future projects. Step 3.9 Click on Finish to move to the next step in the project wizard. This will bring up a summary screen as shown below again detailing the files being created and added to the project Step 3.10 Click OK to complete the project generation wizard. HEW will now create the project and open to a default view of the development environment. Questions: 3) Can you list some of the other tool chains installed within HEW 4 Basic Project Navigation Quickly looking at the current view, we can see in the left-hand pane source files that were created using the project wizard are listed. Step 4.1 Double-click on flashlcd.c to open the file in the editor window. From here, basic editing of the source files can be performed. HEW has a basic editor that is sufficient for most project development. Looking at the Project Pane, you can see all the files created by the Project Generator (PG). There are a number of navigational options available to the HEW user just from this pane. Let s take a look at few of them. Step 4.2 Right click in the project pane; highlight Configure View and single click. Another window will open Getting Started with Renesas Development Tools Page 12 of 35

The configure view will open showing selections that can be made to customize the view of the project files. For example: Step 4.3 Click Show dependencies under each file and click OK You will see that the project pane is reconfigured such that all the source files and dependencies are grouped in separate folders. There are other tabs in the project pane that can be used to configure the project or perform other tasks as needed. For example: Step 4.4 Step 4.5 Click on the Navigation tab at the bottom of the project pane Open the C Functions folder This will show all the functions that are in the current project. Double-clicking on any of the functions will open editor window and bring that function into the center of the editor window There are other tabs that are in the project pane that have advanced features including test scripting and template usage. Step 4.6 Click on the Project navigation tab to return to the project view of the workspace Getting Started with Renesas Development Tools Page 13 of 35

5 File Control The HEW IDE allows you to easily add, remove, and exclude files from the build environment. This lab section will take a quick look at how to do those options. Removing a File Step 5.1 Step 5.2 Right-click on the source file flashlcd.c. In the window that appears, click Remove Files A window will appear with the project file list. To remove this file from the project, simply do the following: Step 5.3 Step 5.4 Single-click the flashlcd.c in the list to highlight the file Click the Remove button to remove that specific file. This will remove that specific file from the project. Step 5.5 Click OK to close the window. You will notice that in the project pane, the file is no longer part of the project. NOTE: this action does not delete the file from the project directory, only from the workspace environment. Adding a File Let s add that file back into the project; note the operation is slightly different. Follow these steps to do so: Step 5.6 Step 5.7 In the project pane, right-click to bring up the option menu. Click on Add Files to add the file to the project. A picture is shown below Getting Started with Renesas Development Tools Page 14 of 35

Step 5.8 A menu box will open in the workspace directory. Numerous files will be shown here. Select flashlcd.c and click Add The file will now be added to the project workspace. Its dependencies will also be included, if any are needed. Excluding a File Step 5.9 To exclude a file from the build, single click the file flashlcd.c in the workspace pane. It will highlight blue. Step 5.10 Right-click and a menu box will appear. Step 5.11 Click the menu entry Exclude Build flashlcd.c A red X will appear in the document icon for that file. When the project is built, the file will not be compiled or linked into the build binary. Now let s include that file back into the project. Step 5.12 Right-click on flashlcd.c and a menu box will appear Step 5.13 Select Include Build flashlcd.c The red X will disappear and the file will now be included in the build binary Questions: 4) Does removing a file from the build delete it from the project directory? Getting Started with Renesas Development Tools Page 15 of 35

6 Menu Bar Options HEW has numerous option for controlling build options, compiler settings, debug configurations, and other items needed for embedded development. Let s walk through a few of the basic ones needed by most developers. Step 6.1 In the HEW menu bar, click on the File menu. A window will open as follows: Here several options are shown; the highlights are: File Options: new, open, close Workspace Operations: close, open, save, save as Session Creation: adding specific sessions to the workspace. This will be covered shortly Recent file operations Step 6.2 In the HEW menu bar, click on the Edit menu. A window will open as follows: Getting Started with Renesas Development Tools Page 16 of 35

Here several options are shown; the highlights are: Typical editing operations: cut/paste/select Typical find options: find/search Breakpoint operations: toggle/enable disable Step 6.3 In the HEW menu bar, click on the View menu. A window will open as follows: Here several options are shown, the highlights are: Map: linkage map for project. Covered in the advanced lab TCL Toolkit Project view options: status, output, etc NOTE: this menu will change when the debugger is connected to a target. We ll return here once we move to that section of the lab Step 6.4 In the HEW menu bar, click on the Project menu. A window will open as follows Getting Started with Renesas Development Tools Page 17 of 35

Here several options are shown, the highlights are: Project selection and inclusion: HEW can maintain multiple projects in a single workspace environment Add/Remove files Step 6.5 In the HEW menu bar, clock on the Build menu. A window will open as follows: This is a rather important menu for the toolchain configuration. Compiler options, build settings, configurations, and other items are in this menu bar. Let s take a closer look at some of these. Step 6.6 Click on the Renesas M16C Standard Toolchain menu item. A window will appear as follows: Getting Started with Renesas Development Tools Page 18 of 35

Shown are all the compile options available for the currently loaded M16C toolchain. If other Renesas compilers are loaded into the HEW environment, their specific options will also appear in this menu. Let s take a closer look at some of the more often used options. Step 6.7 In the C tab, click the pull down and select Optimize. This operation is shown below The window will change and display the optimization settings for the compiler. This is shown below. Getting Started with Renesas Development Tools Page 19 of 35

These options are detailed in the NC30 (or other as loaded) compiler manual that is installed in the Renesas directory in Windows. You can review these at a later time to understand what all these options are. For now let s just set a couple of the standard ones. Step 6.8 Click on Size or Speed and Optimization level: as shown in the below picture This will set the compiler to optimize at a mid-range level with smaller size of the code being the predominant factor. Naturally, other options can be chosen as appropriate; however these are typically ones that will give good optimization performance. NOTE: NC30 compilers typically do not enable optimization by default; just a point to remember. Getting Started with Renesas Development Tools Page 20 of 35

There are other tabs within this window that cover other toolchain options as well such as: Assembly options List file creation Linkage and section order Library creation Other CPU specific items for the compiler in use These will change with the tool chain being used and sometimes not all options will be available. Step 6.9 Click on OK to set these options for the toolchain. The window will close. Step 6.10 Again click on Build to review other options for this menu. A review of the menu is shown below. Within this menu is also several options for building (compiling) the project loaded into the workspace. These are: Build/Build All/Build Multiple: Build control for the project Clean: removed intermediate files from the project Update dependencies: Used to find include files within the project workspace Build Phases/Configuration: custom build options or tools (e.g. LINT) to can be included into the project build Linkage Order: allows movement of module linkage within the memory map for custom placement of code Generate Makefile: outputs a text MAKE file for external compilation Questions: 5) What level of optimization is on by default in the NC30 compiler in this project? Getting Started with Renesas Development Tools Page 21 of 35

7 Sessions and Configurations What is a build configuration? Configurations are the build option settings (e.g., output of debug information or optimization) that can be individualized for specific project settings. The term "configuration" can also be referred to as "build configuration". In the figure below an example is shown; configurations "Debug", and "Release" are available. These default configurations are created by the High-performance Embedded Workshop when a project is created. Directories corresponding to each of the configurations are created under the project directory. These directories have the names of the configurations. Selection of the current configuration used for the loaded HEW project can be done at the HEW menu bar as shown in the following picture. How to set up build options To set up build options kept with a configuration, select the configuration from the drop-down list box in the toolchain window. This is done by: Step 7.1 Step 7.2 In the HEW menu bar, clock on the Build menu. Click on the Renesas M16C Standard Toolchain menu item. On the left side pane the configuration can be selected by using the pull-down menu and selecting the desired configuration. Options such as the compiler, assembler, and optimizing linkage editor can be set up. The figure below shows the dialog box in the pull-down state Getting Started with Renesas Development Tools Page 22 of 35

Step 7.3 Step 7.4 Click Cancel to make no changes here for this lab. The window will close On the HEW menu bar, click Debug. A list of debug options will appear as shown in the following picture Here several options are shown, the highlights are: Major debug options (Stop, Go, Reset/Go, others ) Connect/disconnect to the target thru the debugger Debug sessions Synchronized debugging (multiple targets running at once) Getting Started with Renesas Development Tools Page 23 of 35

Sessions What is session? Sessions manage various settings for High-performance Embedded Workshop debugger options specific to the debugger, and information on the Memory and Register windows and their positions. The term "session" can also be referred to as "debugger session". There are various option settings such as the debugger to be connected with the High-performance Embedded Workshop, the object format for debugging, download modules, and the timing of connecting the High-performance Embedded Workshop with the debugger. Sessions created by the High-performance Embedded Workshop When a project is created after selection of the toolchain, the High-performance Embedded Workshop automatically creates session "DefaultSession". If you have selected a target debugger at creation of the project, a session is automatically created for connecting the High-performance Embedded Workshop with the selected debugger. How to set up High-performance Embedded Workshop debugger options We will now go through the process of creating a new session.. We will setup a simulator session as an example. Step 7.5 On the HEW menu bar, click File->New Session A dialog box will open as shown below Step 7.6 Give the session a name of SIM. Ensure that M16C R8C Simulator and Renesas M16C Project Generator are selected and click OK. Another dialog box will appear. Getting Started with Renesas Development Tools Page 24 of 35

Step 7.7 Ensure that R8C/Tiny and L3AA are selected and click Finish HEW will automatically switch to this session and begin to connect to the target (the simulator in this case). Note that any type of session can be added to the workspace, such as full ICE, JTAG, and other debug or simulator targets for debugging. Step 7.8 Click Cancel and then OK to exit the simulator at this time. We will connect to a different debug target later in the lab. Step 7.9 Use the pull-down in the menu bar to select Default Session. A picture of the menu that appears is shown below. Step 7.10 Build the project using menu Build>>Build you should build with no errors. Questions: 6) Can you explain the difference between a session and a configuration? 8 Connecting to the Target Building the Sample Project Now that the project is built and a binary has been created, we can move to start our first debug session. This is comprised of several steps which are: Switch to the debug session Connect to the target Load the binary Switching to Debug Session Getting Started with Renesas Development Tools Page 25 of 35

Recall the section where we examined and created a session that included the simulator as a target. At the creation of this sample project, a debug session was created for us. In order to start debugging, we first need to switch to this session and make it active. This is done as follows: Step 8.1 Step 8.2 Ensure that your E8a is connected to your PC and to the R8C/LX target board prior to the next step In the HEW menu bar, click on the pull-down with Default Session or SIM listed and select SessionR8C_E8a_System. Step 8.3 A dialog box will appear asking you to save the current session. Click Yes. This has now made the debugger session active with the E8a as the debugger for the selected target Connecting to the Target Now that the session is active, we need to connect to the target through the HEW interface. This is done with the following steps. Step 8.4 Click on the Connect icon on the HEW tool bar. Alternatively you can use the menu bar by clicking Debug->Connect A dialog box entitled Emulator Setting will appear showing various details about the debugger, target configuration, and other information needed to connect to the target. Step 8.5 Ensure that the Emulator Setting dialog box is completed as: MCU Group = R8C/L3AC Group Device = R5F2L3A8C Mode = Erase Flash and Connect Power Supply = Power Target from Emulator and Vcc = 5.0V Getting Started with Renesas Development Tools Page 26 of 35

Step 8.6 Click the Firmware Location tab at the top of the Emulator Setting dialog box. Ensure that it is completed as follows: There are no user selectable dialogs in this box This allows the user to vary the location of the monitor debugger that is flashed into the device. If there is a need to move the monitor to a different location or the data flash area for example, this can be done here. Step 8.7 Click the Communication Baud Rate tab on the Emulator Setting dialog box. Ensure that it is completed as follows: 500000 bps This also allows the user to vary the communication baud rate between the target and debugger. Typically this is not modified. Step 8.8 Click OK to connect to the target through the emulator Questions: 7) What device are we connecting to for this lab session? Load the Binary In order to run the compiled code on the target with the emulator, we need to download the binary to the target. This can be configured to be done automatically, however for this exercise, we will do it manually. Step 8.9 Single click the R8CL3A_Sample.x30 file in the workspace pane. It can be found under the Download Modules folder Step 8.10 Right click and a dialog box will appear. Select Download and the module will download to the target. The below picture shows that operation Getting Started with Renesas Development Tools Page 27 of 35

The target is now programmed and is ready to run. We can now move to basic debugging. 9 Basic Debugging As we ve now got the target system ready to debug, let s look at some basic features needed to perform rudimentary debugging. These will include: Execution (start, stop, step, reset) Simple Breakpoint Setting Expanding source code Memory and Variable Watch Let s take a look at each of these in turn Execution Perform the following steps to see simple execution of the target Step 9.1 On the HEW tool bar, click the farthest left icon in the debug set of buttons. Alternatively this can be performed by using the menu bar by clicking Debug->Reset CPU or clicking. At this juncture, the debugger will reset the CPU and the resetprog.c file will open in the editor window. A simple yellow bar will indicate the current CPU program counter (PC). You can see that the line number of the file is on the left hand side of the window, followed by the physical address of the PC, two gutters for different types of breakpoints and then the source code is shown. Getting Started with Renesas Development Tools Page 28 of 35

Step 9.2 Run the target by clicking the GO button in the tool bar (second from left) or by using the menu bar and clicking Debug->Go or clicking. The stop sign should turn RED and the yellow PC bar will disappear Step 9.3 Stop the target by clicking the stop sign. The yellow bar will re-appear in the source file associated with the PC indicating the stopped position. This may be at any location within the code. Step 9.4 Reset the CPU by clicking the Reset icon in the toolbar or by using the menu Debug->Reset CPU. This will return the MCU to the start of program execution Step 9.5 Step the MCU by clicking the Step In icon in the menu bar,. Or this can be done by the menu bar and clicking Debug->Step In. Click this several times to see the operation Simple Breakpoint Setting a simple breakpoint for debugging is straightforward in the HEW environment. This can be done with the following steps. It s important to note however that there can be different types of breakpoints that can be set depending on the target MCU. We will examine the two most common types, the Address Match and Software Break breakpoints. Step 9.6 Step 9.7 Step 9.8 Open the main.c source file by double-clicking on the main.c entry in the workspace pane. Scroll to line 111 to the function InitialiseDisplayPanel(); Double-click in the gutter closest to the physical address to set an address match breakpoint there. It will look as follows Note this type of breakpoint is an Address Match breakpoint. It uses internal hardware to match the MCU program counter to that of the address selected in the code. Once those two match, then the monitor breaks or stops program execution at that point. The number of these types of breakpoints are governed by the target MCU being used, but can range from 2-8 or more depending on the complexity of the device. Step 9.9 Run the target by clicking the GO button in the tool bar or by using the menu bar and clicking Debug->Go. The target will start and then stop on the line indicated by the breakpoint. The yellow PC bar should be on the above indicated line as shown below. Getting Started with Renesas Development Tools Page 29 of 35

Step 9.10 Double-click on the blue breakpoint to remove it. The blue icon should go away The other kind of breakpoint typically used is a Software Breakpoint. This type of breakpoint physically writes a Break or BRK instruction into the code to create a breakpoint. This is then processed by the monitor to stop the code execution. There are typically 256 software breakpoints that can be inserted into the code. This does modify the code and HEW must re-flash the device with the inserted instruction prior to executing the target. Step 9.11 Double click on the closest gutter to the object code in the workspace pane. This will set a Software Breakpoint. It will look as follows. Step 9.12 Run the target by clicking the Reset-Go button in the tool bar and clicking Reset->Go. or by using the menu bar You will notice in the output window, the debugger will re-write the flash before running and stopping at the breakpoint you set. Code Display Modes Sometimes it s important to see how the compiler is creating the assembly code for a particular higher level language instruction. Using the previous breakpoint example, we will quickly see how to view source, mixed, and disassembly modes within HEW. At the top of the source window, there are three buttons which from left to right are: View Source View Mixed View Disassembly Typically, the debugger will default to object mode making C source level instructions visible. We will now check out the other 2 modes of viewing. Getting Started with Renesas Development Tools Page 30 of 35

Step 9.13 Click the middle button View Mixed and examine how the view of the code changes. Step 9.14 Again scroll to line 111 in the code. You will see a BRK instruction from the Software Breakpoint along with other assembly instructions that the compiler breaks the C source code into. It s useful to see this mode associating the assembly instructions with the object level code to understand how the MCU and compiler interact. Step 9.15 Next, click the farthest right button View Disassembly to see a complete assembly view of the object code. Here all references to object code are removed and assembly code is shown only. Step 9.16 Double click on the Software Breakpoint to remove it from the code. The black icon will disappear from the gutter in the window. Step 9.17 On the HEW tool bar, click the farthest left icon in the debug set of buttons. Alternatively this can be performed by using the menu bar by clicking Debug->Reset CPU or clicking will return the display to the View Source mode.. This Questions: 8) Can you explain the difference between the two breakpoint types used in this lab? Other Debugging Functions CPU Register Viewing Now that the debug session is active, there are numerous other options that can be accessed via the HEW menus. Let s take a quick look at some of the most useful ones. Getting Started with Renesas Development Tools Page 31 of 35

Step 9.18 In the HEW menu bar, click View->CPU->Registers. The CPU register window will open Step 9.19 Run the target by clicking the Reset-Go button in the tool bar and clicking Reset->Go. or by using the menu bar Step 9.20 Stop the target by clicking the stop sign. You will notice that the CPU registers contain information and data in them as a result of running the code RAM Monitor Window Viewing RAM contents, such as an array of variables can be useful, especially when the target is running. HEW and the target being debugged can provide mostly real-time updates of the MCU RAM contents. Here s how: Step 9.21 In the HEW menu bar, click View->CPU->Memory. A dialog box will open. Insert the following values: Display Address: 400 Scroll Start Address: 400 Scroll End Address: 500 The memory window will now open. You will likely need to scroll the window to open it for viewing. Step 9.22 Right click in the RAM Monitor Window and select Auto Refresh. This will update the memory window contents while the debug target is running. Step 9.23 Run the target by clicking the Reset-Go button in the tool bar and clicking Reset->Go. or by using the menu bar Step 9.24 Stop the target by clicking the stop sign. You will notice that the CPU registers contain information and data in them as a result of running the code C Watch Window Watching object level variables is sometimes easier than monitoring the RAM contents, expecially as the location of the variables in RAM will move depending on build conditions. Using the C Watch window makes this easy. Here s how: Step 9.25 Open the main.c source file by double-clicking on the main.c entry in the workspace pane. Step 9.26 Scroll to line 167 to the function Statics_Test Step 9.27 Double-click in the gutter closest to the physical address to set an address match breakpoint there. It will look as follows Step 9.28 Right click on the 'ucstr' variable and select 'Instant Watch' Step 9.29 A dialog will be displayed showing the current value of the variable. Select 'Add' in the dialog and a new 'Watch Window' will open. Step 9.30 Click the Plus sign in front of the added variable to expand the array to see all the elements Getting Started with Renesas Development Tools Page 32 of 35

Step 9.31 Run the target by clicking the GO button in the tool bar (second from left) or by using the menu bar and clicking Debug->Go or clicking. Repeat this setp several times to see the variables in the array change. IO Window Once in the debugging session, one typical issue is the state of certain Special Function Registers (SFR) that control the operation of the device or other peripherals. Typically most RSK devices come with I/O files that can be loaded into HEW and allow the user to quickly debug Step 9.32 In the HEW menu bar, click View-CPU->IO. A window pane will open in the HEW environment towards the bottom of the screen Step 9.33 Right-click in the window to open a dialog box as shown below Step 9.34 Select Load IO File from the menu another dialog box will open as shown below Step 9.35 Click Browse, select the R8C35A.io file, click Open, then OK Getting Started with Renesas Development Tools Page 33 of 35

Step 9.36 Click OK The IO window will now be loaded with the SFR registers as defined for the device. You can expand these registers to show individual bits and modify the contents. A picture with some expansion is shown below. This is the end of the lab! Getting Started with Renesas Development Tools Page 34 of 35

Answer Sheet Questions: 1) What information is provided in the Map Symbol Information view? Questions: 2) What programs were used to open the text file and hardware manual(s)? Questions: 3) Can you list some of the other tool chains installed within HEW Questions: 4) Does removing a file from the build delete it from the project directory? Questions: 5) What level of optimization is on by default in the NC30 compiler in this project? Questions: 6) Can you explain the difference between a session and a configuration? Questions: 7) What device are we connecting to for this lab session? Questions: 8) Can you explain the difference between the two breakpoint types used in this lab? Getting Started with Renesas Development Tools Page 35 of 35