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

142 lines
7.1 KiB
Plaintext

; --------------------------------------------------------------------------------
; @Title: TMS470 internal flash of TMS470R1VF56C
;
; @Description:
; Script arguments:
;
; DO tms470r1vf56c [PREPAREONLY]
;
; PREPAREONLY only declares flash but does not execute flash programming
;
; Example:
;
; DO ~~/demo/arm/flash/tms470r1vf56c 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
; --------------------------------------------------------------------------------
; $Rev: 10516 $
; $Id: tms470r1vf56c.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 TMS470R1VF56C
SYStem.Option.BigEndian ON
;SYStem.Option NOIRCHECK ON
SYStem.Up
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Config for TMS470R1VF56C Rev 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Device ID: 0x937 TMS470R1VF56C
; ProgVersion: 0.35 ; Library version
; ProgRoutines: f05a.lib ; Library archive
LOCAL &ProgRoutines
&ProgRoutines="f05a"
; Frequency: 20.0 Range: 10.0 - 24.0
; Minor Revisions: 2
; 0 "TMS470R1VF56C Rev 0"
; 1 "TMS470R1VF56C Rev A"
; Ram Config: 0x01000000 0x00008000
LOCAL &RamStart &RamSize
&RamStart=0x01000000
&RamSize=0x00008000
; Initialization: 7
; 0xffff4020: 0x00000000 ; Disable MPU
; 0xfffffd30: 0x00000002 ; Disable peripherals
; 0xfffffd30: 0x00000003 ; Enable peripherals
; 0xfffffe00: 0x00000000 0x000000b0 0x00000000 0x00000000 0x00000100 0x00000060 0x00000000 0x00000000
; 0xfffffe20: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
; 0xfffffe40: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
; 0xfffffe00: 0x00000000 0x000001b0 ; Enable memory map
Data.Set 0xffff4020 %Long 0x00000000 ; Disable MPU
Data.Set 0xfffffd30 %Long 0x00000002 ; Disable peripherals
Data.Set 0xfffffd30 %Long 0x00000003 ; Enable peripherals
Data.Set 0xfffffe00 %Long 0x00000000 0x000000b0 0x00000000 0x00000000 0x00000100 0x00000060 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 0x000001b0 ; Enable memory map
; PLL Config: 0xffffffdc 0x00000008 0xffffffff ; configure PLL address, data, and mask
; Data.Set 0xffffffdc %Long 0x00000008|(Data.Long(SD:0xffffffdc)&~0xffffffff)
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 0x00003ff0: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
DO ~~~~/tms470-func FlashProtection 0xffe88000 0x00003ff0 0xffffffff 0xffffffff 0xffffffff 0xffffffff
; Number of Blocks: 23
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: 0x00004000 Control: 0xffe88000 Core: 0x00 Sector: 0x00
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00004000 Length: 0x00004000 Control: 0xffe88000 Core: 0x00 Sector: 0x01
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00008000 Length: 0x00008000 Control: 0xffe88000 Core: 0x00 Sector: 0x02
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00010000 Length: 0x00008000 Control: 0xffe88000 Core: 0x00 Sector: 0x03
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00018000 Length: 0x00008000 Control: 0xffe88000 Core: 0x00 Sector: 0x04
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00020000 Length: 0x00008000 Control: 0xffe88000 Core: 0x00 Sector: 0x05
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00028000 Length: 0x00008000 Control: 0xffe88000 Core: 0x00 Sector: 0x06
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00030000 Length: 0x00008000 Control: 0xffe88000 Core: 0x00 Sector: 0x07
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00038000 Length: 0x00004000 Control: 0xffe88000 Core: 0x00 Sector: 0x08
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x0003c000 Length: 0x00004000 Control: 0xffe88000 Core: 0x00 Sector: 0x09
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 DeclareSector Type: FLASH Start: 0x00080000 Length: 0x00010000 Control: 0xffe88000 Core: 0x02 Sector: 0x00
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00090000 Length: 0x00010000 Control: 0xffe88000 Core: 0x02 Sector: 0x01
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x000a0000 Length: 0x00010000 Control: 0xffe88000 Core: 0x02 Sector: 0x02
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x000b0000 Length: 0x00010000 Control: 0xffe88000 Core: 0x02 Sector: 0x03
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x000c0000 Length: 0x00010000 Control: 0xffe88000 Core: 0x03 Sector: 0x00
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x000d0000 Length: 0x00010000 Control: 0xffe88000 Core: 0x03 Sector: 0x01
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x000e0000 Length: 0x00010000 Control: 0xffe88000 Core: 0x03 Sector: 0x02
DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x000f0000 Length: 0x00010000 Control: 0xffe88000 Core: 0x03 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
Data.LOAD.auto * /Long /ComPare
)
ENDDO