Creating A Stand-Alone System

Slides:



Advertisements
Similar presentations
Chapter 9 Bootloader.
Advertisements

Part IV: Memory Management
Code Composer Department of Electrical and Computer Engineering
9.0 EMBEDDED SOFTWARE DEVELOPMENT TOOLS 9.1 Introduction Application programs are typically developed, compiled, and run on host system Embedded programs.
Boot Issues Processor comparison TigerSHARC multi-processor system Blackfin single-core.
CSS 372 Lecture 1 Course Overview: CSS 372 Web page Syllabus Lab Ettiquette Lab Report Format Review of CSS 371: Simple Computer Architecture Traps Interrupts.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 9 Bootloader. Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2002 Chapter 9, Slide 2 Learning Objectives  Need for a bootloader.
Chapter 7 Interupts DMA Channels Context Switching.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Midterm Wednesday 11/19 Overview: 25% First Midterm material - Number/character representation and conversion, number arithmetic - DeMorgan’s Law, Combinational.
Software Development and Software Loading in Embedded Systems.
Bit-DSP-MicrocontrollerTMS320F2812 Module 2 : Program Development Tools.
C6713 DSK Diagnostic Utility included with DSK....
DSP Getting Started Simon Sun 孙巍
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Getting Started With DSP A. What is DSP? B. Which TI DSP do I use? Highest performance C6000 Most power efficient C5000 Control optimized C2000 TMS320C6000™
Introduction Purpose Objectives Content Learning Time
Part 1 Using the ARM board And start working with C Tutorial 5 and 6
The 6713 DSP Starter Kit (DSK) is a low-cost platform which lets customers evaluate and develop applications for the Texas Instruments C67X DSP family.
Renesas Technology America Inc. 1 M16C/Tiny SKP Tutorial 2 Creating A New Project Using HEW4.
DSP/BIOS System Integration Workshop Copyright © 2004 Texas Instruments. All rights reserved. D SP TEXAS INSTRUMENTS TECHNOLOGY 1.
Computer Organization
System Calls 1.
Computer Maintenance Unit Subtitle: Basic Input/Output System (BIOS) Excerpted from 1 Copyright © Texas Education Agency, All.
Copyright © 2004 Texas Instruments. All rights reserved. T TO Technical Training Organization 1.Introduction 2.Real-Time System Design Considerations 3.Hardware.
Cisco Router Hardware Software overview. In this lecture we will investigate an overview of Cisco router hardware and software. We will first turn our.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
2003 Dominic Swayne1 Microsoft Disk Operating System and PC DOS CS-550-1: Operating Systems Fall 2003 Dominic Swayne.
TMS320C6000 DSP Optimization Workshop Chapter 10 Advanced Memory Management Copyright © 2005 Texas Instruments. All rights reserved. Technical Training.
1 Homework Reading –PAL pp , Continue mp1 –Questions? Continue lab sessions with your section.
DSP/BIOS System Integration Workshop Copyright © 2004 Texas Instruments. All rights reserved. T TO Technical Training Organization 1.Introduction 2.Real-Time.
Texas Instruments Incorporated Module 10 : Flash Programming C28x 32-Bit-Digital Signal Controller TMS320F2812.
Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)
1.4 Hardware Review. CPU  Fetch-decode-execute cycle 1. Fetch 2. Bump PC 3. Decode 4. Determine operand addr (if necessary) 5. Fetch operand from memory.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
Review of Computer System Organization. Computer Startup For a computer to start running when it is first powered up, it needs to execute an initial program.
Basic Memory Management Chapter 3 C6000 Integration Workshop Copyright © 2005 Texas Instruments. All rights reserved. Technical Training Organization T.
DSP C5000 Chapter 10 Understanding and Programming the Host Port Interface (EHPI) Copyright © 2003 Texas Instruments. All rights reserved.
Sem 2v2 Chapter 5 Router Startup and Setup. A router initializes by loading the bootstrap, the operating system, and a configuration file. If the router.
Computer Maintenance I
Recen progress R93088 李清新. Recent status – about hardware design Finishing the EPXA10 JPEG2000 project. Due to the DPRAM problem can’t be solved by me,
بسم الله الرحمن الرحيم MEMORY AND I/O.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the Project Generator function.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
Computer Basics.
Router Startup and Setup
Introduction of microprocessor
PRU-ICSS Programming with CCS
Software Development with uMPS
An Embedded Software Primer
Static Systems (GCONF, TCONF)
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
9.0 EMBEDDED SOFTWARE DEVELOPMENT TOOLS
Channel Sorting with the EDMA
Lecture Topics: 11/1 General Operating System Concepts Processes
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Router Startup and Setup
Chapter 9 Bootloader.
Lecture9: Embedded Network Operating System: cisco IOS
8051 ASSEMBLY LANGUAGE PROGRAMMING
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Computer System Laboratory
Lecture9: Embedded Network Operating System: cisco IOS
Presentation transcript:

