SlideShare a Scribd company logo
1 of 18
Chapter 10 : Flash
 Programming C28x


  Digital Signal Controller
    TMS320F2812



Technology beyond the Dreams™   Copyright © 2006 Pantech Solutions Pvt
BIOS Startup Sequence from Flash Memory
                                                                C – start routine
          0x3D 8000                                _c_int00   Boot.asm
                        FLASH (128K)
                                                                “rts2800_ml.lib”
                                           4
          0x3F 7FF6          LB
                          _c_int00
                        Passwords (8)                 5
          0x3F 8000   H0 SARAM (8K)
     3                                                        “user” code sections
                                                              main ( )
          0x3F F000    Boot ROM (4K)                          {
                        Boot Code                               ……
                               0x3F FC00
                                                                return;
                        {SCAN GPIO}
                                               2              }
                      BROM vector (32)
          0x3F FFC0     0x3F FC00
    1


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



Technology beyond the Dreams™                  Copyright © 2006 Pantech Solutions Pvt
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 !
                                                            4 3                    0
   FBANKWAIT 15                12 11           8 7

  @ 0x00 0A86            reserved    PAGEWAIT        reserved           RANDWAIT


      FOTPWAIT      15                                          4   3              0

  @ 0x00 0A87                          reserved                         OTPWAIT


      *** 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 Pvt
Technology beyond the Dreams™             Copyright 2006 Pantech Solutions
Speeding Up Code Execution in
          16          Flash:
                    Flash Pipelining (for code fetch only)
                                                 16 or 32
                                      64         dispatched
                      64                                            C28x Core
                                                                    decoder unit
                    Aligned       2-level deep
                    64-bit        fetch buffer
                    fetch
                                                    Flash Pipeline Enable
                                                            0 = disable (default)
                                                            1 = enable


     FOPT @ 0x00 0A80
     15                                               1             0
                              reserved                         ENPIPE

Technology beyond the Dreams™                      Copyright © 2006 Pantech Solutions Pvt
Other Flash Configuration Registers
       Address     Name              Description
       0x00 0A80   FOPT              Flash option register
       0x00 0A82   FPWR              Flash power modes registers
       0x00 0A83   FSTATUS           Flash status register
       0x00 0A84   FSTDBYWAIT        Flash sleep to standby wait register
       0x00 0A85   FACTIVEWAIT       Flash standby to active wait register
       0x00 0A86   FBANKWAIT         Flash read access wait state register
       0x00 0A87   FOTPWAIT          OTP 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

Technology beyond the Dreams™                         Copyright © 2006 Pantech Solutions Pvt
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




                                                                                   FLASH
                                                                                   FLASH
        Flash
        utility
        code                  Emulator        JTAG

                                 RS232         SCI




                                                                      Bootloader




                                                                                            F28x DSP
                                                                                            F28x DSP
        Flash


                                                              RAM
                                                              RAM




                                                                                   CPU
                                                                                   CPU
        Data                                    SPI



                                                                ROM
                                              GPIO


Technology beyond the Dreams™                                Copyright © 2006 Pantech Solutions Pvt
• Sequence of steps for Flash programming:
                  Algorithm         Function
             1. Erase         - Set all bits to zero, then to one
             2. Program       - Program selected bits with zero
             3. Verify        - Verify flash contents




 • 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)




Technology beyond the Dreams™                           Copyright © 2006 Pantech Solutions Pvt
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 www.ti.com
Technology beyond the Dreams™                     Copyright © 2006 Pantech Solutions Pvt
Code Composer Studio
               Flash Plug-In




Technology beyond the Dreams™   Copyright © 2006 Pantech Solutions Pvt
Code Security Module (CSM)
           Access to the following on-chip memory is restricted:
                              0x00 8000
                                          LO SARAM (4K)
                              0x00 9000
                                          L1 SARAM (4K)
                              0x00 A000      reserved
                              0x3D 7800
                                             OTP (1K)
                             0x3D 7C00       reserved
                             0x3D 8000
                                           FLASH (128K)


• 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


