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

140 lines
3.6 KiB
Plaintext

; --------------------------------------------------------------------------------
; @Title: Generic script for Fujitsu MB9B460L series internal flash
;
; @Description:
;
; Example for flash declaration and programming of Fujitsu MB9B460L series
; internal flash.
;
; Script arguments:
;
; DO mb9b460l [CPU=<cpu>] [PREPAREONLY]
;
; CPU=<cpu> selects CPU derivative <cpu>
;
; PREPAREONLY only declares flash but does not execute flash programming
;
; Example:
;
; DO ~~/demo/arm/flash/mb9b460l CPU=MB9BF466L PREPAREONLY
;
; List of MB9B460L series derivatives and their configuration:
;
; CPU-Type Main Flash Work Flash RAM
; [kB] [kB] [kB]
; --------------------------------------------------------------------------------
; MB9BF464K 246. 32. 32.
; MB9BF464L 246. 32. 32.
; MB9BF465K 384. 32. 48.
; MB9BF465L 384. 32. 48.
; MB9BF466K 512. 32. 64.
; MB9BF466L 512. 32. 64.
;
; @Chip: MB9BF46?K MB9BF46?L
; @Author: WRD
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Rev: 10516 $
; $Id: mb9b460l.cmm 10516 2022-02-02 11:39:30Z bschroefel $
;
LOCAL &parameters
ENTRY %LINE &parameters
LOCAL &param_cpu &param_prepareonly
&param_prepareonly=(STRing.SCAN(STRing.UPpeR("&parameters"),"PREPAREONLY",0)!=-1)
&param_cpu=STRing.SCANAndExtract(STRing.UPpeR("&parameters"),"CPU=","")
; ------------------------------------------------------------------------------
; Start debugging
IF SYStem.MODE()<5
(
Break.RESet
SYStem.RESet
IF "&param_cpu"!=""
SYStem.CPU &param_cpu
IF !CPUIS(MB9BF46?K)&&!CPUIS(MB9BF46?L)
SYStem.CPU MB9BF46*
IF CABLE.TWOWIRE()
SYStem.CONFIG.DEBUGPORTTYPE SWD
ELSE
SYStem.CONFIG.DEBUGPORTTYPE JTAG
SYStem.Option.ResBreak OFF
SYStem.Up
)
; ------------------------------------------------------------------------------
; 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 &FlashSize
IF CPUIS("MB9BF464?")
&FlashSize=0x40000
ELSE IF CPUIS("MB9BF465?")
&FlashSize=0x60000
ELSE IF CPUIS("MB9BF466?")
&FlashSize=0x80000
ELSE
(
PRINT %ERROR "FLASH size of CPU type is unknown"
ENDDO
)
; Program flash
IF &FlashSize>=0x40000
(
FLASH.Create 1. 0x000000--0x007FFF 0x2000 TARGET Long
FLASH.Create 1. 0x008000--0x00FFFF 0x8000 TARGET Long
FLASH.Create 1. 0x010000--0x03FFFF 0x10000 TARGET Long
)
IF &FlashSize>=0x60000
(
FLASH.Create 1. 0x040000--0x05FFFF 0x10000 TARGET Long
)
IF &FlashSize>=0x80000
(
FLASH.Create 1. 0x060000--0x07FFFF 0x10000 TARGET Long
)
; Work flash
FLASH.Create 2. 0x200C0000--0x200C7FFF 0x2000 TARGET Word
FLASH.TARGET 0x1FFFF000 0x20000000 0x1000 ~~/demo/arm/flash/word/fm4.bin
RETURN