Creating A Stand-Alone System Chapter 14 C6000 Integration Workshop T TO Technical Training Organization Copyright © 2005 Texas Instruments. All rights reserved.

Technical Training Organization Outline Flow of events in the system Programming Flash Flash Programming Procedure Debugging ROM’d code Lab T TO Technical Training Organization

Creating a Stand-alone System Flash RAM C6x CPU CCS Codec S D R A M S R A M . What is the flow of events from reset to main()? How do you create a stand-alone system? T TO Technical Training Organization

System Timeline Hardware Software Reset H/W Device Reset

Technical Training Organization Reset Reset RESET h/w status actions taken When RESET goes high, the following occurs: Sample endian pin Sample boot pins Many registers are initialized to default values (always a good idea to initialize them anyway) Peripherals are reset Cache: L1 on, L2 off Interrupts off T TO Technical Training Organization

System Timeline Hardware Software Reset H/W EDMA Device Reset Boot Loader

Technical Training Organization What is a Boot Loader? C6000 Src Dest “Boot loader” (EDMA) “slow” “fast” Host P Ext memory Int mem Ext mem In most systems, information must be moved before CPU execution begins. For example: It could be from slow, flash ROM to fast RAM Or, from the host memory to the DSP C6000 uses the EDMA for Memory-to-Memory transfers After boot, CPU always starts executing at address 0 T TO Technical Training Organization

C671x Boot L2 L2 CE0 CE1 CE2 CE3 0000_0000 reset ‘C671x CPU EDMA BOOT Pins RESET Boot Logic Host H P I CE0 CE1 1KBytes CE2 CE3 HD[4:3] Boot Modes 00 Host Boot (HPI) 01 8-bit ROM 10 16-bit ROM 11 32-bit ROM Mode 0: Host boots C671x via HPI Modes 1, 2, 3: Memory Copy EDMA copies from start of CE1 to 0x0 Uses default ROM timings After transfer, PC = 0x0 Bootloader copies 1K bytes Must always boot (No “no-boot” option)

C6713 DSK Boot Configuration User DIP Switches DSP C6713 DSK Config Switch 1 2 3 4 Configuration Little endian Big endian 8-bit EMIF boot from Flash HPI Boot (& EMU boot) 32-bit EMIF boot 16-bit EMIF boot HPI enabled (HPI pins) McASP1 enabled (HPI pins) DSK6713 flash is located at top of CE1 See more details in DSK help files T TO Technical Training Organization

C64x Boot L2 L2 0000_0000 reset ‘C64x CPU EDMA BOOT Pins RESET Boot Logic Host H P I C EMIFA CE0 CE1 CE2 CE3 EMIFB CE0 CE1 1KBytes CE2 CE3 BEA[19:18] Boot Modes 00 None 01 Host Boot (HPI/PCI) 10 EMIFB (8-bit) 11 Reserved Mode 0: No Boot bootmode; CPU starts at 0x0 Mode 1: Host boots C64x via HPI or PCI Mode 2: Memory Copy EDMA copies from start of EMIFB CE1 to 0x0 After transfer, PC = 0x0 Bootloader copies 1K bytes