Technology beyond the Dreams™                           Copyright © 2006 Pantech Solutions Pvt
CSM Password
                   0x00 8000
                               LO SARAM (4K)
                   0x00 9000
                   0x00 A000 L1 SARAM (4K)
                                 reserved
                   0x3D 7800                                 CSM Password
                   0x3D 7C00     OTP (1K)                    Locations (PWL)
                                 reserved                   0x3F 7FF8 - 0x3F 7FFF
                   0x3D 8000  FLASH (128K)
                                128-Bit 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



Technology beyond the Dreams™                          Copyright © 2006 Pantech Solutions Pvt
Key Registers – accessible by user; EALLOW protected
   Address    Name        Reset Value      Description
   0x00 0AE0 KEY0
   0x00 0AE1 KEY1     CSM Registers
                          0xFFFF
                          0xFFFF
                                           Low word of 128-bit Key register
                                           2nd word of 128-bit Key register
   0x00 0AE2 KEY2         0xFFFF           3rd word of 128-bit Key register
   0x00 0AE3 KEY3         0xFFFF           4th word of 128-bit Key register
   0x00 0AE4 KEY4         0xFFFF           5th word of 128-bit Key register
   0x00 0AE5 KEY5         0xFFFF           6th word of 128-bit Key register
   0x00 0AE6 KEY6         0xFFFF           7th word of 128-bit Key register
   0x00 0AE7 KEY7         0xFFFF           High word of 128-bit Key register
   0x00 0AEF CSMSCR 0xFFFF                 CSM status and control register
   PWL in memory – reserved for passwords only
   Address    Name        Reset Value       Description
   0x3F 7FF8 PWL0          user defined     Low word of 128-bit password
   0x3F 7FF9 PWL1          user defined     2nd word of 128-bit password
   0x3F 7FFA PWL2          user defined     3rd word of 128-bit password
   0x3F 7FFB PWL3          user defined     4th word of 128-bit password
   0x3F 7FFC PWL4          user defined     5th word of 128-bit password
   0x3F 7FFD PWL5          user defined     6th word of 128-bit password
   0x3F 7FFE PWL6          user defined     7th word of 128-bit password
   0x3F 7FFF PWL7         user defined      High word of 128-bit password
Technology beyond the Dreams™                      Copyright © 2006 Pantech Solutions Pvt
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




Technology beyond the Dreams™                        Copyright © 2006 Pantech Solutions Pvt
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

Technology beyond the Dreams™                          Copyright © 2006 Pantech Solutions Pvt
CSM Password Match Flow
                                                        Device permanently locked
             Start                 Is PWL =      Yes
                                                        CPU access is limited –
                                   all 0s?              device cannot be debugged
                                                        or reprogrammed
                                     No
       Flash device
       secure after                               Yes
       reset or runtime            Is PWL =
                                   all Fs?
                                     No
   Do dummy read of PWL         Write password to KEY registers
   0x3F 7FF8 – 0x3F 7FFF        0x00 0AE0 – 0x00 0AE7
                                (EALLOW) protected



                                                                 Device unlocked
                                          Correct       Yes
                                          password?              User can access on-
                                                                 chip secure memory
                                           No
Technology beyond the Dreams™                           Copyright © 2006 Pantech Solutions Pvt
Unlocking the CSM:

           CSM C-Code Examples
  volatile int *PWL = &CsmPwl.PSWD0;
  volatile int i, tmp;
                                        //Pointer to PWL register file


  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”);




 Locking the CSM:
  asm(” EALLOW”);                       //CSMSCR reg is EALLOW protected
  CsmRegs.CSMSCR.bit.FORCESEC = 1;      //Set FORCESEC bit
  asm (”EDIS”);

Technology beyond the Dreams™                    Copyright © 2006 Pantech Solutions Pvt
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!



Technology beyond the Dreams™                        Copyright © 2006 Pantech Solutions Pvt

More Related Content

What's hot

LINUX RS232程式設計
LINUX RS232程式設計LINUX RS232程式設計
LINUX RS232程式設計艾鍗科技
 
GPS-320FW
GPS-320FWGPS-320FW
GPS-320FWenenxx
 
Message Signaled Interrupts
Message Signaled InterruptsMessage Signaled Interrupts
Message Signaled InterruptsAnshuman Biswal
 
GGM8000-FIPs-Certification
GGM8000-FIPs-CertificationGGM8000-FIPs-Certification
GGM8000-FIPs-CertificationDavid Kiefer
 
