117 lines
3.4 KiB
Plaintext
117 lines
3.4 KiB
Plaintext
; ---------------------------------------------------------------------------------
|
|
; @Title: Flash declaration for Analog Devices ADuCM4xx internal Flash derivatives
|
|
;
|
|
; @Description:
|
|
; Script arguments:
|
|
; DO aducm4xx [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/aducm4xx 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 ADuCM4xx* derivatives:
|
|
; CPU-Type Flash Size
|
|
; [KB]
|
|
; --------------------------------
|
|
; ADuCM4050 512
|
|
;
|
|
; @Author: NEZ
|
|
; @Copyright: (C) 1989-2023 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; @Chip: ADuCM4*
|
|
; --------------------------------------------------------------------------------
|
|
; $Rev: 12165 $
|
|
; $Id: aducm4xx.cmm 12165 2023-06-01 16:59:20Z nzouari $
|
|
|
|
PRIVATE ¶meters
|
|
ENTRY %LINE ¶meters
|
|
|
|
PRIVATE ¶m_prepareonly ¶m_cpu ¶m_dualport
|
|
¶meters=STRing.UPpeR("¶meters")
|
|
¶m_prepareonly=(STRing.SCAN("¶meters","PREPAREONLY",0)!=-1)
|
|
¶m_cpu=STRing.SCANAndExtract("¶meters","CPU=","")
|
|
¶m_dualport=STRing.SCANAndExtract("¶meters","DUALPORT=","1")
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Initialize and start the debugger
|
|
|
|
IF !SYStem.Up()
|
|
(
|
|
SYStem.RESet
|
|
|
|
IF "¶m_cpu"!=""
|
|
SYStem.CPU ¶m_cpu
|
|
IF (!CPUIS(ADuCM4*))
|
|
SYStem.CPU ADuCM4*
|
|
|
|
SYStem.Option.ResBreak OFF
|
|
SYStem.CONFIG.DEBUGPORTTYPE SWD
|
|
SYStem.JtagClock 1MHz
|
|
SYStem.Up
|
|
)
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Flash declaration
|
|
FLASH.RESet
|
|
GOSUB FlashDeclaration "¶m_dualport"
|
|
|
|
; Flash script ends here if called with parameter PREPAREONLY
|
|
IF ¶m_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
|
|
)
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; 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 ¶m_dualport
|
|
PRIVATE &SRAMAddress &FlashSize &PageSize &FlashDriver
|
|
|
|
&FlashDriver="aducm4050.bin"
|
|
&PageSize=0x800 ;ERASEPAGE=2KB
|
|
|
|
; Determine Flash size
|
|
IF CPUIS(ADuCM4050)
|
|
&FlashSize=0x80000
|
|
ELSE
|
|
(
|
|
PRINT %ERROR "FLASH size of CPU type is not supported by the script"
|
|
ENDDO
|
|
)
|
|
|
|
FLASH.RESet
|
|
FLASH.Create 1. 0x00000000--0x0007EFFF &PageSize TARGET Quad /CENSORSHIP 0x0003FFF0--0x0003FFFF /INFO "Available User Space"
|
|
FLASH.Create 1. 0x0007F000--(&FlashSize-1) &PageSize NOP Quad /INFO "Protected Key Space"
|
|
|
|
FLASH.TARGET 0x20000000 0x20000800 0x400 ~~/demo/arm/flash/quad/&FlashDriver
|
|
|
|
RETURN
|
|
)
|