Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

1 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 SH simulator. Objectives Learn how to create a new project and what the compiler, assembler, and linker settings are and what they do. Understand how to configure the debug platform and allocate memory resources. Learn the process of downloading a module and debugging the source code with the SH Simulator. Content 41 pages 3 questions Learning Time 70 minutes

2 SH Simulator* KPIT GNU toolchain for SH target (integrated with HEW 4) Renesas HEW 4 IDE Prerequisites for Debugging HEW should be installed first, before the GNU toolchain Click each oval for more information

3 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 SH Simulator KPIT GNU toolchain HEW Click each oval for more information

4 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 SH Simulator KPIT GNU toolchain HEW Click each oval for more information

5 About the SH Simulator A simulator for SuperH RISC Engine family devices that enables the evaluation of software modules even without a hardware target - Uses HEW as the builder and debugger, for a consistent development environment - Provides extensive breakpoint functions (pseudo interrupt is available) - Supports ELF/DWARF object format, offers virtual interrupt and stack trace functions, and can optimize objects using information output by a profile function. Its - Implements debug function in helpful visual displays with images and waveforms. SH Simulator KPIT GNU toolchain HEW Click each oval for more information

6 Getting Started Click to launch HEW 1 3 4 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

7 Creating a Workspace Click OK Create a new project workspace

8 Enter Workspace name Creating a New Project (1/11) Use to add pre-compiled functions to the application 1 3 4 5 Select CPU family Select KPIT GNUSH(ELF) toolchain Click OK Select application type Enter Project name 2

9 Creating a New Project (2/11) Click Next

10 Creating a New Project (3/11) Click Next Select CPU type Select particular CPU

11 Creating a New Project (4/11) Click Next to continue Select Endian typeSelect options

12 Creating a New Project (5/11) Click Finish to complete workspace creation Project Generator adds these files to your project

13 Creating a New Project (6/11) Click OK

14 Creating a New Project (7/11) Enter application code hereOutput window Editor window Workspace window

15 Creating a New Project (8/11) Sample application code was added

16 Creating a New Project (9/11) Click to Add or Remove Files

17 Creating a New Project (10/11) Select Configure View Configure how file information is displayed in Workspace window

18 Creating a New Project (11/11) start.asm Initializes stack pointer Calls hardware initialization routines Initializes the global variables by copying the DATA section from ROM to RAM Zeroes-out the BSS section (Sets uninitialized global variables to zero) Initializes global constructors (if startup program is CPP) Calls main function Startup program: start.asm

19 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.After opening “main.c” in the Workspace window, you can add application code in the “main” function. D.KPIT Cummins provides free technical support for HEW for KPIT GNU tools. Done Question

20 Making Compiler Settings (1/3) Click Build Select Compiler Click Add to include directory Click Forward arrow Browse to select Directory Click OK to finish

21 Making Compiler Settings (2/3) Click Object tab Select Optimization level Select Debug Level Modify Object Directory location Expand tree view, if necessary Select Object Directory

22 Making Compiler Settings (3/3) Click to generate List file Click List tab Click OK Select options

23 Making Assembler Settings Click Build Select Assembler Click Object tab Select Debug Format Click OK

24 Making Linker Settings (1/2) Click Build Select Linker Click List tab By default, Generate map file option is checked

25 Making Linker Settings (2/2) Sections:.data contains static variables with initial values.bss contains static variables without initial values.rom contains character strings and constants.program contains programs.vector contains variable-vector area.fvector contains fixed-vector area Not generated by Compiler Click Sections tab Click to add new sections Modify addresses to match target memory map Click OK

26 Is the following statement true or false? Click Done when you are finished. “Object settings for the Compiler — which include the optimization level, debug level, and object directory — can be applied to individual files only.” True False Done Question

27 Configuring Debug Platform (1/4) Select Debug session to store debug settings Build completed Make sure that there are no errors Select Debug configuration Click Build All

28 Click Add Configuring Debug Platform (2/4) Click Debug Select Debug Settings Select SH2 Simulator Select Elf\Dwarf2_KPIT Click Add Select Elf\Dwarf2_KPIT Choose download options Browse to find download module

29 Configuring Debug Platform (3/4) Click OK

30 Configuring Debug Platform (4/4) Click Options tab Click OK Click Yes Select Download modules after build

31 Assigning Memory Resources (1/2) Click Build Select Linker Debug toolbar is added after connection to simulator Click OK Note address range for each section

32 Assigning Memory Resources (2/2) Click Options Select Memory Resource Enter the address range as per linker section settings Click OK

33 Downloading the Module (1/2) Select Debug > Download Module > sample.x These three operations download the “.x” file “Download Module” group only appears in Workspace window when a connection to a target has been established

34 Downloading the Module (2/2) Software Breakpoint area Source address column Line number View Source View Mixed Mode View Disassembly

35 Simulator Toolbar Reset CPU Go Go to cursor Reset Go Step In Step Over Step Out Halt Set PC to cursor Display PC Memory Resource Simulator System Debug Toolbar Function Keys Example: Press F5 key to execute user program from “reset vector” address Press F11 to step through the lines of the code Press F10 to step over a function

36 Debugging the Source Code (1/7) Click View Five categories for monitoring progress of debugging Choose desired window from list provided by selected category

37 Debugging the Source Code (2/7) Register window Output Window Memory Window I/O Window Editor WindowWorkspace Window

38 Debugging the Source Code (3/7) Click View Click Symbol Select Watch to view variable contents Watch Window

39 Debugging the Source Code (4/7) Double-click to insert Breakpoint

40 Debugging the Source Code (5/7) After Reset, press Go Click on Reset CPU

41 Debugging the Source Code (6/7) Click Step Execution halts at Breakpoint

42 Debugging the Source Code (7/7) Click View > Code > Event points Click to Add events PC breakpoints as events Event-point window Select break conditions

43 Redirecting Output Download sample tutorial at: http://www.kpitgnutools.com/Sample_Tutorials.html Click View > CPU > Simulated I/O Simulated I/O window

44 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 Memory window B C Done Reset Show Solution A Displays the current value of the memory and allows you to modify memory address and data fields. B C Register window Displays the modified values of the CPU registers after an instruction has been executed. A Contain all the information needed by the debugger for debugging your C/C++ code. D F10 key command D Allows you to step over a function when you are debugging a program. Question

45 Creating a new project Making Compiler, Assembler and Linker settings Configuring the debug platform Allocating memory resources Downloading a module Debugging an application using HEW, the KPIT GNU toolchain, and the SH simulator Course Summary For more information, please visit our Web site: http://america.renesas.com


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

Similar presentations


Ads by Google