QPACE QCD Parallel Computing on the Cell Broadband Engine™ (Cell/B.E.)
QPACE QCD Parallel Computing on the Cell Broadband Engine™ (Cell/B.E.)QPACE QCD Parallel Computing on the Cell Broadband Engine™ (Cell/B.E.)
QPACE QCD Parallel Computing on the Cell Broadband Engine™ (Cell/B.E.)Heiko Joerg Schick
 
Blueoptics bo56jxx660d 10gbase cwdm sfp+ transceiver 60km singlemode lc duple...
Blueoptics bo56jxx660d 10gbase cwdm sfp+ transceiver 60km singlemode lc duple...Blueoptics bo56jxx660d 10gbase cwdm sfp+ transceiver 60km singlemode lc duple...
Blueoptics bo56jxx660d 10gbase cwdm sfp+ transceiver 60km singlemode lc duple...CBO GmbH
 
Webinar: Wearables - Apresentando um diagrama de blocos e componentes chaves
Webinar: Wearables - Apresentando um diagrama de blocos e componentes chavesWebinar: Wearables - Apresentando um diagrama de blocos e componentes chaves
Webinar: Wearables - Apresentando um diagrama de blocos e componentes chavesEmbarcados
 
Altera Cyclone IV FPGA Customer Presentation
Altera Cyclone IV FPGA Customer PresentationAltera Cyclone IV FPGA Customer Presentation
Altera Cyclone IV FPGA Customer PresentationAltera Corporation
 
MYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
MYS-6ULX Single Board Computer for Industry 4.0 and IoT ApplicationsMYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
MYS-6ULX Single Board Computer for Industry 4.0 and IoT ApplicationsLinda Zhang
 
Technical s7889
Technical s7889Technical s7889
Technical s7889huslen_du
 
xbee pro digi-mesh 2.4 oem rf modules
xbee pro  digi-mesh  2.4 oem rf modulesxbee pro  digi-mesh  2.4 oem rf modules
xbee pro digi-mesh 2.4 oem rf modulesSyamim Sempoi
 
selfridge_alec_chipspec
selfridge_alec_chipspecselfridge_alec_chipspec
selfridge_alec_chipspecAlec Selfridge
 
Sevana Voice Impairments Detection Library
Sevana Voice Impairments Detection LibrarySevana Voice Impairments Detection Library
Sevana Voice Impairments Detection LibrarySevana Oü
 
Adv. FPGA Motor Control--EBV & Univ. of Koln: Embedded World 2010
Adv. FPGA Motor Control--EBV & Univ. of Koln: Embedded World 2010Adv. FPGA Motor Control--EBV & Univ. of Koln: Embedded World 2010
Adv. FPGA Motor Control--EBV & Univ. of Koln: Embedded World 2010Altera Corporation
 
Continuum PCAP
Continuum PCAP Continuum PCAP
Continuum PCAP rwachsman
 
Blueoptics bo56hxx610d 8gbase-cwdm sfp+ transceiver 10km singlemode lc duplex...
Blueoptics bo56hxx610d 8gbase-cwdm sfp+ transceiver 10km singlemode lc duplex...Blueoptics bo56hxx610d 8gbase-cwdm sfp+ transceiver 10km singlemode lc duplex...
Blueoptics bo56hxx610d 8gbase-cwdm sfp+ transceiver 10km singlemode lc duplex...CBO GmbH
 

What's hot (20)

Pic base a_1
Pic base a_1Pic base a_1
Pic base a_1
 
LINUX RS232程式設計
LINUX RS232程式設計LINUX RS232程式設計
LINUX RS232程式設計
 
GPS-320FW
GPS-320FWGPS-320FW
GPS-320FW
 
Message Signaled Interrupts
Message Signaled InterruptsMessage Signaled Interrupts
Message Signaled Interrupts
 
GGM8000-FIPs-Certification
GGM8000-FIPs-CertificationGGM8000-FIPs-Certification
GGM8000-FIPs-Certification
 