C6416 DSK Boot Configuration User DIP Switches DSP 1 2 3 4 5 6 7 8 Configuration x Little endian* Big endian EMIFB boot from 8-bit Flash* No Boot Reserved Host Boot 1GHz CPU, 125MHz EMIFA* 720MHz CPU, 125MHz EMIFA 850MHz CPU, 125MHz EMIFA 500MHz CPU, 100MHz EMIFA 600MHz CPU, 100MHz EMIFA DSK6416 flash is located at EMIFB CE1 *By default, all switches set to 0 See more details in DSK help files

System Timeline Hardware Software Reset H/W EDMA boot.asm Device Reset Boot Loader 2nd Boot Loader No Boot or From EPROM or Via HPI Software begins running at address 0 (Reset Vector)

Technical Training Organization User Boot Code boot.asm Your 2nd Boot Loader should perform the following tasks: (Optional) Self-Test routine Configure the EMIF Copy section(s) of code/data Call _c_int00() Code size is limited to 1K bytes 1K memory can be reused using overlay (we do this in an optional lab) BOOT.ASM written in assembly (because it’s called before the C-environment is initialized) ; Configure EMIF ... ; Copy Initialized Sections mvkl FLASH, A0 mvkh FLASH, A0 mvkl IRAM, A1 ; Start Program */ b _c_int00(); T TO Technical Training Organization

System Timeline Hardware Software Reset H/W EDMA boot.asm Provided by TI Device Reset Boot Loader 2nd Boot Loader BIOS_init ( _c_int00 ) No Boot or From EPROM or Via HPI EMIF Self test Load remaining initialized sections Software begins running at address 0 (Reset Vector) When using “Boot Loader”, reset vector = address of boot.asm If “Boot Loader” is not used, then usually Reset Vector = BIOS_init().

Note: When using a .cdb file, reset vector defaults to _c_int00 BIOS_init (_c_int00) Initialize the C environment … Initialize C environment: Init global and static vars (copy .cinit  .bss ) Setup stack pointer (SP) and global pointer (DP) Initialize BIOS Create DSP/BIOS objects Bind IOM device drivers Set NMIE = 1 Call main( ) Initialize BIOS … and then call main() Note: When using a .cdb file, reset vector defaults to _c_int00 T TO Technical Training Organization

Same stuff we’ve been doing in our lab exercises System Timeline Hardware Software Reset H/W EDMA boot.asm Provided by TI main.c Device Reset Boot Loader 2nd Boot Loader BIOS_init ( _c_int00 ) System Init Code No Boot or From EPROM or Via HPI EMIF Self test Load remaining initialized sections Initialize: Stack Heap Globals Bind IOM devices Enable NMIE Initialize periph’s Enable indiv ints Return(); Same stuff we’ve been doing in our lab exercises Software begins running at address 0 (Reset Vector) When using “Boot Loader”, reset vector = boot.asm If “Boot Loader” is not used, then usually Reset Vector = BIOS_init().

System Timeline Hardware Software Reset H/W EDMA boot.asm Provided by TI main.c Device Reset Boot Loader 2nd Boot Loader BIOS_init ( _c_int00 ) System Init Code BIOS_start No Boot or From EPROM or Via HPI EMIF Self test Load remaining initialized sections Initialize: Stack Heap Globals Bind IOM devices Enable NMIE Initialize periph’s Enable indiv ints Return(); GIE = 1 Software begins running at address 0 (Reset Vector) When using “Boot Loader”, reset vector = boot.asm If “Boot Loader” is not used, then usually Reset Vector = BIOS_init().

Technical Training Organization System Timeline Hardware Software Reset H/W EDMA boot.asm Provided by TI main.c Device Reset Boot Loader 2nd Boot Loader BIOS_init ( _c_int00 ) System Init Code BIOS_start DSP/BIOS Scheduler Boot frm EPROM or Via HPI or No Boot EMIF Self test Load remaining initialized sections Initialize: Stack Heap Globals Bind IOM devices Enable NMIE Initialize periph’s Enable indiv ints Return(); GIE = 1 Runs IDL if no other threads are ready Software begins running at address 0 (Reset Vector) When using “Boot Loader”, reset vector = boot.asm If “Boot Loader” is not used, then usually Reset Vector = BIOS_init(). T TO Technical Training Organization

