Files
Gen4_R-Car_Trace32/2_Trunk/demo/arm/flash/tms470r1vf288.cmm
2025-10-14 09:52:32 +09:00

126 lines
4.7 KiB
Plaintext

; --------------------------------------------------------------------------------
; @Title: TMS470 internal flash of TMS470R1VF288
;
; @Description:
; Script arguments:
;
; DO tms470r1vf288 [PREPAREONLY]
;
; PREPAREONLY only declares flash but does not execute flash programming
;
; Example:
;
; DO ~~/demo/arm/flash/tms470r1vf288 PREPAREONLY
;
; internal flash is mapped to 0x00000000
; internal RAM is mapped to 0x01000000
;
; @Author: WRD
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
; @Chip: TMS470R1VF288
; --------------------------------------------------------------------------------
; $Rev: 10516 $
; $Id: tms470r1vf288.cmm 10516 2022-02-02 11:39:30Z bschroefel $
LOCAL &parameters &param_prepareonly
ENTRY %LINE &parameters
&param_prepareonly=(STRing.SCAN(STRing.UPpeR("&parameters"),"PREPAREONLY",0)!=-1)
; --------------------------------------------------------------------------------
; Init script variables
DO ~~~~/tms470-func Init
; --------------------------------------------------------------------------------
; Setup CPU
ON ERROR NOTHING
IF SYStem.MODE()<5
(
SYStem.RESet
SYStem.CPU TMS470R1VF288
SYStem.Option.BigEndian ON
SYStem.Option NOIRCHECK ON
SYStem.Up
)
; --------------------------------------------------------------------------------
; Flash configuration and declaration generated out of flash.cfg file
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Config for TMS470R1VF288
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Device_ID=0x95f ;TMS470R1VF288
; ProgVersion: 0.28 ; Library version
LOCAL &ProgRoutines
&ProgRoutines="f05a"
;&Frequency="15.0MHz" ; Range: 10.0 - 24.0
; Minor Revisions: 1
; 0 "TMS470R1VF288 Rev 0"
; Ram Config: 0x01000000 0x00004000 0x00000600
LOCAL &RamStart &RamSize
&RamStart=0x01000000
&RamSize=0x00004000
; Memory Security 1 Keys:
; 0xfffff700 0x00001fe0: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
DO ~~~~/tms470-func Memory_Security_1 0xfffff700 0x00001fe0 0xffffffff 0xffffffff 0xffffffff 0xffffffff
; Initialization: 4
Data.Set 0xFFFFFE00 %Long 0x00000000 0x00000060 0x00000004 0x00000090 0x00000100 0x00000050 0x00000000 0x00000000
Data.Set 0xFFFFFE20 %Long 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
Data.Set 0xFFFFFE40 %Long 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
Data.Set 0xFFFFFE00 %Long 0x00000000 0x00000160 ; Enable memory map
; PLL Config: 0xFFFFFFDC 0x0000000f ; configure PLL
Data.Set 0xFFFFFFDC %Long 0x00000007 ; configure PLL
LOCAL &FlashClock_Frequency
&FlashClock_Frequency="15MHz" ; Setup flash clock frequency to PLL frequency
; Engr ID: 0xffe88000 0x00000000
; Protection Keys:
; 0xffe88000 0x00001FF0: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
DO ~~~~/tms470-func FlashProtection 0xffe88000 0x00001FF0 0xffffffff 0xffffffff 0xffffffff 0xffffffff
; Number of Blocks: 9
FLASH.RESet
DO ~~~~/tms470-func DeclareSector Type: OTP Start: 0x00000000 Length: 0x00000800 Control: 0xffe88000 Core: 0x00 Sector: 0x00
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00000000 Length: 0x00002000 Control: 0xffe88000 Core: 0x00 Sector: 0x00
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00002000 Length: 0x00002000 Control: 0xffe88000 Core: 0x00 Sector: 0x01
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00004000 Length: 0x00002000 Control: 0xffe88000 Core: 0x00 Sector: 0x02
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00006000 Length: 0x00002000 Control: 0xffe88000 Core: 0x00 Sector: 0x03
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00040000 Length: 0x00010000 Control: 0xffe88000 Core: 0x01 Sector: 0x00
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00050000 Length: 0x00010000 Control: 0xffe88000 Core: 0x01 Sector: 0x01
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00060000 Length: 0x00010000 Control: 0xffe88000 Core: 0x01 Sector: 0x02
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00070000 Length: 0x00010000 Control: 0xffe88000 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 &param_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
)
ENDDO