QPACE QCD Parallel Computing on the Cell Broadband Engine™ (Cell/B.E.)
QPACE QCD Parallel Computing on the Cell Broadband Engine™ (Cell/B.E.)QPACE QCD Parallel Computing on the Cell Broadband Engine™ (Cell/B.E.)
QPACE QCD Parallel Computing on the Cell Broadband Engine™ (Cell/B.E.)
 
Blueoptics bo56jxx660d 10gbase cwdm sfp+ transceiver 60km singlemode lc duple...
Blueoptics bo56jxx660d 10gbase cwdm sfp+ transceiver 60km singlemode lc duple...Blueoptics bo56jxx660d 10gbase cwdm sfp+ transceiver 60km singlemode lc duple...
Blueoptics bo56jxx660d 10gbase cwdm sfp+ transceiver 60km singlemode lc duple...
 
Webinar: Wearables - Apresentando um diagrama de blocos e componentes chaves
Webinar: Wearables - Apresentando um diagrama de blocos e componentes chavesWebinar: Wearables - Apresentando um diagrama de blocos e componentes chaves
Webinar: Wearables - Apresentando um diagrama de blocos e componentes chaves
 
Altera Cyclone IV FPGA Customer Presentation
Altera Cyclone IV FPGA Customer PresentationAltera Cyclone IV FPGA Customer Presentation
Altera Cyclone IV FPGA Customer Presentation
 
MYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
MYS-6ULX Single Board Computer for Industry 4.0 and IoT ApplicationsMYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
MYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
 
Ks 868 e-users_manual of home security devices
Ks 868 e-users_manual of home security devicesKs 868 e-users_manual of home security devices
Ks 868 e-users_manual of home security devices
 
Technical s7889
Technical s7889Technical s7889
Technical s7889
 
xbee pro digi-mesh 2.4 oem rf modules
xbee pro  digi-mesh  2.4 oem rf modulesxbee pro  digi-mesh  2.4 oem rf modules
xbee pro digi-mesh 2.4 oem rf modules
 
Np unit iv i
Np unit iv iNp unit iv i
Np unit iv i
 
selfridge_alec_chipspec
selfridge_alec_chipspecselfridge_alec_chipspec
selfridge_alec_chipspec
 
Chapter 2.doc
Chapter 2.docChapter 2.doc
Chapter 2.doc
 
Sevana Voice Impairments Detection Library
Sevana Voice Impairments Detection LibrarySevana Voice Impairments Detection Library
Sevana Voice Impairments Detection Library
 
Adv. FPGA Motor Control--EBV & Univ. of Koln: Embedded World 2010
Adv. FPGA Motor Control--EBV & Univ. of Koln: Embedded World 2010Adv. FPGA Motor Control--EBV & Univ. of Koln: Embedded World 2010
Adv. FPGA Motor Control--EBV & Univ. of Koln: Embedded World 2010
 
Continuum PCAP
Continuum PCAP Continuum PCAP
Continuum PCAP
 
Blueoptics bo56hxx610d 8gbase-cwdm sfp+ transceiver 10km singlemode lc duplex...
Blueoptics bo56hxx610d 8gbase-cwdm sfp+ transceiver 10km singlemode lc duplex...Blueoptics bo56hxx610d 8gbase-cwdm sfp+ transceiver 10km singlemode lc duplex...
Blueoptics bo56hxx610d 8gbase-cwdm sfp+ transceiver 10km singlemode lc duplex...
 

Similar to Flash Programming F28x

At 89s51
At 89s51At 89s51
At 89s51Mr Giap
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontrolleraviban
 
Robotix Tutorial 9
Robotix Tutorial 9Robotix Tutorial 9
Robotix Tutorial 9ankuredkie
 
The hardware of the Mcs 51 microcontroller
 The hardware of the Mcs 51 microcontroller The hardware of the Mcs 51 microcontroller
The hardware of the Mcs 51 microcontrollerGarba Geidam
 
An Overview of Arm-9 32-bit MCU TMPA910 Series
An Overview of Arm-9 32-bit MCU TMPA910 Series An Overview of Arm-9 32-bit MCU TMPA910 Series
An Overview of Arm-9 32-bit MCU TMPA910 Series Premier Farnell
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessorsavitamhaske
 