Technical Training Organization Outline Flow of events in the system Programming Flash Flash Programming Procedure Debugging ROM’d code Lab T TO Technical Training Organization

Technical Training Organization Non-Volatile Memory Non-volatile Options ROM EPROM FLASH Flash RAM C6000 CPU S D R A M R A M T TO Technical Training Organization How do you program a FLASH memory?

Flash Programming Options Method Description Target? Data I/O Industry-standard programmer Any FlashBurn CCS plug-in that writes to flash via JTAG (DSK, EVM, XDS) Any BSL Board support library commands such as flash_write() “On the fly” programming DSK Custom Target Specific User writes their own flash alg T TO Technical Training Organization How does FlashBurn work?

Flashburn CCS EPROM image file DSK DSP FBTC file L2 RAM Flash Flashburn plugin downloads and runs the FBTC file (FlashBurn Transfer Control) to establish continuous link between CCS & DSP. Choose “Erase Flash” to tell FBTC program running on DSP to erase the flash memory. Select “Program Flash” to stream the EPROM image file (.hex) down to the DSP. The FBTC program must be customized for whatever flash memory is on the target board (documentation is provided). Flash

Using FlashBurn Flashburn saves these settings to a .CDD file Flash Burn Transfer Controller (FBTC) When FBTC has been downloaded to DSP and is running, FlashBurn is “connected” to DSP

Technical Training Organization Outline Flow of events in the system Programming Flash Flash Programming Procedure Debugging ROM’d code Lab T TO Technical Training Organization

Technical Training Organization Debug Flow CCS Build app.out FileLoad Program… DSK L2 C6x CPU Flash SDRAM T TO Technical Training Organization

Technical Training Organization Flash Data Flow hex.cmd hex6x Build app.hex app.out app.cdd DSK RAM C6x CPU FlashBurn Flash T TO Technical Training Organization What is the procedure for creating a standalone system?

Flash/Boot Procedure 1 Plan out your system’s memory map – Before and After boot. Verify address for “top of Flash memory” in your system Plan for BOOT memory object 1KB in length Created for secondary boot-loader (boot.asm) Not absolutely required, but provides linker error if boot.asm becomes larger than 1KB Another big reason for BOOT MEM object is that if .hwi_vec is linked into a MEM object that contains address 0, it will be forced to zero. Since we don’t want this to be the case in this system, we must put .hwi_vec into anther MEM object, though, we still want it to be in fast, on-chip memory. All said and done, it’s easiest at this point to create an extra BOOT memory object.

