Code Composer
Studio V4
https://www.pantechsolutions.net/products/dsp-
dsc-boards/tms320c6745-tyro
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Agenda
• Introduction of CCS4
• Starting a new project
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Overview
• CCS 4 is the integrated development environment (IDE) for TI’s Digital Signal Processors
(DSP), microcontrollers and application processors.
• Source code editor
• Project environment
• Compiler
• Debugger
–Software (simulator)
–Hardware (emulator)
• Graph windows
• Image visualization
• Profiler
• Scripting capability
• Flash programmer
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
IDE: C/C++ Perspective
Project
view
Text
editor
Outline
view
Build
view
Problems
view
Perspectiv
e bar
Fast
view bar
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
IDE: Debug Perspective
Debug
view
Source
code editor
Register view /
watch view / etc
Graph
window
Memory
view
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Agenda
• Introduction of CCS4
• Starting a new project
• Compiling a project
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Starting a project
 Select the workspace
 Defines the location of your project
 Automatically saved on close
 Contains:
 Project settings
 Macros
 Views on close
 Other custom settings specific for YOUR
personal computer
 Can be changed later on
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
New Project Wizard
• New projects are created by using the “New Project
Wizard:
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
New Project Wizard
• This will allow to select:
–The project type
• Processor used: e.g. C6000, C2000, etc…
–The configurations
• Default are
– Debug
– Release
–Referenced projects (if any)
–The used C/C++ indexer
• Full
• Fast
• None
–Output type
–A default linker command file
–Various project settings
• Device variant
• Code Generation tools version
• Runtime Support Library
• Target content
• etc
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Adding Files
• There are two ways to add files to the project:
– Create a new source file
– Drop existing source files in the project directory
• All files in the directory of a project are automatically added to the project.
• Take care that you are not adding unwanted content!
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
C Language Symbols
• Files are automatically parsed and variables, declaration and definitions displayed.
These can be accessed from the outline view or from the project view
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Importing an Existing Project
• Accessed from
• You can import a single project or multiple projects in one step:
This will also give you the
opportunity to copy the
projects into your workspace
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Importing a CCS 3.3 Project
• The CCS 3.3 import wizard is called from:
• This will help you to import the existing project, but manual re-work might still be
required
– Change or add path names for library functions
• Note: CCS 3.1 and CCS 2.x projects cannot be imported automatically. They need to be
converted to a CCS 3.3 project first (using CCS 3.3)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Agenda
• Introduction of CCS4
• Starting a new project
• Building a project
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Compile Flow
• You can either write standard assembly directly, or it can be created by the compiler.
• Object files, created by the assembler, are linked together to create the executable output file
of the processor. The map file is an output report of the linker.
• The .out file can be loaded into your system by the debugger portion of CCS.
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Build Configurations
• By default, CCS includes two sets of build options:
– Debug
– Release
• Users can create any number of additional build configurations.
• Users can modify the settings of any pre-defined build option
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Build Options
• Build options are controlled by the “Properties” dialog
of the project:
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Compiler: Basic Options
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Compiler: Include Options
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Linker: Basic Options
Note:
The stack size field is empty by default, causing a linker warning during build (but the default size of
0x400 will be used). Also, the default linker command file does not include the stack settings, so you
need to set it here!
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Linker: File Search Path
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Linker: Linker Output
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Linker: Runtime Environment
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
CCS Build: General
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Finally, the Actual Build
There are a couple of ways to build the project:
– Use the menu bar:
– Use the drop-down menu:
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Build: The Differences
• Build Active Project
– Builds only the active project
– Compiles only new or changed files (incremental build)
• Rebuild Active Project
– Builds only the active project
– Compiles all files, independently of their state
• Build All
– Builds all projects in the workspace
• Rebuild All
– Rebuilds all projects in the workspace
• Build Project
– The same as “Build Active Project”
• Build Working Set
– Build a pre-defined set of projects
• Clean
– Cleans a defined set of projects
• Build Automatically
– Builds automatically once a changed file is saved
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Build: One Last Way
• Clicking will build the active project, switch to the debug perspective and load the
executable.
• This will work only if a valid target configuration is loaded.
• If CCS is already in the debug perspective, the project will be recompiled and the
executable loaded.
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
CCS Debug Options
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Debugging a Project
• Once all source files are added to the project and
all project settings are made, the project can be
debugged.
• But, before we can do that, a target description
(aka a target configuration is needed)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Creating the Target
Configuration
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Debugging a Program
Run (F8) / Run Low Power / Free Run
Halt program
Terminate debug session. This will switch back to the C/C++ perspective (CTRL+ALT+T)
Step into (F5)
Step over (F6)
Assembly step into
Assembly step over
Step return (F7)
Reset CPU (ALT+R) / Reset Emulator
Restart (ALT+F8)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
IDE: Debug Perspective
Debug
view
Source
code
editor
Register view /
watch view / etc
Graph
window
Memory
view
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Breakpoints
• Breakpoints can be set in two ways:
–Double clicking in the grey bar at the left side of
the file view
–Right-clicking on the line where the breakpoint
should be located and selecting “New
Breakpoint”
• Breakpoints can be viewed and manipulated
(and if needed added) in the “Breakpoint
View”
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Disassembly View
• Opened by selecting
“View  Disassembly
• Shows:
–Address
–Opcode
–Disassembly
• Can be customized
• Can be shown
–Always
–Only if no C-source code is available
• Can also be used to set breakpoints
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Watch Views
• Local variables are displayed automatically
• Other watch expressions can be added easily
• Expressions can be a global or a local variable or logical / arithmetic expressions using them (or
use it as a quick calculator)
• Additional watch views can be added and the display can be customized
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Memory View
• This view can be opened by
“View  Memory”
• Displays the contents of the memory at a certain
address
–If variables are used to set the address the ‘&’ operator
needs to be used unless the variable is an array.
• Memory contents can be displayed in several ways:
–Floating point
–Integer
–Hexadecimal (TI and C style)
–Binary
–Character
–8/16/32/40/64 bit
• The memory view also allows to save, load and fill
memory
• Several memory views can be open simultaneously
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Register View
• Opened from “View  Registers”
• One window will display all the register sets
• Multiple register windows can be opened at
any time
• Registers can be manipulated from this view
• Two different views are available:
–Tree (default)
–Grid (with a selectable number of grids)
• Registers can be copied individually or as
complete set
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Graph View
• Can be accessed from
Tools  Graph
• Time-Domain
–Single / Dual
• Different update modes:
–Manual
–Refresh on halt
–Continuous refresh
• Display can be customized
–Line style
–Grid
–etc.
• If in continuous refresh mode, the update interval can be set in the
local menu of the Watch View 
• Data can be exported
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Image Analyzer
• Can be accessed from
Tools  Image Analyzer
• Image Format
–RGB
–Bayer
–YUV
–Bitonal
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Sections
short m = 10;
short x = 2;
short b = 5;
main()
{
short y = 0;
y = m * x;
y = y + b;
printf("y=%d",y);
}
 Every C program