An Overview Study on 32-bit MCU MB91460 Series and its Peripherals
An Overview Study on 32-bit MCU MB91460 Series and its PeripheralsAn Overview Study on 32-bit MCU MB91460 Series and its Peripherals
An Overview Study on 32-bit MCU MB91460 Series and its PeripheralsPremier Farnell
 
Assembly programming
Assembly programmingAssembly programming
Assembly programmingOmar Sanchez
 
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral IntegrationA 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral IntegrationTalal Khaliq
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copymkazree
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT II Processor Family
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT II Processor FamilySYBSC IT SEM IV EMBEDDED SYSTEMS UNIT II Processor Family
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT II Processor FamilyArti Parab Academics
 

Similar to Flash Programming F28x (20)

At 89s51
At 89s51At 89s51
At 89s51
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontroller
 
At89s51
At89s51At89s51
At89s51
 
datasheet.pdf
datasheet.pdfdatasheet.pdf
datasheet.pdf
 
Datasheet
DatasheetDatasheet
Datasheet
 
Robotix Tutorial 9
Robotix Tutorial 9Robotix Tutorial 9
Robotix Tutorial 9
 
The hardware of the Mcs 51 microcontroller
 The hardware of the Mcs 51 microcontroller The hardware of the Mcs 51 microcontroller
The hardware of the Mcs 51 microcontroller
 
8086
80868086
8086
 
unit-2.pptx
unit-2.pptxunit-2.pptx
unit-2.pptx
 
One day-workshop on tms320 f2812
One day-workshop on tms320 f2812One day-workshop on tms320 f2812
One day-workshop on tms320 f2812
 
Microcontroller at89 s52 datasheet
Microcontroller at89 s52 datasheetMicrocontroller at89 s52 datasheet
Microcontroller at89 s52 datasheet
 
An Overview of Arm-9 32-bit MCU TMPA910 Series
An Overview of Arm-9 32-bit MCU TMPA910 Series An Overview of Arm-9 32-bit MCU TMPA910 Series
An Overview of Arm-9 32-bit MCU TMPA910 Series
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
Getting started with pic microcontrollers
Getting started with pic microcontrollersGetting started with pic microcontrollers
Getting started with pic microcontrollers
 
An Overview Study on 32-bit MCU MB91460 Series and its Peripherals
An Overview Study on 32-bit MCU MB91460 Series and its PeripheralsAn Overview Study on 32-bit MCU MB91460 Series and its Peripherals
An Overview Study on 32-bit MCU MB91460 Series and its Peripherals
 
Assembly programming
Assembly programmingAssembly programming
Assembly programming
 
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral IntegrationA 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
 
Tms320F2812 Digital I/0
Tms320F2812 Digital I/0Tms320F2812 Digital I/0
Tms320F2812 Digital I/0
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copy
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT II Processor Family
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT II Processor FamilySYBSC IT SEM IV EMBEDDED SYSTEMS UNIT II Processor Family
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT II Processor Family
 

More from Pantech ProLabs India Pvt Ltd

Choosing the right processor for embedded system design
Choosing the right processor for embedded system designChoosing the right processor for embedded system design
Choosing the right processor for embedded system designPantech ProLabs India Pvt Ltd
 

More from Pantech ProLabs India Pvt Ltd (20)

Registration process
Registration processRegistration process
Registration process
 
Choosing the right processor for embedded system design
Choosing the right processor for embedded system designChoosing the right processor for embedded system design
Choosing the right processor for embedded system design
 
Brain Computer Interface
Brain Computer InterfaceBrain Computer Interface
Brain Computer Interface
 
Electric Vehicle Design using Matlab
Electric Vehicle Design using MatlabElectric Vehicle Design using Matlab
Electric Vehicle Design using Matlab
 
Image processing application
Image processing applicationImage processing application
Image processing application
 
Internet of Things using Raspberry Pi
Internet of Things using Raspberry PiInternet of Things using Raspberry Pi
Internet of Things using Raspberry Pi
 
Internet of Things Using Arduino
Internet of Things Using ArduinoInternet of Things Using Arduino
Internet of Things Using Arduino
 
Brain controlled robot
Brain controlled robotBrain controlled robot
Brain controlled robot
 
Brain Computer Interface-Webinar
Brain Computer Interface-WebinarBrain Computer Interface-Webinar
Brain Computer Interface-Webinar
 