Flash/Boot Procedure 1 Plan out your system’s memory map – Before and After boot. Verify address for “top of Flash memory” in your system Plan for BOOT memory object 1KB in length Created for secondary boot-loader (boot.asm) Not absolutely required, but provides linker error if boot.asm becomes larger than 1KB Note, when using the hardware boot, you do not have to relink your program with run/load addresses, HEX6x will take care of this for you (step #4) Another big reason for BOOT MEM object is that if .hwi_vec is linked into a MEM object that contains address 0, it will be forced to zero. Since we don’t want this to be the case in this system, we must put .hwi_vec into anther MEM object, though, we still want it to be in fast, on-chip memory. All said and done, it’s easiest at this point to create an extra BOOT memory object.

System Memory Map (load vs. run) Load-time Run-time BOOT “boot.asm” 0000_0000 IRAM init + uninit 0000_0400 SDRAM 8000_0000 9000_0000 9000_0400 0001_0000 9002_0000 B O O T FLASH “init sections” 0000_0000 0001_0000 8000_0000 9000_0000 FLASH “boot.asm” FLASH “initialized sections” 9000_0400 Another big reason for BOOT MEM object is that if .hwi_vec is linked into a MEM object that contains address 0, it will be forced to zero. Since we don’t want this to be the case in this system, we must put .hwi_vec into anther MEM object, though, we still want it to be in fast, on-chip memory. All said and done, it’s easiest at this point to create an extra BOOT memory object. 9002_0000 Boot-loader copies code/data from FLASH to IRAM/SDRAM When using the hardware boot, you do not have to relink your program with run/load addresses, HEX6x will take care of it for you Some code/data can still reside in flash T TO Technical Training Organization

Flash/Boot Procedure Plan out your system’s memory map – Before and After boot. 1 Modify .cdb, memory manager and do the following: Create necessary memory areas (e.g. BOOT) Direct the BIOS & compiler sections to their proper locations (when using the boot loader, these should be the runtime locations we have been using for all of our lab exercises) 2 Another big reason for BOOT MEM object is that if .hwi_vec is linked into a MEM object that contains address 0, it will be forced to zero. Since we don’t want this to be the case in this system, we must put .hwi_vec into anther MEM object, though, we still want it to be in fast, on-chip memory. All said and done, it’s easiest at this point to create an extra BOOT memory object.

Create Memory Objects (as needed) New Memories listed in our previous memory-maps Another big reason for BOOT MEM object is that if .hwi_vec is linked into a MEM object that contains address 0, it will be forced to zero. Since we don’t want this to be the case in this system, we must put .hwi_vec into anther MEM object, though, we still want it to be in fast, on-chip memory. All said and done, it’s easiest at this point to create an extra BOOT memory object. T TO Technical Training Organization

Flash/Boot Procedure Plan out your system’s memory map – Before and After boot. 1 Modify .cdb, memory manager and do the following: Create necessary memory areas (e.g. boot) Direct the BIOS & compiler sections to their proper locations 2 Create a user link.cmd file to specify boot.asm’s load/run addr 3

User Linker Command File (link.cmd) SECTIONS { .boot_load :> BOOT } T TO Technical Training Organization

Flash/Boot Procedure Plan out your system’s memory map – Before and After boot. 1 Modify .cdb, memory manager and do the following: Create necessary memory areas (e.g. boot) Direct the BIOS & compiler sections to their proper locations 2 Create a user link.cmd file to specify boot.asm’s load/run addr 3 4 Modify hex.cmd w/proper options Run hex6x to create .hex file Convert app.out to app.hex for Flash programming:

Hex Conversion Utility (hex6x.exe) hex.cmd app.hex ASCII-hex Tektronix Intel MCS-86 Motorola-S TI-tagged app.out hex6x Converts a “.out” file into one of several hex formats suitable for loading into an EPROM programmer. Use: hex6x filename.cmd Hex command file specifies options and filenames… T TO Technical Training Organization What does hex.cmd look like?

Hex Command File (lab14hex_6713.cmd) c:\iw6000\labs\lab14a\debug\lab.out -a -image -zero -memwidth 8 -map .\Debug\lab14hex.map -boot -bootorg 0x90000400 -bootsection .boot_load 0x90000000 ROMS { FLASH: org = 0x90000000, len = 0x0040000, romwidth = 8, files = {.\Debug\lab14.hex} } Source File Create ASCII image Creates a memory image (filling all loc’s) Reset addr origin to 0 for each output file Width of ROM memory (flash) Create a map file with this name Convert all initialized sect’s to bootable form Specify address for the bootloader table Name of bootload section and where it should be placed Description of ROM memories Name and location of output file (.hex) T TO Technical Training Organization Looking more closely at the ROM...

Technical Training Organization Hex6x - Boot Options If –e is not used to set the entry point, then it will default to the entry point indicated in the COFF object file. For more information on using Hex6x for building a boot image, please refer the the C6000 Assembly Language Tools Users Guide (SPRU186). T TO Technical Training Organization

Hex Command File (Flash ROM) c:\iw6000\labs\lab14a\debug\lab.out -a -image -zero -memwidth 8 -map .\Debug\lab14hex.map -boot -bootorg 0x90000400 -bootsection .boot_load 0x90000000 ROMS { FLASH: org = 0x90000000, len = 0x0040000, romwidth = 8, files = {.\Debug\lab14.hex} } Flash ROM 0x90000000 .boot_load (boot.asm) 0x90000400 COPY_TABLE Remaining Inititalized Sections 0x90040000 -boot Tells Hex6x to create the boot Copy Table -bootorg 0x90000400 Specifies address where symbol COPY_TABLE should reside -bootsection .boot_load 0x90000000 Name of section containing secondary boot loader and where it should go T TO Technical Training Organization Click here to see the COPY_TABLE

HEX6x Created Copy_Table .sect “.boot_load” mvkl mvkh COPY_TABLE, a3 ldw *a3++, entry copy_sect_top: *a3++, size *a3++, dest [!size] b copy_done copy_loop: ldb *a3++, data sub size,1,size [size] copy_loop copy_sect_top stb data,*dest++ copy_done: entry COPY_TABLE Entry Point Section 1 Size Section 1 Dest Section 1 Data Section 2 Size Section 2 Dest Section 2 Data Section N Size Section N Dest Section N Data 0x00000000 -bootorg 0x90000400 Specifies address where symbol COPY_TABLE should reside .text .cinit Above code is a pseudo representation of the boot.asm file. etc T TO Technical Training Organization In the map file this looks like...

Map file representation of COPY_TABLE lab14hex.map CONTENTS: 64000000..6400011f .boot_load 64000120..640003ff FILL = 00000000 64000400..6400af13 BOOT TABLE .hwi_vec : btad=64000400 dest=00003000 size=00000200 .sysinit : btad=6400060c dest=00003520 size=00000360 .trcdata : btad=64000974 dest=00002d68 size=0000000c .gblinit : btad=64000988 dest=00002d74 size=00000034 .cinit : btad=640009c4 dest=00003880 size=00001454 .pinit : btad=64001e20 dest=00002da8 size=0000000c .const : btad=64001e34 dest=00002db4 size=000000cf .text : btad=64001f0c dest=00004ce0 size=00003960 .bios : btad=64005874 dest=00008640 size=00003ee0 .stack : btad=6400975c dest=0000c520 size=00000400 .trace : btad=64009b64 dest=0000c920 size=00000200 .rtdx_text : btad=64009d6c dest=0000cf60 size=00000ee0 .args : btad=6400ac54 dest=00002fc0 size=00000004 .log : btad=6400ac60 dest=00002fc4 size=00000030 .LOG_system$buf : btad=6400ac98 dest=0000e300 size=00000100 .logTrace$buf : btad=6400ada0 dest=0000e400 size=00000100 .sts : btad=6400aea8 dest=0000e2a0 size=00000060 6400af14..6407ffff FILL = 00000000 By default, the HEX6x utility adds all “initialized” sections to the bootloader table T TO Technical Training Organization

Flash/Boot Procedure Plan out your system’s memory map – Before and After boot. 1 Modify .cdb, memory manager and do the following: Create necessary memory areas (e.g. boot) Direct the BIOS & compiler sections to their proper locations 2 Create a user link.cmd file to specify boot.asm’s load/run addr 3 4 Modify hex.cmd w/proper options Run hex6x to create .hex file Convert app.out to app.hex for Flash programming: 5 Start Flashburn and fill-in the blanks: hex cmd file hex image file FBTC file Origin & length of Flash

Using FlashBurn Flashburn saves these settings to a .CDD file Flash Burn Transfer Controller (FBTC) When FBTC has been downloaded to DSP and is running, FlashBurn is “connected” to DSP

Flash/Boot Procedure Plan out your system’s memory map – Before and After boot. 1 Modify .cdb, memory manager and do the following: Create necessary memory areas (e.g. boot) Direct the BIOS & compiler sections to their proper locations 2 Create a user link.cmd file to specify boot.asm’s load/run addr 3 4 Modify hex.cmd w/proper options Run hex6x to create .hex file Convert app.out to app.hex for Flash programming: 5 Start Flashburn and fill-in the blanks: hex cmd file hex image file FBTC file Origin & length of Flash Erase the FLASH 6 What if you want your image in the host's ROM? Program FLASH, run, and debug ROM code 7

Putting the DSP Image on the Host ofd6x Build app.xml app.out perl script Flash Host CPU Target System C6x DSP RAM appimage.c Use Object File Description (OFD6x) to create an XML description of the .out file Perl script uses XML to convert initialized sections from .OUT file into a C description of the program’s image For more info refer to Using OFD Utility to Create a DSP Boot Image (SPRAA64.PDF) T TO Technical Training Organization

Technical Training Organization Outline Flow of events in the system Programming Flash Flash Programming Procedure Debugging ROM’d code Lab T TO Technical Training Organization

Debugging Your Application If your application has problems booting up or operating after boot, how do you debug it? Problem: Standard breakpoints (aka Software Breakpoints) cannot be used with program code residing in ROM-like memory. When using software breakpoints, CCS replaces the ‘marked’ instruction with an emulation-halt instruction. This cannot be done in ROM-like memory. Solutions: Use Hardware breakpoints to help locate the problem. To debug ROM program, it’s especially important to put a H/W breakpoint at the start of your program, otherwise you won’t be able to halt the code in time to see what executing. Create a “stop condition” (infinite loop) in your boot code. When the code stops, open CCS and load the symbol table. T TO Technical Training Organization

Some Helpful Hints (that caught us) When you (try to) boot your application for the first time, your system may not work as expected. Here are a couple tips: A GEL file runs each time you invoke CCS. This routine performs a number of system initialization tasks (such as setting up the EMIF, etc.). These MUST now be done by your boot routine. Upon delivery, the DSK’s POST routine is located in its Flash memory and runs each time you power up the DSK. To perform its tests, it will initialize parts of the system (e.g. EMIF, codec, DMA, SP, etc). When you reprogram the Flash with your code (and boot routine), you will need to initialize any components that will be used. Bottom line, it’s easy to have your code working while in the “debug” mode we mentioned earlier, then have it stop working after Flashing the program. Often, this happens when some components don’t get initilized properly. T TO Technical Training Organization

Technical Training Organization Outline Flow of events in the system Programming Flash Flash Programming Procedure Debugging ROM’d code Lab T TO Technical Training Organization

Technical Training Organization LAB 14 ‘C6xxx DSK CCS FLASH C6x CPU Codec SDRAM RAM . Goal: Run application disconnected from CCS Requirements Convert application to hex format Burn FLASH with application/boot code Run from power-on RESET (debug if necessary) T TO Technical Training Organization

Technical Training Organization TTO ti T TO Technical Training Organization

Technical Training Organization System Timeline Loadtime Runtime Build CCS load program debug Hex6x Burn EPROM or make image for host Device Reset return(); to BIOS CPU reset main() my C init The bootloader is covered next asm init: (OPTIONAL) CPU self-test and possibly setup EMIF my C init: configure ints & system stuff using C code asm init The bootloader is covered next asm init: (OPTIONAL) CPU self-test and possibly setup EMIF compiler/BIOS init (boot.c) The bootloader is covered next Boot Loader T TO Technical Training Organization

2. CE1  CE0 P D Memory CE0 (16M) CE1 (4M) CE2 CE3 DMA 000_0000 reset 100_0000 CE1 (4M) D CPU 'C6x CE2 BOOTMODE[4:0] RESET CE3 BOOTMODE CE0 Memory Type n n 0 0 0 SDRAM - 4 8-bit devices n n 0 0 1 SDRAM - 2 16-bit devices n n 0 0 1 32-bit asynchronous n n 0 0 1 1/2 rate SBSRAM n n 0 0 1 1x rate SBSRAM nn for EPROM width: 01=8bit,10=16bit,11=32bit T TO Technical Training Organization

DSPINT (HPI interrupt) 4. Boot Using HPI CE0 CE1 P D 0 (or 1) CE2 CE3 DMA HPI uP P D CPU 'C6x BOOTMODE[4:0] RESET BOOTMODE Memory Map 0 0 1 1 0 Map 0 0 0 1 1 1 Map 1 How does ‘C6000 know to start? DSPINT (HPI interrupt) T TO Technical Training Organization

‘C6211 and ‘C6711 Bootmodes Always bootloads to internal RAM (L2) No “No Boot” bootmode (not needed for production)