127 lines
3.6 KiB
Plaintext
127 lines
3.6 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: Flash declaration for TI CC3200 internal flash
|
|
; @Description:
|
|
; Script arguments:
|
|
; DO cc3200 [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/cc3200 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 CC3200 derivatives and their configuration:
|
|
; CPU-Type Flash RamSize
|
|
; [byte] [byte]
|
|
; --------------------------------------------------------------------------------
|
|
; CC3220SF 1M 256KB
|
|
; CC3230SF 1M 256KB
|
|
; CC3235SF 1M 256KB
|
|
;
|
|
; @Chip: CC3220SF
|
|
; @Author: PHI
|
|
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; --------------------------------------------------------------------------------
|
|
; $Rev: 10516 $
|
|
; $Id: cc3200.cmm 10516 2022-02-02 11:39:30Z bschroefel $
|
|
|
|
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=","0")
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Initialize and start the debugger
|
|
IF !SYStem.Up()
|
|
(
|
|
SYStem.RESet
|
|
|
|
IF "¶m_cpu"!=""
|
|
SYStem.CPU ¶m_cpu
|
|
IF !CPUIS(CC32?0SF*)
|
|
SYStem.CPU CC32*
|
|
|
|
SYStem.MemAccess DAP
|
|
|
|
IF CABLE.TWOWIRE()
|
|
SYStem.CONFIG DEBUGPORTTYPE SWD
|
|
ELSE
|
|
SYStem.CONFIG DEBUGPORTTYPE JTAG
|
|
|
|
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
|
|
)
|
|
|
|
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 ¶m_dualport
|
|
PRIVATE &FlashDriver
|
|
|
|
IF CPUIS(CC3220SF*)
|
|
(
|
|
&FlashDriver="cc3200.bin"
|
|
)
|
|
ELSE IF !CPUIS(CC32*)
|
|
(
|
|
PRINT "CPU not supported by this script"
|
|
ENDDO
|
|
)
|
|
ELSE
|
|
(
|
|
PRINT SYStem.CPU()+ "has no internal flash"
|
|
ENDDO
|
|
)
|
|
|
|
FLASH.Create 1. 0x01000000++(0x100000-0x1) 0x800 TARGET LONG
|
|
|
|
IF (("¶m_dualport"!="1")||SYStem.ACCESS.DENIED())
|
|
FLASH.TARGET 0x20000000 0x20001000 0x1000 ~~/demo/arm/flash/long/&FlashDriver
|
|
ELSE
|
|
FLASH.TARGET 0x20000000 E:0x20001000 0x1000 ~~/demo/arm/flash/long/&FlashDriver /DualPort
|
|
|
|
RETURN
|
|
)
|