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

144 lines
3.5 KiB
Plaintext

; --------------------------------------------------------------------------------
; @Title: Example script for flash declaration of Infineon TLE98X internal flash.
;
; @Description:
; Synopsis:
;
; DO tle988x [PREPAREONLY] [CPU=<cpu>]
;
; Description:
;
; Script arguments are not case sensitive.
;
; PREPAREONLY only declares flash but does not execute flash programming
;
; CPU=<cpu> selects CPU derivative <cpu>. <cpu> can be CPU name out of the
; table listed below. For these derivatives the flash declaration
; is done by the script.
;
; Example:
;
; DO ~~/demo/arm/flash/tle988x CPU=TLE98932QTW62S PREPAREONLY
;
; List of TLE98X derivatives and their configuration:
;
; CPU-Type Flash0 Flash1 PSRAM
; --------------------------------------------------------------------------------
; TLE9881* 24KB 120KB 8KB
; TLE9883* 24KB 248KB 8KB
; TLE9891* 24KB 120KB 8KB
; TLE9893* 24KB 248KB 8KB
;
; @Author: STK
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Rev: 12698 $
; $Id: tle988x.cmm 12698 2023-11-08 08:13:33Z skrausse $
;
LOCAL &parameters
ENTRY %LINE &parameters
LOCAL &param_prepareonly
&param_prepareonly=(STRing.SCAN(STRing.UPpeR("&parameters"),"PREPAREONLY",0)!=-1)
LOCAL &param_cpu
&param_cpu=STRing.SCANAndExtract(STRing.UPpeR("&parameters"),"CPU=","")
; ------------------------------------------------------------------------------
; Start debugging
IF SYStem.MODE()<5
(
SYStem.RESet
IF "&param_cpu"!=""
SYStem.CPU &param_cpu
IF !CPUIS(TLE98*)
SYStem.CPU TLE98932QTW62S
SYStem.Mode.Attach
Break
Register.Set XPSR 0x01000000
)
; ------------------------------------------------------------------------------
; Flash declaration
FLASH.RESet
GOSUB FlashDeclaration
; Flash script ends here if called with parameter PREPAREONLY
IF &param_prepareonly
ENDDO PREPAREDONE
; ------------------------------------------------------------------------------
; Flash programming example
DIALOG.YESNO "Program flash memory?"
LOCAL &progflash
ENTRY &progflash
IF &progflash
(
FLASH.ReProgram.ALL /Erase
Data.LOAD.auto *
FLASH.ReProgram.off
; Reset device
SYStem.Down
SYStem.Up
)
ENDDO
--------------------------------------------------------------------------------
Flash declaration depending on selected CPU
FlashDeclaration:
LOCAL &Flash0Size &Flash1Size &EepromSize &FlashDriver &PageSize
&Flash0Size=0x0
&Flash1Size=0x0
&EepromSize=0x2000
&SectorSize=0x1000
&FlashDriver="tle988aa.bin"
IF CPUIS(TLE9881*)
(
&Flash0Size=0x8000
&Flash1Size=0x1E000
)
ELSE IF CPUIS(TLE9891*)
(
&Flash0Size=0x8000
&Flash1Size=0x1E000
)
ELSE IF CPUIS(TLE9883*)
(
&Flash0Size=0x8000
&Flash1Size=0x3E000
)
ELSE IF CPUIS(TLE9893*)
(
&Flash0Size=0x8000
&Flash1Size=0x3E000
)
ELSE
(
PRINT %ERROR "FLASH size of CPU type is not supported by the script"
ENDDO
)
FLASH.Create 1. 0x11000000++(&Flash0Size-1) &SectorSize TARGET Long
FLASH.CHANGEtype (0x11000000+&Flash0Size-0x2000)++(0x2000-1) NOP /INFO "EEPROM"
FLASH.Create 2. 0x12002000++(&Flash1Size-1) &SectorSize TARGET Long
IF (("&param_dualport"!="1")||SYStem.ACCESS.DENIED())
FLASH.TARGET 0x18001000 0x18002000 0x1000 ~~/demo/arm/flash/long/&FlashDriver
ELSE
FLASH.TARGET 0x18001000 0x18002000 0x1000 ~~/demo/arm/flash/long/&FlashDriver /DualPort
RETURN