Top Banner
Introduction Purpose • This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development environment using the KPIT GNU toolchain and the Renesas E10A-USB emulator. Objectives • Learn how to create a new project and make linker settings. • Understand how to configure the debug platform and connect to the target system. • Learn the process of debugging a typical application with the E10A-USB emulator. Content • 38 pages • 3 questions Learning Time • 50 minutes
41

Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Dec 24, 2015

Download

Documents

Bertha Blair
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Introduction

Purpose • This training course covers debugging an application on an SH

target in the Renesas HEW (High-performance Embedded Workshop) development environment using the KPIT GNU toolchain and the Renesas E10A-USB emulator.

Objectives • Learn how to create a new project and make linker settings.

• Understand how to configure the debug platform and connect to the target system.

• Learn the process of debugging a typical application with the E10A-USB emulator.

Content• 38 pages • 3 questions

Learning Time• 50 minutes

Page 2: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Prerequisites for Debugging

*HEW must be closed and the target disconnected

from the host when the emulator software is installed.

Click each oval for more information .

Renesas E10A-USB emulator software is installed*

KPIT GNU toolchainfor SH target (integrated with HEW 4) is installed

Renesas HEW 4 IDE is installedhttp://www.kpitgnutools.com/showFileDesc.php?hidTcId=295&hidCatName=sc_KPIT_GNU_Tools

http://www.kpitgnutools.com/showFileDesc.php?hidTcId=299&hidCatName=sc_KPIT_GNU_Tools

Page 3: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

About the HEW IDE

• A powerful, yet easy-to-use software development solution that shortens system development time - Offers a familiar Graphical User Interface (GUI) that simplifies operations

- Eliminates the need to switch environments between coding and debugging operations, or between target devices

- Allows users to select right tool for each process and fully exploit the tool’s capabilities

- Provides many essential functions, including:• Project manager

• Setup “Wizard”

• Compiler interface

• Configurable build engine

• Editor

• Debugger

• and more

Free HEW courses are available at Renesas Interactive

E10A-USB Emulator

KPIT GNU toolchain

HEW

Click each oval for more information

Page 4: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

About the GNU Toolchain

• Proven, pre-built, binary tools that allow more time for application development

- Compiler source code, Binutils, Newlib, and a GDB source-level debugger that shows what is happening inside program as it executes

• Tested and optimized for Renesas targets

• Free and easy to use

• Available for Windows and Linux platforms

• Easy download and installation

• Integrated with Renesas’ proprietary tools

• Free technical support at dedicated web portal - GDB stubs, monitor programs, tutorials, documentation,

FAQs, and discussion forum

E10A-USB Emulator

KPIT GNU toolchain

HEW

Click each oval for more information

Page 5: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

About the E10A-USB Emulator

• Low-cost system develop-ment tool that connects to host PC via a USB port, and to SuperH device in target system via an on-chip JTAG interface

- Controlled from PC using HEW GUI

- Provides real-time debugging using dedicated circuitry in target microcontroller

- Offers debugging capabilities such as real-time trace, hardware breakpoints on data and address, 255 PC breakpoints, and saved record of last four branches

Connects to PC’s USB port

Emulator

Software is included on CD

Target board with target MCU

E10A-USB Emulator

KPIT GNU toolchain

HEW

Click each oval for more information

Page 6: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Getting Started

Click to launch HEW

1

34

5

2

HEW Features:• Configurable build engine

- Set up compiler, assembler and linker options

• Integrated text editor- Customize syntax coloring for improved legibility

• Build capabilities- Run tools directly within environment

• Integrated debugger- Build and debug in same application

• Version control

To launch HEW: • Click on HEW icon on desktop • Navigate from Start menu

Page 7: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a WorkspaceClick OKCreate a new project workspace

Page 8: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (1/13)

Enter Workspace name1

3 4 5Select CPU family Select KPIT GNUSH(ELF) toolchain Click OK

Enter Project name2Select application type

Page 9: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (2/13)

Click Next

Page 10: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (3/13)

Select CPU type

Select CPU Click Next

Page 11: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (4/13)

Click Next

Select Endian type Select options

Page 12: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Is the following statement true or false? Make your selection and then click Done.

“Files generated by the KPIT GNUSH toolchain must be modified before they can be linked to object files created with the Renesas compiler.”

True

False

Question

Done

Page 13: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (5/13)

Click Finish to complete workspace creation

Project Generator adds these files to your project

