10 - 1 Texas Instruments Incorporated Module 10 : Flash Programming C28x 32-Bit-Digital Signal Controller TMS320F2812.

Slides:



Advertisements
Similar presentations
KeyStone Training More About Cache. XMC – External Memory Controller The XMC is responsible for the following: 1.Address extension/translation 2.Memory.
Advertisements

MC68HC11 System Overview. System block diagram (A8 version)
Processor System Architecture
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Computer System Overview
Texas Instruments Incorporated Module 13 : C28x BOOT – ROM 32-Bit-Digital Signal Controller TMS320F2812.
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.
Exception Processing ECE511: Digital System & Microprocessor.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Fuses and Lock Bits The ATMega128 has several special memory areas -Six lock bits which determine program memory features. -Three fuse bytes which determine.
OS Spring’03 Introduction Operating Systems Spring 2003.
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.
CSS 372 Oct 2 nd - Lecture 2 Review of CSS 371: Simple Computer Architecture Chapter 3 – Connecting Computer Components with Buses Typical Bus Structure.
CCNA 2 v3.1 Module 2.
F281x Boot-SCIA Flash Programming Jeff Stafford Application Report.
NS Training Hardware. System Controller Module.
Bit-DSP-MicrocontrollerTMS320F2812 Module 2 : Program Development Tools.
CH12 CPU Structure and Function
3-1 System peripherals & Bus Structure Memory map of the LPC2300 device is one contiguous 32-bit address range. However, the device itself is made up of.
1 © 2002, Cisco Systems, Inc. All rights reserved. Router boot procedure.
Atmega32 Architectural Overview
NET+OS 6.1 Training. BSP NET+OS 6.1 BSP Initialization Memory map New features Debugging Porting Issues.
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
LPC2148 Programming Using BLUEBOARD
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
1-1 NET+OS Software Group Flash API Multiple flash memory bank support New Flash API introduction Detailed Flash API Function presentation Supporting.
Renesas Technology America, Inc. Flash!. CPU Rewrite CPU-rewrite is a term that refers to an Renesas MCU’s ability to erase/program its own internal Flash.
Class ID: Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Implementing Bootloaders on Renesas MCUs.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
RL78 Code & Dataflash.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
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 - 1 Digital Signal Controller TMS320F2812 Module 1 : Architecture.
AT91 Memory Interface. 2 Features –Up to 8 programmable chip select lines –Remap Command allows dynamic exception vectors –Glue-less for both 8-bit and.
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.
32-Bit-Digital Signal Controller Texas Instruments Incorporated
4 - 1 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH) Module 4 : Interrupt System C28x 32-Bit-Digital.
System Integration Module MTT Motoola SYSTEM INTEGRATION MODULE (SIM)
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course explains how to use section setting and memory.
AT91 C-startup. 2 For reasons of modularity and portability most application code for an embedded application is written in C The application entry point.
Proposal for an Open Source Flash Failure Analysis Platform (FLAP) By Michael Tomer, Cory Shirts, SzeHsiang Harper, Jake Johns
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
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.
Renesas Electronics America Inc. © 2011 Renesas Electronics America Inc. All rights reserved. RX Bus State Controller (BSC) Ver
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.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Capability of processor determine the capability of the computer system. Therefore, processor is the key element or heart of a computer system. Other.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the Project Generator function.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
Bootloaders Many embedded processors have flash memory. This allows us to alter a product even though it is in the users hands: -fix bugs -upgrade or enhance.
10- Lock Bits, Fuse Bits and Boot Loader. Boot Loader Support – Read-While-Write Self- Programming: The Boot Loader Support provides a real Read-While-Write.
Introduction to Operating Systems Concepts
Bootloaders Many embedded processors have flash memory. This allows us to alter a product even though it is in the users hands: -fix bugs -upgrade or.
Atmega32 Architectural Overview
Interrupts and signals
Refer to Chapter 5 in the reference book
Lecture 15 PicoBlaze Overview
Introduction of microprocessor
Lecture 14 PicoBlaze Overview
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
Lecture 16 PicoBlaze Overview
AT91 Memory Interface This training module describes the External Bus Interface (EBI), which generatesthe signals that control the access to the external.
Computer Organization
Lecture9: Embedded Network Operating System: cisco IOS
Lecture9: Embedded Network Operating System: cisco IOS
Presentation transcript:

Texas Instruments Incorporated Module 10 : Flash Programming C28x 32-Bit-Digital Signal Controller TMS320F2812

BIOS Startup Sequence from Flash Memory H0 SARAM (8K) 0x3F 7FF6 0x3D x3F x3F F000 0x3F FFC0 Boot ROM (4K) BROM vector (32) 0x3F FC00 Boot Code RESET 0x3F FC00 {SCAN GPIO} FLASH (128K) Passwords (8) _c_int00 LB C – start routine “rts2800_ml.lib” “user” code sections _c_int00 Boot.asm main ( ) { …… …… return; return; }

