144 lines
3.6 KiB
Plaintext
144 lines
3.6 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: Example for flash declaration of Texas Instruments CC26xx internal flash
|
|
; @Description:
|
|
; Script arguments:
|
|
;
|
|
; DO cc2600 [PREPAREONLY] [CPU=<cpu>]
|
|
;
|
|
; PREPAREONLY only declares flash but does not execute flash programming
|
|
;
|
|
; CPU=<cpu> selects CPU derivative <cpu>
|
|
;
|
|
; Example:
|
|
;
|
|
; DO ~~/demo/arm/flash/cc2600 CPU=CC2650F128 PREPAREONLY
|
|
;
|
|
; List of CC26xx derivatives and their configuration:
|
|
;
|
|
; CPU-Type Flash size Page size SRAM size
|
|
; [Byte] [Byte] [Byte]
|
|
; CC2620F128 0x20000 0x1000 0x14000
|
|
; CC2630F128 0x20000 0x1000 0x14000
|
|
; CC2640F128 0x20000 0x1000 0x14000
|
|
; CC2650F128 0x20000 0x1000 0x14000
|
|
;
|
|
; CC2640R 0x20000 0x1000 0x05000
|
|
;
|
|
; CC2651R3 0x58000 0x2000 0x14000
|
|
;
|
|
; CC2642R 0x58000 0x2000 0x14000
|
|
; CC2652P 0x58000 0x2000 0x14000
|
|
; CC2652R 0x58000 0x2000 0x14000
|
|
; CC2662R 0x58000 0x2000 0x14000
|
|
;
|
|
; CC2652R7 0xB0000 0x2000 0x24000
|
|
;
|
|
; @Author: FLC
|
|
; @Chip: CC26?0F*
|
|
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; --------------------------------------------------------------------------------
|
|
; $Rev: 10546 $
|
|
; $Id: cc2600.cmm 10546 2022-02-07 18:27:50Z skrausse $
|
|
|
|
|
|
LOCAL ¶meters
|
|
ENTRY %LINE ¶meters
|
|
|
|
LOCAL ¶m_prepareonly ¶m_cpu
|
|
¶m_prepareonly=(STRing.SCAN(STRing.UPpeR("¶meters"),"PREPAREONLY",0)!=-1)
|
|
¶m_cpu=STRing.SCANAndExtract(STRing.UPpeR("¶meters"),"CPU=","")
|
|
|
|
; ------------------------------------------------------------------------------
|
|
; Setup CPU
|
|
|
|
IF SYStem.MODE()<5
|
|
(
|
|
SYStem.RESet
|
|
|
|
IF "¶m_cpu"!=""
|
|
SYStem.CPU ¶m_cpu
|
|
IF !CPUIS(CC26*)
|
|
SYStem.CPU CC26*
|
|
|
|
SYStem.CONFIG DEBUGPORTTYPE CJTAG
|
|
SYStem.Option ResBreak OFF
|
|
SYStem.JtagClock CTCK 1MHz
|
|
SYStem.Mode.Attach
|
|
)
|
|
|
|
; ------------------------------------------------------------------------------
|
|
; Flash declaration
|
|
|
|
FLASH.RESet
|
|
GOSUB FlashDeclaration
|
|
|
|
; 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
|
|
Data.LOAD.auto *
|
|
FLASH.ReProgram.off
|
|
|
|
; Reset device
|
|
SYStem.Down
|
|
SYStem.Up
|
|
)
|
|
|
|
ENDDO
|
|
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Flash declaration depending on selected CPU
|
|
|
|
FlashDeclaration:
|
|
LOCAL &FlashSize &FlashDriver
|
|
|
|
IF CPUIS("CC2620F128")||CPUIS("CC2630F128")||CPUIS("CC2640F128")||CPUIS("CC2650F128")
|
|
(
|
|
&FlashSize=0x20000
|
|
&FlashDriver="cc2600.bin"
|
|
)
|
|
ELSE IF CPUIS("CC2640*")
|
|
(
|
|
&FlashSize=0x20000
|
|
&FlashDriver="cc26x2.bin"
|
|
)
|
|
ELSE IF CPUIS("CC2652R7*")
|
|
(
|
|
&FlashSize=0xB0000
|
|
&FlashDriver="cc26x2.bin"
|
|
)
|
|
ELSE IF CPUIS("CC26?1*")||CPUIS("CC26?2*")
|
|
(
|
|
&FlashSize=0x58000
|
|
&FlashDriver="cc26x2.bin"
|
|
)
|
|
ELSE
|
|
(
|
|
PRINT %ERROR "FLASH size of CPU type is unknown"
|
|
ENDDO
|
|
)
|
|
|
|
IF &FlashSize>=0x58000
|
|
(
|
|
FLASH.Create 1. 0x00000000++(&FlashSize-1) 0x2000 TARGET Long
|
|
)
|
|
ELSE
|
|
(
|
|
FLASH.Create 1. 0x00000000++(&FlashSize-1) 0x1000 TARGET Long
|
|
)
|
|
|
|
|
|
FLASH.TARGET 0x20000000 0x20000800 0x800 ~~/demo/arm/flash/long/&FlashDriver
|
|
|
|
RETURN
|