consists of different
parts called Sections
 All default section
names begin with "."
Let’s review the
list of compiler
sections…
Global Vars (.bss) Init Vals (.cinit)
Local Vars
(.stack)
Code
(.text)
Std C
I/O
(.cio)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
DDR2
C000_0000
FLASH
6000_0000
CS2
C6000
CPU
Internal
RAM
Where would
you place
each of these
sections?
Section Location Why
.text FLASH Must exist after reset
.cinit
.bss
.stack
.cio
Initialize
d
Memory
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Where would
you place
each of these
sections?
Section Location Why
.text FLASH Must exist after reset
.cinit FLASH Must exist after reset
.bss
.stack
.cio
DDR2
C000_0000
FLASH
6000_0000
CS2
C6000
CPU
Internal
RAM
Initialize
d
Memory
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Where would
you place
each of these
sections?
Section Location Why
.text FLASH Must exist after reset
.cinit FLASH Must exist after reset
.bss Internal Must be in RAM memory
.stack
.cio
DDR2
C000_0000
FLASH
6000_0000
CS2
C6000
CPU
Internal
RAM
Initialize
d
Memory
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Where would
you place
each of these
sections?
Section Location Why
.text FLASH Must exist after reset
.cinit FLASH Must exist after reset
.bss Internal Must be in RAM memory
.stack Internal Must be in RAM memory
.cio
DDR2
C000_0000
FLASH
6000_0000
CS2
C6000
CPU
Internal
RAM
Initialize
d
Memory
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Where would
you place
each of these
sections?
Section Location Why
.text FLASH Must exist after reset
.cinit FLASH Must exist after reset
.bss Internal Must be in RAM memory
.stack Internal Must be in RAM memory
.cio DDR2 Needs RAM, speed not critical
Initialize
d
Memory
Looking at all of the compiler generated sections ...
DDR2
C000_0000
FLASH
6000_0000
CS2
C6000
CPU
Internal
RAM
Initialize
d
Memory
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Compiler's Section Names
Section
Name Description Memory
Type
.text Code initialized
.switch Tables for switch instructions initialized
.const Global and static string literals initialized
.cinit Initial values for global/static vars initialized
.pinit Initial values for C++ constructors initialized
.bss Global and static variables uninitialized
.far Aggregates (arrays & structures) uninitialized
.stack Stack (local variables) uninitialized
.sysmem Memory for malloc fcns (heap) uninitialized
.cio Buffers for stdio functions uninitialized
Compiler's Section Names
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Linking
Linker
Linker.cmd
.map
.obj .out
 H/W Memory Description