Page 14: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (6/13)

Click OK

Page 15: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Enter application code here

Creating a New Project (7/13)

Output window

Editor windowWorkspace window

Page 16: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (8/13)

Contains application program

(Code that controls eight LEDs on SH7780 target)

“main.c” file

Page 17: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (9/13)

Startup code for project

Startup program in “start.asm”. . .

• Initializes the stack pointer

• Initializes the microprocessor

• Puts the data section into RAM at the VMA

• Sets uninitialized global variables to zero

• Initializes global constructors (if it is CPP)

• Calls main function

“start.asm” file

Page 18: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (10/13)

Definitions of I/O registers

“iodefine.h” file

Page 19: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (11/13)

Hardware initialization code

“hwinit.c” file

Page 20: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (12/13)

Declarations of interrupt routines

“inthandler.h” file

Page 21: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Creating a New Project (13/13)

Definitions of interrupt routines

“inthandler.c” file

Page 22: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Question

Which of these statements correctly describe aspects of creating a new project in HEW using the KPIT GNU toolchain? Select all that apply and then click Done.

A. Because HEW is a configurable environment, you can select a GNU toolchain during new project creation and change your selection later in the project.

B. The Editor window lets you view code from project files listed in the Workspace Window.

C. A generated application’s main function resides in the “main.c” project file.

D. KPIT Cummins provides free technical support for HEW for KPIT GNU tools.

Done

Page 23: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Making Linker Settings

Click Build Click SectionsClick Linker to change the linker settings

Click OKModify addresses to match target memory map

SH7780 Hardware Manual

0x00000100 INTHandler0xA0000000 RSTHandler0xA8081100 .text0xA808FF00 .data0xA8081000 .vects0xE5011FE0 .stack

.init

.fini

.got

.rodataeh_frame_hdr

Page 24: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Configuring Debug Platform (1/3)

Ensure that there are no errors, no warnings

Select Debug sessionSelect Debug modeClick Build All

Page 25: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Configuring Debug Platform (2/3)Click Debug

Click Debug Settings Select Target as “SH-4A E10 USB SYSTEM (CPU SH-4A)”

Select Default Debug Format as “Elf/Dwarf2_KPIT”

Click Add

Select Format as ”Elf/Dwarf2_KPIT” Click Browse Select file and Click Open

Click OK

Page 26: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Configuring Debug Platform (3/3)

Click Options

Click AddBrowse to select the .hdc file

Select it and click Open

Click OK

Click OKClick Yes

Page 27: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Connecting to the Target (1/2)

Click Debug Click Connect

Select CPUClick OK Press the Reset button on the hardware and click OK

Page 28: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Connecting to the Target (2/2)

Page 29: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Downloading Module

Right-click on the .x file Click Download Module

Page 30: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Debugging the Application (1/10)

Double-click to insert breakpoint

Page 31: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Debugging the Application (2/10)

Click View Select CPU Select desired option

Page 32: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Debugging the Application (3/10)

Register window

Memory window

Page 33: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Debugging the Application (4/10)

Click View Click Symbol Select desired option

Page 34: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Debugging the Application (5/10)

Watch window

Page 35: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Debugging the Application (6/10)

Click Debug Click Run

Enter “_start”

Click Go

• Ensure that the runtime environment is initialized • Be aware of stack-frame status

Page 36: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Debugging the Application (7/10)

Program halts at Breakpoint

Page 37: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Debugging the Application (8/10)

Press F10 to step through your program

Page 38: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Debugging the Application (9/10)

Click Stop

You must halt program execution before the debugger can be disconnected.

Page 39: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Debugging the Application (10/10)

Click Disconnect

Page 40: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

Match each debug feature to the most appropriate explanation by dragging the letters on the left to the correct locations on the right. Click Done when you are finished.

Debug object files

Linker settingsB C

Done ResetShow

Solution

AInclude options for changing the addresses of text and data sections applicable to the target.

B

C Register window

Displays the modified values of the CPU registers after an instruction has been executed.

AContain all the information needed by the GNU compiler for debugging your C/C++ code.

D F10 key command DAllows you to step over a function when you are stepping through and debugging a program.

Question

Page 41: Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.

• Creating a new project

• Making linker settings

• Configuring the debug platform

• Connecting to the SH target system

• Debugging an application using HEW, the KPIT GNU toolchain, and the E10A-USB emulator

Course Summary

For more information, please visit our Web site:http://america.renesas.com