PRU-ICSS Programming with CCS

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Getting started with MPLAB Launch MPLAB Set Toolbar as in the next slide by clicking the leftmost icon Open a new Source file by choosing [FILE][NEW] Type.
Introduction to HT-IDE3000 Micro-C development System Department.
Creating a Dialog-Based Comet Windows Program Brian Levantine.
Stored procedures and views You can see definitions for stored procedures and views in the demo databases but you can’t change them. For views, expand.
Code Composer Department of Electrical and Computer Engineering
Professional Toolkit V2.0 C:\Presentations - SmartCafe_Prof_V2.0 - bsc page 1 Professional Toolkit 2.0.
Creating and Editing a Web Page Using Inline Styles
Slide 1CPU Emulator Tutorial This program is part of the software suite that accompanies the book The Digital Core, by Noam Nisan and Shimon Schocken 2003,
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
U-Boot and Linux Kernel Debug using CCSv5
Lab6 – Debug Assembly Language Lab
LAB 9 Simulator Chap 14 REED. Datapath Simulator accompanying the text is a datapath simulator a.k.a. the Knob & Switch Computer developed by Grant Braught.
LAUNCHXL2-RM57L – Project 0
Using PDG with e2studio: Example
Author: Texas Instruments ®, Sitara™ ARM ® Processors Building Blocks for PRU Development Module 2 PRU Firmware Development This session covers how to.
1 Introduction to Programming Environment Using MetroWerks CodeWarrior and Palm Emulator.
Introduction Purpose Objectives Content Learning Time
Part 1 Using the ARM board And start working with C Tutorial 5 and 6
Chapter 2 Software Tools and Assembly Language Syntax.
TrendReader Standard 2 This generation of TrendReader Standard software utilizes the more familiar Windows format (“tree”) views of functions and file.
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
U-Boot Debug using CCSv5 In this session we will cover fundamentals necessary to use CCSv5 and a JTAG to debug a TI SDK-based U-Boot on an EVM platform.
CHAPTER 1 XNA Game Studio 4.0. Your First Project A computer game is not just a program—it is also lots of other bits and pieces that make playing the.
Renesas Technology America Inc. 1 M16C/Tiny SKP Tutorial 2 Creating A New Project Using HEW4.
MagicInfo Pro Server Software All control, content, and scheduling is performed within the MagicInfo Pro Server software previously installed. Before.
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
AT91SAM9261-EK WinCE 6.0 DEMO ATMEL AT91 Application & Support Group
P.1ECE 331, Prof. A. Mason Professor Andrew Mason Michigan State University Spring 2013 ECE 331: PC Lab 1: Using HC12 ASM Simulators.
IT 211 Project Integration and Deployment Lab #11.
AT91SAM9261-EK WinCE 5.0 DEMO ATMEL AT91 Application & Support Group Version 1.O February 2007.
ADAM2 Single Remocon MCU IDE User’s Manual S/W Integrated Development Environment - Assembler - Simulator - Code Wizard V1.0 Technical Sales Team, ETA.
® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications.
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
Active-HDL Interfaces Debugging C Code Course 10.
Project Deployment IT [211 CAP] How to convert your project to a full application.
UBI >> Contents Chapter 2 Software Development tools Code Composer Essentials v3: Code Debugging Texas Instruments Incorporated University of Beira Interior.
From Scratch: Open CCS Exit and restart CCS Click Browse to create a new workspace directory.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Development of a microprocessor project with LPC2388 development board.
Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)
SAM9260-EK WinCE DEMO AT91 SAM9 Product Group. Version 1.0 October 2006.
1 Installing Java on Your PC. Installing Java To develop Java programs on your PC: Install JDK (Java Development Kit) Add the directory where JDK was.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the Project Generator function.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
Programming and Debugging with the Dragon and JTAG Many thanks to Dr. James Hawthorne for evaluating the Dragon system and providing the core content for.
Workshop Setup The software/hardware used in this workshop are:
Development Environment
Programming and Debugging with the Dragon and JTAG
VAB™ for INFINITY Tutorial
Lab 1: Using NIOS II processor for code execution on FPGA
Use of MPLab software Paul Cockshott.
Getting Eclipse for C/C++ Development
This presentation is not meant to be a reference.
T_C_N_L_G_ E D I D I E O Y O H I E B J I R E A A W.
CENG2400 Tutorial 1 Keil IDE CENG2400 tutorial 1 v.7a.
Objectives Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event.
MicroEconomix 1500 RSLogix 500 LAB#2
DEMO Presentation Prepared by: Bashir SADEGHI Supervised by: Dr
CPU Emulator Tutorial This program is part of the software suite
Software Setup & Validation
DAT2343 LMC Simulator Usage © Alan T. Pinck / Algonquin College; 2003.
Computer System Laboratory
Planning a Group Policy Management and Implementation Strategy
Code Composer Essentials 3.0
Getting Eclipse for C/C++ Development
Shelly Cashman: Microsoft Windows 10
Embedded Development Tools
Presentation transcript:

PRU-ICSS Programming with CCS CCS PRU Compiler Tools introduction

PRU-ICSS Compiler History Development cycle before PRU Compiler support for CCS v6.x Notepad++ to edit PRU source code (with keyword highlight extension) PASM.exe to translate the source code to PRU binary (.h, .bin) CCS was used to download binary into PRU cores no source code view debugging, only “raw” assembler Breakpoint and single step debugging is possible Note that few PRU examples are based on PASM

PRU Compiler support with CCS CCSv6.0 (and newer) adds PRU compiler support write code, assemble program and download firmware to PRU directly with CCS source code view debug, single step, break point, register view, memory view, ... New PRU code development examples and TI designs are based on CCS PRU compiler For new project, use CCS PRU compiler Install PRU Compiler during CCS installation via checkbox or install later on via the CCS App Center Note PRU compiler supports C programming, but it is not used for real-time application programming Use assembler language for MII_RT programming

Instruction mnemonics: PASM to CCS PRU compiler The syntax for instruction mnemonics is very similar to the existing PASM assembler. Exceptions are listed here: MOV instruction MOV is only supported for register to register moves. The LDI instruction must be used to load a literal into a register. LDI instruction LDI can only be used to load a 16-bit constant into a register. To load a 32-bit constant, you must use the LDI32 instruction. Operands with a '&' prefix The existing PASM assembler accepts operands with or without the & symbol: LBBO &r0 or LBBO r0. The assembler in this release requires the & for these operands. Comments PRU Compiler uses ‘;’ PARM uses ‘//’ #define  .set struct

How to create new PRU project with CCSv6 Select: File->New->CCS Project Select Target: ICE_AM3359 Select PRU tab Fill in Project Name Project template and examples: choose Empty Assembly-only Project Press Finish

How to create a target configuration You must choose the correct configuration for CCS to include the PRU debug capabilities The target configuration depends on: Target, Board and JTAG emulator Example shows config for: - AM3359 ICE board - on-board USB XDS100v2 JTAG emulator To create a new target configuration: Open CCS Click on File > New > Target Configuration File CCS will open a New Target Configuration window, in this window: Type the desired filename for the target configuration (like NewTargetConfiguration.ccxml)

How to create a target configuration In the main screen, CCS will open a “New Target Configuration” tab In the Connection menu, choose the correct emulator you plan to use. The debug tools do not apply to the simulator. In the Device box, choose AM3359 from the options. Click on the Advanced tab (1) Select the emulator (2) Select AM3359 as the device (3) Click Advanced tab

How to create a target configuration In the Advanced tab, select the M3_wakeupSS_0 Click Bypass – this will clean up the view later on in the Debug View Select CortexA8 (4) Select M3_wakeupSS_0 (5) Select Bypass (6) Select CortexA8

How to create a target configuration Select the board specific GEL initialization script; eg. for ICE Browse to <IA_SDK_HOME>sdk\tools\gel\ICE\TMDXICE3359.gel Select Texas Instruments XDS100v2 USB Emulator_0 (8) Select Texas Instruments XDS100v2 (7) Select GEL script

How to create a target configuration In The JTAG TCLK Frequency (MHz), select Fixed with user specified faster value Enter 15.0MHz Click on the Save button (9) Select Fixed with user specified faster value (10) Enter 15.0MHz (11) Save the configuration

Add PRU-enable support to GEL script PRU-ICSS subsystem is in power down state after board power-up ARM program or GEL script can power-up PRU-ICSS Example to use GEL script to power-up PRU-ICSS Download AM335x_PRU_ICSS.gel from https://github.com/beagleboard/am335x_pru_package/tree/master/Documentation Copy AM335x_PRU_ICSS.gel to sdk\tools\gel\AM335x Open file TMDXICE3359_v2_1A.gel Add the following lines at the end of the file StartUp() { GEL_LoadGel("$(GEL_file_dir)/AM335x_PRU_ICSS.gel"); }

Creating an new Assembler program Right-click MyPruProject select New->File write to File name field: pru_example.asm press Finish Copy&paste the following code ;lab01.asm ;Arithmetics .retain ; Required for building .out with assembly file .retainrefs ; Required for building .out with assembly file .global main .sect ".text" main: ZERO &R0, 4 ; Set R0 and R1 to zero LDI R0, 0x3317 ; Initialization LDI R1, 0x4321 ; Initialization ADD R0, R0, 10 ; Add 10 to R0, result in R0 RSB R0, R0, R1 ; R0 = R1 - R0 ADD R2, R0.b1, R1.w1 HALT Save file

Preparing Linker Command file Copy the linker command file pru.cmd file into the MyPruProject folder Right-click the project properties Select CCS Build -> PRU Linker -> Advanced Options -> Symbol management Add ‘main’ to Specify program entry point for the output module Build the project

How to connect to a target PRU Start a debug session View > Target Configuration Right click the target configuration file, select Launch Selected Configuration CCS will connect to the target The Debug window will now show 3 disconnected targets The CortexA8 core The PRU0 core The PRU1 core PRU0 core PRU1 core

How to connect to a target PRU Connect to CortexA8: Select the Disconnected CortexA8 Device and either Right-click and the select Connect Target, or Use Run > Connect Target CCS will connect to the CortexA8 and the Register, Disassembly and Memory windows will populate. GEL script: The OnTargetConnect() portion will run while CCS connects

How to connect to a target PRU Reset the CortexA8 by performing a CPU Reset (HW) Run the AM335x System Initialization script

How to connect to a target PRU Run the PRU_ICSS _Init script Select the disconnected PRU core and either Right-click and then select Connect Target or use Run > Connect Target CCS will connect to the PRU core and the Register, Disassembly and Memory window will populate

The Register Window When one of the connected PRUs is selected in the Debug Window, the Registers Window will show the Core Registers and Debug Registers for that PRU. You can expand and hide the Core and Debug registers in groups. You can modify values directly in the register window by double-clicking on the value and entering the new value

The Memory Window Memory Selection: Program Data PRU Device Memory Address Selection: Enter text or use menu for recently used values Save, Load or Fill Memory Data Display Style Double-click on a memory location to modify it directly

Loading a PRU Binary (executable file) To load a PRU binary (.out) is the same as loading a ARM binary (.out) Go to the Run -> Load -> Load Program Select Browse Project button Select MyPruProject -> Debug -> MyPruProject.out Press OK (2x) The binary is now loaded. The program counter (PC) has stopped at HALT You can set a breakpoint at send command and restart the program to force breakpoint at start of program)

Execution Control – Run, Halt, Single-Step To Run/Halt, with the PRU selected Click the RUN button in the Debug window, or Click Target > Run The PRU code will run until it is halted or executes a HALT instruction To single-step through code, use any of the single step controls. Step-Into, Step-Over, Assembly Step-Into, Assembly Step-Over all have identical functions on the PRU

Execution Control – Breakpoint Control You can set/clear breakpoints by double-clicking in the bar to the left of the address in the disassembly window. You can also view/control PRU breakpoints by using View > Breakpoints

Execution Control Screenshot

Example: Enable PRU cycle counter In Register view, select the PRU0_CTRL->CTRL register Expand the CRTL register Set CTR_EN to 1

Example: PRU cycle counter Example 1: Execute Single-Step and observe CYCLECNT register CYCLECNT show the amount of cycles required to execute one assembler instruction Example 2: Execute Run > Resume, if there is no breakpoint or HALT command press Suspend and observe CYCLECNT and STALLCNT registers STALLCNT shows the amount of cycles the PRU had waited; this results from memory access

Labs Import the CCS_Labs via Import dialog Follow the Word file instructions