140 lines
5.9 KiB
Plaintext
140 lines
5.9 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: TMS470 internal flash of TMS470PLF111
|
|
;
|
|
; @Description:
|
|
; Script arguments:
|
|
;
|
|
; DO tms470plf111 [PREPAREONLY]
|
|
;
|
|
; PREPAREONLY only declares flash but does not execute flash programming
|
|
;
|
|
; Example:
|
|
;
|
|
; DO ~~/demo/arm/flash/tms470plf111 PREPAREONLY
|
|
;
|
|
; internal flash is mapped to: 0x00000000
|
|
; internal RAM is mapped to: 0x08000000
|
|
;
|
|
; @Author: WRD
|
|
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; --------------------------------------------------------------------------------
|
|
; $Rev: 10516 $
|
|
; $Id: tms470plf111.cmm 10516 2022-02-02 11:39:30Z bschroefel $
|
|
|
|
LOCAL ¶meters
|
|
ENTRY %LINE ¶meters
|
|
|
|
LOCAL ¶m_prepareonly
|
|
¶m_prepareonly=(STRing.SCAN(STRing.UPpeR("¶meters"),"PREPAREONLY",0)!=-1)
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Init script variables
|
|
|
|
DO ~~~~/tms470-func Init
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Setup CPU
|
|
|
|
ON ERROR NOTHING
|
|
IF SYStem.MODE()<5
|
|
(
|
|
SYStem.RESet
|
|
SYStem.CPU TMS470PLF111
|
|
SYStem.Option.BigEndian ON
|
|
;SYStem.Option NOIRCHECK ON
|
|
SYStem.Up
|
|
)
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; Config for TMS470PLF111 (was TMS470PVF631)
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; actual device ID is 0x00063405 (Unique id is bits 30-17, revision is bits 7-3)
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;Device ID: 0x0003 TMS470PLF111/PVF631
|
|
; ProgVersion: 0.35 ; Library Version
|
|
; ProgRoutines: pf05b.lib ; Platform library archive
|
|
LOCAL &ProgRoutines
|
|
&ProgRoutines="pf05b"
|
|
|
|
; Frequency: 24 Range: 10.0 - 24.0
|
|
; Minor Revisions: 2
|
|
; 0 "TMS470PLF111/PVF631 Rev 0/A"
|
|
; 1 "TMS470PLF111 Rev C"
|
|
; Ram Config: 0x08000000 0x00002000
|
|
LOCAL &RamStart &RamSize
|
|
&RamStart=0x08000000
|
|
&RamSize=0x00002000
|
|
|
|
; Initialization: 7
|
|
; 0xffffffd0: 0x01010000 ; Disable peripherals
|
|
; 0xffffffd0: 0x01010100 ; Enable peripherals
|
|
; 0xffffff74: 0x00000000 ; FMENA off
|
|
; 0xfff87100: 0x00000000 ; disable pipeline mode
|
|
; 0xfff87110: 0x00000805 ; Switch off Flash ECC
|
|
; 0xffffffc4: 0x0000000a ; MEMSW='1010' => Flash at 0x00000000, RAM at 0x08000000)
|
|
; 0xfffff900: 0x00000005 ; Switch off RAM ECC
|
|
Data.Set 0xffffffd0 %Long 0x01010000 ; Disable peripherals
|
|
Data.Set 0xffffffd0 %Long 0x01010100 ; Enable peripherals
|
|
Data.Set 0xffffff74 %Long 0x00000000 ; FMENA off
|
|
Data.Set 0xfff87100 %Long 0x00000000 ; disable pipeline mode
|
|
Data.Set 0xfff87110 %Long 0x00000805 ; Switch off Flash ECC
|
|
Data.Set 0xffffffc4 %Long 0x0000000a ; MEMSW='1010' => Flash at 0x00000000, RAM at 0x08000000)
|
|
Data.Set 0xfffff900 %Long 0x00000005 ; Switch off RAM ECC
|
|
|
|
; PLL Config: 0xffffff70 0x00000004 0x00c00007 ; configure FMZPLL *8/5 (assuming 15Mhz OSCIN)
|
|
; Data.Set 0xffffff70 %Long 0x00000004|(Data.Long(SD:0xffffff70)&~0x00c00007)
|
|
Data.Set 0xffffff70 %Long 0x00000707 ; configure PLL *8/8
|
|
LOCAL &FlashClock_Frequency
|
|
&FlashClock_Frequency="15MHz" ; Setup flash clock frequency to PLL frequency
|
|
|
|
; Engr ID: 0xfff87000 0x00000000
|
|
; Protection Keys:
|
|
; 0xfff87000 0x00001ff0: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
|
DO ~~~~/tms470-func FlashProtection 0xfff87000 0x00001ff0 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
|
|
|
; Number of Blocks: 15
|
|
FLASH.RESet
|
|
DO ~~~~/tms470-func DeclareSector Type: OTP Start: 0x00000000 Length: 0x00000800 Control: 0xfff87000 Core: 0x00 Sector: 0x00
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00000000 Length: 0x00002000 Control: 0xfff87000 Core: 0x00 Sector: 0x00
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00002000 Length: 0x00002000 Control: 0xfff87000 Core: 0x00 Sector: 0x01
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00004000 Length: 0x00004000 Control: 0xfff87000 Core: 0x00 Sector: 0x02
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00008000 Length: 0x00004000 Control: 0xfff87000 Core: 0x00 Sector: 0x03
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x0000c000 Length: 0x00004000 Control: 0xfff87000 Core: 0x00 Sector: 0x04
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00010000 Length: 0x00004000 Control: 0xfff87000 Core: 0x00 Sector: 0x05
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00014000 Length: 0x00004000 Control: 0xfff87000 Core: 0x00 Sector: 0x06
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00018000 Length: 0x00004000 Control: 0xfff87000 Core: 0x00 Sector: 0x07
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x0001c000 Length: 0x00002000 Control: 0xfff87000 Core: 0x00 Sector: 0x08
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x0001e000 Length: 0x00002000 Control: 0xfff87000 Core: 0x00 Sector: 0x09
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00400000 Length: 0x00002000 Control: 0xfff87000 Core: 0x01 Sector: 0x00
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00402000 Length: 0x00002000 Control: 0xfff87000 Core: 0x01 Sector: 0x01
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00404000 Length: 0x00002000 Control: 0xfff87000 Core: 0x01 Sector: 0x02
|
|
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00406000 Length: 0x00002000 Control: 0xfff87000 Core: 0x01 Sector: 0x03
|
|
|
|
DO ~~~~/tms470-func DeclareFlashAlgortihm &ProgRoutines &RamStart &RamSize &FlashClock_Frequency
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; End of flash.cfg
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; Flash script ends here if called with parameter PREPAREONLY
|
|
IF ¶m_prepareonly
|
|
ENDDO PREPAREDONE
|
|
; --------------------------------------------------------------------------------
|
|
; Flash programming example
|
|
;
|
|
FLASH.List
|
|
;
|
|
DIALOG.YESNO "Program flash memory?"
|
|
ENTRY &progflash
|
|
|
|
IF &progflash
|
|
(
|
|
FLASH.Erase ALL
|
|
FLASH.Program ALL
|
|
Data.LOAD.auto * /Long
|
|
FLASH.Program off
|
|
Data.LOAD.auto * /ComPare
|
|
)
|
|
|
|
ENDDO
|