TMS320F2812 Flash Memory Map Data & Program Space Address Range 0x3D 8000 – 0x3D 9FFF 0x3D A000 – 0x3D BFFF 0x3D C000 – 0x3D FFFF 0x3E 0000 – 0x3E 3FFF 0x3E 4000 – 0x3E 7FFF 0x3E 8000 – 0x3E BFFF 0x3E C000 – 0x3E FFFF 0x3F 0000 – 0x3F 3FFF 0x3F 4000 – 0x3F 5FFF 0x3F 6000 – 0x3F 7F7F 0x3F 7F80 – 0x3F 7FF5 0x3F 7FF6 – 0x3F 7FF7 0x3F 7FF8 – 0x3F 7FFF Sector J ; 8K x 16 Sector I ; 8K x 16 Sector H : 16K x 16 Sector G ; 16K x 16 Sector F ; 16K x 16 Sector E ; 16K x 16 Sector D; 16K x 16 Sector C ; 16K x 16 Sector B ; 8K x16 Sector A ; (8K-128) x16 Program to 0x0000 when using Code Security Mode ! Flash Entry Point ; 2 x 16 Security Password ; 8 x 16

Basic Flash Operation  Flash is arranged in pages of 128 addresses  Wait states are specified for consecutive accesses within a page, and random accesses across pages  OTP has random access only  Must specify the number of SYSCLKOUT wait-states  Reset defaults are maximum values !  Flash configuration code must not run from Flash memory ! 0x00 0A86 RANDWAIT reserved PAGEWAIT reserved x00 0A87 OTPWAIT reserved *** Refer to the F281x datasheet for detailed numbers *** For 150 MHz, PAGEWAIT = 5, RANDWAIT = 5, OTPWAIT = 8 For 135 MHz, PAGEWAIT = 4, RANDWAIT = 4, OTPWAIT = 8

or 32 dispatched 1664 Aligned 64-bit fetch 2-level deep fetch buffer 64 C28x Core decoder unit Speeding Up Code Execution in Flash: Flash Pipelining (for code fetch only) Flash Pipeline Enable 0 = disable (default) 1 = enable ENPIPE reserved x00 0A80

Other Flash Configuration Registers AddressNameDescription 0x00 0A80FOPTFlash option register 0x00 0A82FPWRFlash power modes registers 0x00 0A83FSTATUSFlash status register 0x00 0A84FSTDBYWAITFlash sleep to standby wait register 0x00 0A85FACTIVEWAITFlash standby to active wait register 0x00 0A86FBANKWAITFlash read access wait state register 0x00 0A87FOTPWAITOTP read access wait state register  FPWR: Save power by putting Flash/OTP to ‘Sleep’ or ‘Standby’ mode; Flash will automatically enter active mode if a Flash/OTP access is made  FSTATUS: Various status bits (e.g. PWR mode)  FSTDBYWAIT: Specify number of cycles to wait during wake-up from sleep to standby  FACTIVEWAIT: Specify number of cycles to wait during wake-up from standby to active Defaults for these registers are often sufficient – See “TMS320F28x DSP System Control and Interrupts Reference Guide,” SPRU078, for more information

F28x DSP FLASH CPU RAM Flash Programming Basics  The DSP CPU itself performs the flash programming  The CPU executes Flash utility code from RAM that reads the Flash data and writes it into the Flash  We need to get the Flash utility code and the Flash data into RAM JTAGEmulator SPI GPIO SCI RS232 ROMBootloader Flash utility code Flash Data

Flash Programming Basics  Sequence of steps for Flash programming:  Minimum Erase size is a sector  Minimum Program size is a bit!  Important not to lose power during erase step: If CSM passwords happen to be all zeros, the CSM will be permanently locked!  Chance of this happening is quite small! (Erase step is performed sector by sector) 1. Erase- Set all bits to zero, then to one 2.Program- Program selected bits with zero 3.Verify- Verify flash contents Algorithm Function

Flash Programming Utilities  Code Composer Studio Plug-in (uses JTAG) *  Serial Flash loader from TI (uses SCI boot) *  Gang Programmers (use GPIO boot)  BP Micro programmer  Data I/O programmer  Build your own custom utility  Use a different ROM bootloader method than SCI  Embed flash programming into your application  Flash API algorithms provided by TI * Available from TI web at

Code Composer Studio Flash Plug-In

Code Security Module (CSM)  Data reads and writes from restricted memory are only allowed for code running from restricted memory  All other data read/write accesses are blocked: JTAG emulator/debugger, ROM bootloader, code running in external memory or unrestricted internal memory  Access to the following on-chip memory is restricted: LO SARAM (4K) L1 SARAM (4K) OTP (1K) FLASH (128K) reserved 0x x x3D x3D 8000 reserved 0x00 A000 0x3D 7C00

CSM Password  128-bit user defined password is stored in Flash  128-bit Key Register used to lock and unlock the device  Mapped in memory space 0x00 0AE0 – 0x00 0AE7  Register “EALLOW” protected 0x3F 7FF8 - 0x3F 7FFF CSM Password Locations (PWL) LO SARAM (4K) L1 SARAM (4K) OTP (1K) FLASH (128K) reserved 0x x x3D x3D 8000 reserved 128-Bit Password 0x00 A000 0x3D 7C00

CSM Registers Address Name Reset ValueDescription 0x00 0AE0 KEY0 0xFFFFLow word of 128-bit Key register 0x00 0AE1 KEY1 0xFFFF2 nd word of 128-bit Key register 0x00 0AE2 KEY2 0xFFFF3 rd word of 128-bit Key register 0x00 0AE3 KEY3 0xFFFF4 th word of 128-bit Key register 0x00 0AE4 KEY4 0xFFFF5 th word of 128-bit Key register 0x00 0AE5 KEY5 0xFFFF6 th word of 128-bit Key register 0x00 0AE6 KEY6 0xFFFF7 th word of 128-bit Key register 0x00 0AE7 KEY7 0xFFFFHigh word of 128-bit Key register 0x00 0AEF CSMSCR 0xFFFFCSM status and control register Key Registers – accessible by user; EALLOW protected Address Name Reset ValueDescription 0x3F 7FF8 PWL0 user definedLow word of 128-bit password 0x3F 7FF9 PWL1 user defined2 nd word of 128-bit password 0x3F 7FFA PWL2 user defined 3 rd word of 128-bit password 0x3F 7FFB PWL3 user defined 4 th word of 128-bit password 0x3F 7FFC PWL4 user defined5 th word of 128-bit password 0x3F 7FFD PWL5 user defined6 th word of 128-bit password 0x3F 7FFE PWL6 user defined 7 th word of 128-bit password 0x3F 7FFF PWL7 user definedHigh word of 128-bit password PWL in memory – reserved for passwords only

Locking and Unlocking the CSM  The CSM is locked at power-up and reset  To unlock the CSM:  Perform a dummy read of each password in the Flash  Write the correct passwords to the key registers  New Flash Devices (PWL are all 0xFFFF):  When all passwords are 0xFFFF – only a read of the PWL is required to bring the device into unlocked mode

CSM Caveats  Never program all the PWL’s as 0x0000  Doing so will permanently lock the CSM  Flash addresses 0x3F7F80 to 0x3F7FF5, inclusive, must be programmed to 0x0000 to securely lock the CSM  Remember that code running in unsecured RAM cannot access data in secured memory  Don’t link the stack to secured RAM if you have any code that runs from unsecured RAM  Do not embed the passwords in your code!  Generally, the CSM is unlocked only for debug  Code Composer Studio can do the unlocking

CSM Password Match Flow Flash device secure after reset or runtime Do dummy read of PWL 0x3F 7FF8 – 0x3F 7FFF Start Device permanently locked CPU access is limited – device cannot be debugged or reprogrammed Device unlocked User can access on- chip secure memory Write password to KEY registers 0x00 0AE0 – 0x00 0AE7 (EALLOW) protected Correct password? Is PWL = all Fs? Is PWL = all 0s? Yes Yes Yes No No No

CSM C-Code Examples volatile int *PWL = &CsmPwl.PSWD0; //Pointer to PWL register file volatile int i, tmp; for (i = 0; i<8; i++) tmp = *PWL++; //Dummy reads of PWL locations asm (” EALLOW”); //KEY regs are EALLOW protected CsmRegs.KEY0 = PASSWORD0; //Write the passwords CsmRegs.KEY1 = PASSWORD0; //to the Key registers CsmRegs.KEY2 = PASSWORD2; CsmRegs.KEY3 = PASSWORD3; CsmRegs.KEY4 = PASSWORD4; CsmRegs.KEY5 = PASSWORD5; CsmRegs.KEY6 = PASSWORD6; CsmRegs.KEY7 = PASSWORD7; asm (” EDIS”); asm(” EALLOW”); //CSMSCR reg is EALLOW protected CsmRegs.CSMSCR.bit.FORCESEC = 1; //Set FORCESEC bit asm (”EDIS”); Unlocking the CSM: Locking the CSM:

Lab 11: Load an application into Flash  Use Solution for Lab4 to begin with  Modify the project to use internal Flash for code  Add “DSP281x_CodeStartBranch.asm” to branch from Flash entry point ( 0x3F 7FF6) to C - library function “_c_int00”  Add TI - code to set up the speed of Flash  Add a function to move the speed-up code from Flash to SARAM Adjust Linker Command File  Use CCS plug-in tool to perform the Flash download  Disconnect emulator, set eZdsp into MC-mode (JP1) and re-power the board!  Code should be executed out of Flash  For details see procedure in textbook!