114 lines
3.2 KiB
Plaintext
114 lines
3.2 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: Example for flash declaration of Maxim Integrated MAX3266X internal flash.
|
|
;
|
|
; @Description:
|
|
; Script arguments:
|
|
;
|
|
; DO max3266x [PREPAREONLY] [CPU=<cpu>] [DUALPORT=0|1]
|
|
;
|
|
; PREPAREONLY only declares flash but does not execute flash programming
|
|
;
|
|
; CPU=<cpu> selects CPU derivative <cpu>
|
|
;
|
|
; DUALPORT default value is 0 (disabled). If DualPort mode is enabled
|
|
; flash algorithm stays running until flash programming is
|
|
; finished. Data is tranferred via dual port memory access.
|
|
;
|
|
; Example:
|
|
;
|
|
; DO ~~/demo/arm/flash/max3266x PREPAREONLY DUALPORT=1 CPU=MAX32666-CPU0
|
|
;
|
|
; List of MAX3266X derivatives and their configuration:
|
|
;
|
|
; CPU-Type Flash size SRAM size
|
|
; [Byte] [Byte]
|
|
; --------------------------------------------------------------------------------
|
|
; MAX3266X 0x100000 0x8C000
|
|
;
|
|
; The internal flash is located at 0x10000000
|
|
; The internal SRAM is located at 0x20000000
|
|
;
|
|
; @Author: BWR
|
|
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; --------------------------------------------------------------------------------
|
|
; $Rev: 10516 $
|
|
; $Id: max3266x.cmm 10516 2022-02-02 11:39:30Z bschroefel $
|
|
|
|
LOCAL ¶meters
|
|
ENTRY %LINE ¶meters
|
|
|
|
LOCAL ¶m_prepareonly ¶m_dualport ¶m_cpu
|
|
¶m_prepareonly=(STRing.SCAN(STRing.UPpeR("¶meters"),"PREPAREONLY",0)!=-1)
|
|
¶m_cpu=STRing.SCANAndExtract(STRing.UPpeR("¶meters"),"CPU=","")
|
|
¶m_dualport=STRing.SCANAndExtract(STRing.UPpeR("¶meters"),"DUALPORT=","0")
|
|
|
|
; ------------------------------------------------------------------------------
|
|
; Setup CPU
|
|
|
|
IF SYStem.MODE()<5
|
|
(
|
|
SYStem.RESet
|
|
|
|
IF "¶m_cpu"!=""
|
|
SYStem.CPU ¶m_cpu
|
|
IF !CPUIS(MAX3266*)
|
|
SYStem.CPU MAX3266*
|
|
|
|
SYStem.CONFIG.DEBUGPORTTYPE SWD
|
|
IF COMBIPROBE()||UTRACE()
|
|
(
|
|
SYStem.CONFIG.CONNECTOR MIPI20T
|
|
)
|
|
SYStem.Option DUALPORT ON
|
|
SYStem.MemAccess DAP
|
|
SYStem.JtagClock CTCK 10MHz
|
|
Trace.DISable
|
|
|
|
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?"
|
|
LOCAL &progflash
|
|
ENTRY &progflash
|
|
IF &progflash
|
|
(
|
|
FLASH.ReProgram.ALL /Erase
|
|
Data.LOAD.auto *
|
|
FLASH.ReProgram.off
|
|
)
|
|
|
|
ENDDO
|
|
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Flash declaration depending on selected CPU
|
|
|
|
FlashDeclaration:
|
|
LOCAL &DualPort
|
|
ENTRY &DualPort
|
|
|
|
LOCAL &FlashSize
|
|
|
|
; Program Flash
|
|
FLASH.Create 1. 0x10000000++0x000FFFFF 0x2000 TARGET Long
|
|
|
|
IF &DualPort==0
|
|
FLASH.TARGET 0x20000000 0x20001000 0x2000 ~~/demo/arm/flash/long/max3266x.bin
|
|
ELSE
|
|
FLASH.TARGET 0x20000000 EAHB:0x20001000 0x2000 ~~/demo/arm/flash/long/max3266x.bin /DualPort
|
|
|
|
RETURN
|