Development of Deep Learning Architecture
Development of Deep Learning ArchitectureDevelopment of Deep Learning Architecture
Development of Deep Learning Architecture
 
Future of AI
Future of AIFuture of AI
Future of AI
 
Gate driver design and inductance fabrication
Gate driver design and inductance fabricationGate driver design and inductance fabrication
Gate driver design and inductance fabrication
 
Brainsense -Brain computer Interface
Brainsense -Brain computer InterfaceBrainsense -Brain computer Interface
Brainsense -Brain computer Interface
 
Median filter Implementation using TMS320C6745
Median filter Implementation using TMS320C6745Median filter Implementation using TMS320C6745
Median filter Implementation using TMS320C6745
 
Introduction to Code Composer Studio 4
Introduction to Code Composer Studio 4Introduction to Code Composer Studio 4
Introduction to Code Composer Studio 4
 
Waveform Generation Using TMS320C6745 DSP
Waveform Generation Using TMS320C6745 DSPWaveform Generation Using TMS320C6745 DSP
Waveform Generation Using TMS320C6745 DSP
 
Interfacing UART with tms320C6745
Interfacing UART with tms320C6745Interfacing UART with tms320C6745
Interfacing UART with tms320C6745
 
Switch & LED using TMS320C6745 DSP
Switch & LED using TMS320C6745 DSPSwitch & LED using TMS320C6745 DSP
Switch & LED using TMS320C6745 DSP
 
Led blinking using TMS320C6745
Led blinking using TMS320C6745Led blinking using TMS320C6745
Led blinking using TMS320C6745
 
Introduction to tms320c6745 dsp
Introduction to tms320c6745 dspIntroduction to tms320c6745 dsp
Introduction to tms320c6745 dsp
 

Recently uploaded

Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 

Recently uploaded (20)

Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 

