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

116 lines
3.4 KiB
Plaintext

; --------------------------------------------------------------------------------
; @Title: TCC70xx Program eFlash declaration script
; @Description:
; Script arguments:
; DO tcc70xx [PREPAREONLY] [CPU=<cpu>] [DUALPORT=<0|1>]
; PREPAREONLY only declares flash but does not execute flash programming
; CPU=<cpu> selects CPU derivative <cpu>
; DUALPORT=<0|1> use dual port memory access, default 1
; Example:
; DO ~~/demo/arm/flash/tcc70xx PREPAREONLY
; Note:
; This file must NOT be modified.
; This file is intended to stay within TRACE32 installation.
; Usage examples are available in the ~~/demo/arm/hardware/... subdirectories.
;
; List of Telechips TCC70xx derivatives:
; TCC7022
; TCC7025
; TCC7035
; TCC7045
;
; @Keywords: Flash, ARM, Cortex-R5
; @Author: BWR
; @Chip: TCC70*
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: tcc70xx.cmm 11086 2022-07-11 15:17:40Z bwright $
PRIVATE &parameters
ENTRY %LINE &parameters
PRIVATE &param_prepareonly &param_cpu &param_dualport
&parameters=STRing.UPpeR("&parameters")
&param_prepareonly=(STRing.SCAN("&parameters","PREPAREONLY",0)!=-1)
&param_cpu=STRing.SCANAndExtract("&parameters","CPU=","")
&param_dualport=STRing.SCANAndExtract("&parameters","DUALPORT=","1")
; --------------------------------------------------------------------------------
; Initialize and start the debugger
IF !SYStem.Up()
(
SYStem.RESet
IF "&param_cpu"!=""
SYStem.CPU &param_cpu
IF !CPUIS(TCC70*)
(
SYStem.CPU TCC7045-CR5
)
SYStem.MemAccess DAP
SYStem.JtagClock 10MHz
SYStem.Option.EnReset OFF
SYStem.Up
)
; --------------------------------------------------------------------------------
; Flash declaration
FLASH.RESet
GOSUB FlashDeclaration "&param_dualport"
; Flash script ends here if called with parameter PREPAREONLY
IF &param_prepareonly
ENDDO PREPAREDONE
; --------------------------------------------------------------------------------
; Flash programming example
DIALOG.YESNO "Program flash memory?"
PRIVATE &progflash
ENTRY &progflash
IF &progflash
(
FLASH.ReProgram ALL /Erase
Data.LOAD.auto *
FLASH.ReProgram OFF
; Reset device
SYStem.Down
SYStem.Up
)
ENDDO
; --------------------------------------------------------------------------------
; SUBROUTINES
; --------------------------------------------------------------------------------
; Flash declaration depending on selected CPU
;
; Please do NOT modify the TRACE32 flash declaration.
;
; Modifications can result in unpredictable behavior.
; Please contact support@lauterbach.com for any changes.
FlashDeclaration: ;(param_dualport)
(
PARAMETERS &param_dualport
PRIVATE &PFLASH_BASE &PFLASH_SIZE &SECTOR_SIZE &FlashDriver
&PFLASH_BASE=0x20000000
&PFLASH_SIZE=0x00200000
&SECTOR_SIZE=0x2000
&FlashDriver="~~/demo/arm/flash/long/tcc7022.bin"
; Flash timing set to 150 MHz
Data.Set SD:0x0:0xA1000100 %LE %Long 0x001E0002 ; delay cycle rd ctl
Data.Set SD:0x0:0xA1000104 %LE %Long 0x00020100 ; delay cycle wr ctl
FLASH.Create 1. &PFLASH_BASE++(&PFLASH_SIZE-1.) &SECTOR_SIZE TARGET Long
IF (("&param_dualport"!="1")||SYStem.ACCESS.DENIED())
FLASH.TARGET 0x00001000 0x00002000 0x2000 &FlashDriver
ELSE
FLASH.TARGET 0x00001000 E:0x00002000 0x2000 &FlashDriver /DualPort
RETURN
)