• Name, location, length
• Ex: IRAM, origin = …, len = …
 S/W Sections
• Name, memory area to link to
• Ex: .far → IRAM
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Linker Command File
-l rts6400.lib
-stack 0x800
-heap 0x800
MEMORY {
IRAM: origin = 0x11800000, len = 0x40000
FLASH: origin = 0x64000000, len = 0x400000
DDR: origin = 0xC0000000, len = 0x8000000
}
SECTIONS {
.bss {} > IRAM
.far {} > IRAM
.text {} > DDR
.cinit {} > FLASH
}
LIBRARIES
STACK/HEAP SIZES
MEMORY AREAS
CODE/DATA SECTIONS
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
CCS GEL File
 The GEL script runs every time you connect to your target (C6748.gel).
 This script sets up the target environment:
• Mem Map • Core Freq
• DDR
• EMIF
• PINMUX
• PLL0
• PLL1
OnTargetConnect( )
{
Clear_Memory_Map();
Setup_Memory_Map();
Core_300MHz_mDDR_132MHz();
}
Setup_Memory_Map()
{
/* DSP */
GEL_MapAddStr( …); //DSP L2 ROM
GEL_MapAddStr( … ); //DSP l2 RAM
GEL_MapAddStr( … ); //DSP L1P RAM
Set_Core_300MHz();
Set_mDDR_132MHz();
Runs at “Connect To Target” .GEL Snippets
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Build Steps : CCS/Debug vs FLASH
CCS: Project / Build
file.out
CCS: File / Ld Pgm
CCS: Project / Build
file.out
SPIWriter.OUT
DDR2
AISgen
file.bin
AISgen.cfg
SPIWriter.cmd
L1, L2, L3
SPI Flash
DDR2
eXperimenters
Board
L1, L2, L3
Flash
C6748.gel
CCS forces
entry pt
to _c_int00
User specifies
Entry point
CCS FLASH
eXperimenters
Board
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Relationship Diagram-Graphical
Programming
• The relationship between MATLAB, CCS and a Texas
Instruments DSP is shown below:
RTDX - Real-Time Data Exchange
MATLAB
Code Composer Studio
(CCS)
Texas Instruments DSP
Embedded
Target for
Texas
Instruments
DSP
+ Real-Time
Workshop
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
RTDX Image Processing Example
• A bitmap
image file is
sent from PC
to the DSP.
• The output of
processing by
the DSP is
sent to the PC
display.
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
?
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
For more details
– www.pantechsolutions.net
– http://www.slideshare.net/pantechsolutions
– http://www.scribd.com/pantechsolutions
– http://www.youtube.com/pantechsolutions

Introduction to Code Composer Studio 4

  • 1.
  • 2.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Agenda • Introduction of CCS4 • Starting a new project
  • 3.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Overview • CCS 4 is the integrated development environment (IDE) for TI’s Digital Signal Processors (DSP), microcontrollers and application processors. • Source code editor • Project environment • Compiler • Debugger –Software (simulator) –Hardware (emulator) • Graph windows • Image visualization • Profiler • Scripting capability • Flash programmer
  • 4.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. IDE: C/C++ Perspective Project view Text editor Outline view Build view Problems view Perspectiv e bar Fast view bar
  • 5.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. IDE: Debug Perspective Debug view Source code editor Register view / watch view / etc Graph window Memory view
  • 6.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Agenda • Introduction of CCS4 • Starting a new project • Compiling a project
  • 7.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Starting a project  Select the workspace  Defines the location of your project  Automatically saved on close  Contains:  Project settings  Macros  Views on close  Other custom settings specific for YOUR personal computer  Can be changed later on
  • 8.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. New Project Wizard • New projects are created by using the “New Project Wizard:
  • 9.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. New Project Wizard • This will allow to select: –The project type • Processor used: e.g. C6000, C2000, etc… –The configurations • Default are – Debug – Release –Referenced projects (if any) –The used C/C++ indexer • Full • Fast • None –Output type –A default linker command file –Various project settings • Device variant • Code Generation tools version • Runtime Support Library • Target content • etc
  • 10.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Adding Files • There are two ways to add files to the project: – Create a new source file – Drop existing source files in the project directory • All files in the directory of a project are automatically added to the project. • Take care that you are not adding unwanted content!
  • 11.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. C Language Symbols • Files are automatically parsed and variables, declaration and definitions displayed. These can be accessed from the outline view or from the project view
  • 12.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Importing an Existing Project • Accessed from • You can import a single project or multiple projects in one step: This will also give you the opportunity to copy the projects into your workspace
  • 13.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Importing a CCS 3.3 Project • The CCS 3.3 import wizard is called from: • This will help you to import the existing project, but manual re-work might still be required – Change or add path names for library functions • Note: CCS 3.1 and CCS 2.x projects cannot be imported automatically. They need to be converted to a CCS 3.3 project first (using CCS 3.3)
  • 14.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Agenda • Introduction of CCS4 • Starting a new project • Building a project
  • 15.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Compile Flow • You can either write standard assembly directly, or it can be created by the compiler. • Object files, created by the assembler, are linked together to create the executable output file of the processor. The map file is an output report of the linker. • The .out file can be loaded into your system by the debugger portion of CCS.
  • 16.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Build Configurations • By default, CCS includes two sets of build options: – Debug – Release • Users can create any number of additional build configurations. • Users can modify the settings of any pre-defined build option
  • 17.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Build Options • Build options are controlled by the “Properties” dialog of the project:
  • 18.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Compiler: Basic Options
  • 19.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Compiler: Include Options
  • 20.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Linker: Basic Options Note: The stack size field is empty by default, causing a linker warning during build (but the default size of 0x400 will be used). Also, the default linker command file does not include the stack settings, so you need to set it here!
  • 21.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Linker: File Search Path
  • 22.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Linker: Linker Output
  • 23.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Linker: Runtime Environment
  • 24.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. CCS Build: General
  • 25.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Finally, the Actual Build There are a couple of ways to build the project: – Use the menu bar: – Use the drop-down menu:
  • 26.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Build: The Differences • Build Active Project – Builds only the active project – Compiles only new or changed files (incremental build) • Rebuild Active Project – Builds only the active project – Compiles all files, independently of their state • Build All – Builds all projects in the workspace • Rebuild All – Rebuilds all projects in the workspace • Build Project – The same as “Build Active Project” • Build Working Set – Build a pre-defined set of projects • Clean – Cleans a defined set of projects • Build Automatically – Builds automatically once a changed file is saved
  • 27.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Build: One Last Way • Clicking will build the active project, switch to the debug perspective and load the executable. • This will work only if a valid target configuration is loaded. • If CCS is already in the debug perspective, the project will be recompiled and the executable loaded.
  • 28.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. CCS Debug Options
  • 29.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Debugging a Project • Once all source files are added to the project and all project settings are made, the project can be debugged. • But, before we can do that, a target description (aka a target configuration is needed)
  • 30.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Creating the Target Configuration
  • 31.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Debugging a Program Run (F8) / Run Low Power / Free Run Halt program Terminate debug session. This will switch back to the C/C++ perspective (CTRL+ALT+T) Step into (F5) Step over (F6) Assembly step into Assembly step over Step return (F7) Reset CPU (ALT+R) / Reset Emulator Restart (ALT+F8)
  • 32.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. IDE: Debug Perspective Debug view Source code editor Register view / watch view / etc Graph window Memory view
  • 33.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Breakpoints • Breakpoints can be set in two ways: –Double clicking in the grey bar at the left side of the file view –Right-clicking on the line where the breakpoint should be located and selecting “New Breakpoint” • Breakpoints can be viewed and manipulated (and if needed added) in the “Breakpoint View”
  • 34.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Disassembly View • Opened by selecting “View  Disassembly • Shows: –Address –Opcode –Disassembly • Can be customized • Can be shown –Always –Only if no C-source code is available • Can also be used to set breakpoints
  • 35.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Watch Views • Local variables are displayed automatically • Other watch expressions can be added easily • Expressions can be a global or a local variable or logical / arithmetic expressions using them (or use it as a quick calculator) • Additional watch views can be added and the display can be customized
  • 36.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Memory View • This view can be opened by “View  Memory” • Displays the contents of the memory at a certain address –If variables are used to set the address the ‘&’ operator needs to be used unless the variable is an array. • Memory contents can be displayed in several ways: –Floating point –Integer –Hexadecimal (TI and C style) –Binary –Character –8/16/32/40/64 bit • The memory view also allows to save, load and fill memory • Several memory views can be open simultaneously
  • 37.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Register View • Opened from “View  Registers” • One window will display all the register sets • Multiple register windows can be opened at any time • Registers can be manipulated from this view • Two different views are available: –Tree (default) –Grid (with a selectable number of grids) • Registers can be copied individually or as complete set
  • 38.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Graph View • Can be accessed from Tools  Graph • Time-Domain –Single / Dual • Different update modes: –Manual –Refresh on halt –Continuous refresh • Display can be customized –Line style –Grid –etc. • If in continuous refresh mode, the update interval can be set in the local menu of the Watch View  • Data can be exported
  • 39.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Image Analyzer • Can be accessed from Tools  Image Analyzer • Image Format –RGB –Bayer –YUV –Bitonal
  • 40.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Sections short m = 10; short x = 2; short b = 5; main() { short y = 0; y = m * x; y = y + b; printf("y=%d",y); }  Every C program consists of different parts called Sections  All default section names begin with "." Let’s review the list of compiler sections… Global Vars (.bss) Init Vals (.cinit) Local Vars (.stack) Code (.text) Std C I/O (.cio)
  • 41.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. DDR2 C000_0000 FLASH 6000_0000 CS2 C6000 CPU Internal RAM Where would you place each of these sections? Section Location Why .text FLASH Must exist after reset .cinit .bss .stack .cio Initialize d Memory
  • 42.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Where would you place each of these sections? Section Location Why .text FLASH Must exist after reset .cinit FLASH Must exist after reset .bss .stack .cio DDR2 C000_0000 FLASH 6000_0000 CS2 C6000 CPU Internal RAM Initialize d Memory
  • 43.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Where would you place each of these sections? Section Location Why .text FLASH Must exist after reset .cinit FLASH Must exist after reset .bss Internal Must be in RAM memory .stack .cio DDR2 C000_0000 FLASH 6000_0000 CS2 C6000 CPU Internal RAM Initialize d Memory
  • 44.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Where would you place each of these sections? Section Location Why .text FLASH Must exist after reset .cinit FLASH Must exist after reset .bss Internal Must be in RAM memory .stack Internal Must be in RAM memory .cio DDR2 C000_0000 FLASH 6000_0000 CS2 C6000 CPU Internal RAM Initialize d Memory
  • 45.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Where would you place each of these sections? Section Location Why .text FLASH Must exist after reset .cinit FLASH Must exist after reset .bss Internal Must be in RAM memory .stack Internal Must be in RAM memory .cio DDR2 Needs RAM, speed not critical Initialize d Memory Looking at all of the compiler generated sections ... DDR2 C000_0000 FLASH 6000_0000 CS2 C6000 CPU Internal RAM Initialize d Memory
  • 46.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Compiler's Section Names Section Name Description Memory Type .text Code initialized .switch Tables for switch instructions initialized .const Global and static string literals initialized .cinit Initial values for global/static vars initialized .pinit Initial values for C++ constructors initialized .bss Global and static variables uninitialized .far Aggregates (arrays & structures) uninitialized .stack Stack (local variables) uninitialized .sysmem Memory for malloc fcns (heap) uninitialized .cio Buffers for stdio functions uninitialized Compiler's Section Names
  • 47.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Linking Linker Linker.cmd .map .obj .out  H/W Memory Description • Name, location, length • Ex: IRAM, origin = …, len = …  S/W Sections • Name, memory area to link to • Ex: .far → IRAM
  • 48.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Linker Command File -l rts6400.lib -stack 0x800 -heap 0x800 MEMORY { IRAM: origin = 0x11800000, len = 0x40000 FLASH: origin = 0x64000000, len = 0x400000 DDR: origin = 0xC0000000, len = 0x8000000 } SECTIONS { .bss {} > IRAM .far {} > IRAM .text {} > DDR .cinit {} > FLASH } LIBRARIES STACK/HEAP SIZES MEMORY AREAS CODE/DATA SECTIONS
  • 49.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. CCS GEL File  The GEL script runs every time you connect to your target (C6748.gel).  This script sets up the target environment: • Mem Map • Core Freq • DDR • EMIF • PINMUX • PLL0 • PLL1 OnTargetConnect( ) { Clear_Memory_Map(); Setup_Memory_Map(); Core_300MHz_mDDR_132MHz(); } Setup_Memory_Map() { /* DSP */ GEL_MapAddStr( …); //DSP L2 ROM GEL_MapAddStr( … ); //DSP l2 RAM GEL_MapAddStr( … ); //DSP L1P RAM Set_Core_300MHz(); Set_mDDR_132MHz(); Runs at “Connect To Target” .GEL Snippets
  • 50.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Build Steps : CCS/Debug vs FLASH CCS: Project / Build file.out CCS: File / Ld Pgm CCS: Project / Build file.out SPIWriter.OUT DDR2 AISgen file.bin AISgen.cfg SPIWriter.cmd L1, L2, L3 SPI Flash DDR2 eXperimenters Board L1, L2, L3 Flash C6748.gel CCS forces entry pt to _c_int00 User specifies Entry point CCS FLASH eXperimenters Board
  • 51.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Relationship Diagram-Graphical Programming • The relationship between MATLAB, CCS and a Texas Instruments DSP is shown below: RTDX - Real-Time Data Exchange MATLAB Code Composer Studio (CCS) Texas Instruments DSP Embedded Target for Texas Instruments DSP + Real-Time Workshop
  • 52.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. RTDX Image Processing Example • A bitmap image file is sent from PC to the DSP. • The output of processing by the DSP is sent to the PC display.
  • 53.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. ?
  • 54.
    Technology beyond theDreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. For more details – www.pantechsolutions.net – http://www.slideshare.net/pantechsolutions – http://www.scribd.com/pantechsolutions – http://www.youtube.com/pantechsolutions

Editor's Notes

  • #5 A “Perspective” is a pre-defined set of editors and views A “View” is a way to navigate through the resources or other information
  • #47 Initialized and Uninitialized are better descriptors. Why, if your DSP is a slave to a host microprocessor, the DSP might only have RAM. The host would then have to pre-load the RAM with code (etc.) before it took the DSP out of reset.
  • #50 GEL stands for General Extension Language. It is a C-like scripting language that allows automating steps in CCS. In comments of the GEL statements we can see references to the cache, pin multiplexer, power domains, PLL, and external memory interface. All of these items are being configured behind the scenes when CCS connects to the target. The embedded target will not have CCS available to handle initialization. Previously, with the old HEX6x conversion tool the user would have had to write additional source code to handle the initialization that was done by CCS. The new hexAIS conversion tool allows the use of something called an Application Image Script that we will see later. This script replaces the GEL file and is executed by the boot loader program that is in the ROM of the DSP.