Flash Programming F28x

  • 1. Chapter 10 : Flash Programming C28x Digital Signal Controller TMS320F2812 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 2. BIOS Startup Sequence from Flash Memory C – start routine 0x3D 8000 _c_int00 Boot.asm FLASH (128K) “rts2800_ml.lib” 4 0x3F 7FF6 LB _c_int00 Passwords (8) 5 0x3F 8000 H0 SARAM (8K) 3 “user” code sections main ( ) 0x3F F000 Boot ROM (4K) { Boot Code …… 0x3F FC00 return; {SCAN GPIO} 2 } BROM vector (32) 0x3F FFC0 0x3F FC00 1 RESET Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 3. TMS320F2812 Flash Memory Map Address Range Data & Program Space 0x3D 8000 – 0x3D 9FFF Sector J ; 8K x 16 0x3D A000 – 0x3D BFFF Sector I ; 8K x 16 0x3D C000 – 0x3D FFFF Sector H : 16K x 16 0x3E 0000 – 0x3E 3FFF Sector G ; 16K x 16 0x3E 4000 – 0x3E 7FFF Sector F ; 16K x 16 0x3E 8000 – 0x3E BFFF Sector E ; 16K x 16 0x3E C000 – 0x3E FFFF Sector D; 16K x 16 0x3F 0000 – 0x3F 3FFF Sector C ; 16K x 16 0x3F 4000 – 0x3F 5FFF Sector B ; 8K x16 0x3F 6000 – 0x3F 7F7F Sector A ; (8K-128) x16 0x3F 7F80 – 0x3F 7FF5 Program to 0x0000 when using Code Security Mode ! 0x3F 7FF6 – 0x3F 7FF7 Flash Entry Point ; 2 x 16 0x3F 7FF8 – 0x3F 7FFF Security Password ; 8 x 16 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 4. 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 ! 4 3 0 FBANKWAIT 15 12 11 8 7 @ 0x00 0A86 reserved PAGEWAIT reserved RANDWAIT FOTPWAIT 15 4 3 0 @ 0x00 0A87 reserved OTPWAIT *** 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 Pvt Technology beyond the Dreams™ Copyright 2006 Pantech Solutions
  • 5. Speeding Up Code Execution in 16 Flash: Flash Pipelining (for code fetch only) 16 or 32 64 dispatched 64 C28x Core decoder unit Aligned 2-level deep 64-bit fetch buffer fetch Flash Pipeline Enable 0 = disable (default) 1 = enable FOPT @ 0x00 0A80 15 1 0 reserved ENPIPE Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 6. Other Flash Configuration Registers Address Name Description 0x00 0A80 FOPT Flash option register 0x00 0A82 FPWR Flash power modes registers 0x00 0A83 FSTATUS Flash status register 0x00 0A84 FSTDBYWAIT Flash sleep to standby wait register 0x00 0A85 FACTIVEWAIT Flash standby to active wait register 0x00 0A86 FBANKWAIT Flash read access wait state register 0x00 0A87 FOTPWAIT OTP 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 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 7. 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 FLASH FLASH Flash utility code Emulator JTAG RS232 SCI Bootloader F28x DSP F28x DSP Flash RAM RAM CPU CPU Data SPI ROM GPIO Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 8. • Sequence of steps for Flash programming: Algorithm Function 1. Erase - Set all bits to zero, then to one 2. Program - Program selected bits with zero 3. Verify - Verify flash contents • 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) Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 9. 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 www.ti.com Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 10. Code Composer Studio Flash Plug-In Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 11. Code Security Module (CSM)  Access to the following on-chip memory is restricted: 0x00 8000 LO SARAM (4K) 0x00 9000 L1 SARAM (4K) 0x00 A000 reserved 0x3D 7800 OTP (1K) 0x3D 7C00 reserved 0x3D 8000 FLASH (128K) • 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 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 12. CSM Password 0x00 8000 LO SARAM (4K) 0x00 9000 0x00 A000 L1 SARAM (4K) reserved 0x3D 7800 CSM Password 0x3D 7C00 OTP (1K) Locations (PWL) reserved 0x3F 7FF8 - 0x3F 7FFF 0x3D 8000 FLASH (128K) 128-Bit 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 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 13. Key Registers – accessible by user; EALLOW protected Address Name Reset Value Description 0x00 0AE0 KEY0 0x00 0AE1 KEY1 CSM Registers 0xFFFF 0xFFFF Low word of 128-bit Key register 2nd word of 128-bit Key register 0x00 0AE2 KEY2 0xFFFF 3rd word of 128-bit Key register 0x00 0AE3 KEY3 0xFFFF 4th word of 128-bit Key register 0x00 0AE4 KEY4 0xFFFF 5th word of 128-bit Key register 0x00 0AE5 KEY5 0xFFFF 6th word of 128-bit Key register 0x00 0AE6 KEY6 0xFFFF 7th word of 128-bit Key register 0x00 0AE7 KEY7 0xFFFF High word of 128-bit Key register 0x00 0AEF CSMSCR 0xFFFF CSM status and control register PWL in memory – reserved for passwords only Address Name Reset Value Description 0x3F 7FF8 PWL0 user defined Low word of 128-bit password 0x3F 7FF9 PWL1 user defined 2nd word of 128-bit password 0x3F 7FFA PWL2 user defined 3rd word of 128-bit password 0x3F 7FFB PWL3 user defined 4th word of 128-bit password 0x3F 7FFC PWL4 user defined 5th word of 128-bit password 0x3F 7FFD PWL5 user defined 6th word of 128-bit password 0x3F 7FFE PWL6 user defined 7th word of 128-bit password 0x3F 7FFF PWL7 user defined High word of 128-bit password Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 14. 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 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 15. 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 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 16. CSM Password Match Flow Device permanently locked Start Is PWL = Yes CPU access is limited – all 0s? device cannot be debugged or reprogrammed No Flash device secure after Yes reset or runtime Is PWL = all Fs? No Do dummy read of PWL Write password to KEY registers 0x3F 7FF8 – 0x3F 7FFF 0x00 0AE0 – 0x00 0AE7 (EALLOW) protected Device unlocked Correct Yes password? User can access on- chip secure memory No Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 17. Unlocking the CSM: CSM C-Code Examples volatile int *PWL = &CsmPwl.PSWD0; volatile int i, tmp; //Pointer to PWL register file 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”); Locking the CSM: asm(” EALLOW”); //CSMSCR reg is EALLOW protected CsmRegs.CSMSCR.bit.FORCESEC = 1; //Set FORCESEC bit asm (”EDIS”); Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 18. 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! Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt