119 lines
3.2 KiB
Plaintext
119 lines
3.2 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: Example for flash declaration of Analog Devices ADuC7229 internal flash.
|
|
;
|
|
; @Description:
|
|
; Script arguments:
|
|
;
|
|
; DO aduc7229 [PREPAREONLY]
|
|
;
|
|
; PREPAREONLY only declares flash but does not execute flash programming
|
|
;
|
|
; Example:
|
|
;
|
|
; DO ~~/demo/arm/flash/aduc7229 PREPAREONLY
|
|
;
|
|
; List of ADuC722x derivatives and their configuration:
|
|
;
|
|
; CPU-Type FlashSize RamSize
|
|
; (KB) (KB)
|
|
; ----------------------------------
|
|
; ADuC7229 126. 8.
|
|
; ADuC7229 94. 8.
|
|
;
|
|
; Flash location:
|
|
; 126kB flash at 0x00000000--0x0001f7ff or 0x00080000--0x0009f7ff
|
|
; 94kB flash at 0x00000000--0x000177ff or 0x00080000--0x000977ff
|
|
;
|
|
; RAM location:
|
|
; 8kB RAM at 0x00040000--0x00041fff or 0x00000000--0x00001fff
|
|
;
|
|
; @Author: WRD
|
|
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; @Chip: ADuC7229
|
|
; --------------------------------------------------------------------------------
|
|
; $Rev: 10516 $
|
|
; $Id: aduc7229.cmm 10516 2022-02-02 11:39:30Z bschroefel $
|
|
|
|
LOCAL ¶meters
|
|
ENTRY %LINE ¶meters
|
|
|
|
LOCAL ¶m_prepareonly
|
|
¶m_prepareonly=(STRing.SCAN(STRing.UPpeR("¶meters"),"PREPAREONLY",0)!=-1)
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Set configuration values out of the CPU table above. If your CPU
|
|
; derivate is not listed please check the data sheet for matching
|
|
; flash configuration.
|
|
|
|
LOCAL &FlashBase
|
|
LOCAL &FlashSize
|
|
LOCAL &RamBase
|
|
|
|
; Example for ADuC7229 with 128kB flash
|
|
&FlashBase=0x00080000
|
|
&FlashSize=126.
|
|
&RamBase=0x00040000
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Start debugging
|
|
|
|
IF SYStem.MODE()<5
|
|
(
|
|
SYStem.RESet
|
|
SYStem.CPU ADUC7229
|
|
SYStem.Option EnReset OFF
|
|
SYStem.Up
|
|
)
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; 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.Erase.ALL
|
|
|
|
FLASH.Program.ALL
|
|
Data.LOAD.auto * /Word
|
|
FLASH.Program.off
|
|
)
|
|
|
|
ENDDO
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Flash declaration depending on configuration
|
|
|
|
FlashDeclaration:
|
|
|
|
IF &FlashSize==126.
|
|
(
|
|
FLASH.Create 1. (&FlashBase+0x00000)--(&FlashBase+0x0ffff) 0x200 TARGET Word
|
|
FLASH.Create 2. (&FlashBase+0x10000)--(&FlashBase+0x1f7ff) 0x200 TARGET Word
|
|
)
|
|
ELSE IF &FlashSize==94.
|
|
(
|
|
FLASH.Create 1. (&FlashBase+0x00000)--(&FlashBase+0x0ffff) 0x200 TARGET Word
|
|
FLASH.Create 2. (&FlashBase+0x10000)--(&FlashBase+0x177ff) 0x200 TARGET Word
|
|
)
|
|
ELSE
|
|
(
|
|
PRINT %ERROR "FLASH configuration is not supported by the script"
|
|
ENDDO
|
|
)
|
|
|
|
FLASH.TARGET &RamBase &RamBase+0x800 0x200 ~~/demo/arm/flash/word/aduc7220.bin
|
|
|
|
RETURN
|