97 lines
2.6 KiB
Plaintext
97 lines
2.6 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: Example for flash declaration of Samsung HART-M310 internal flash
|
|
;
|
|
; @Description:
|
|
; Script arguments:
|
|
;
|
|
; DO hartm310 [PREPAREONLY]
|
|
;
|
|
; PREPAREONLY only declares flash but does not execute flash programming
|
|
;
|
|
; Example:
|
|
;
|
|
; DO ~~/demo/arm/flash/hartm330 PREPAREONLY
|
|
;
|
|
; Device: A33G538
|
|
; FlashROM: 768KB(384KB+384KB) Start address: 0x0
|
|
; DataFlashROM: 32KB Start address: 0x0F00_0000
|
|
; SRAM: 24KB Start address: 0x2000_0000
|
|
; Read protection: 512B Start address: 0x0020_0000
|
|
; Bank swap: 512B Start address: 0x0040_0000
|
|
;
|
|
; @Author: FAL
|
|
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; @Chip:
|
|
; --------------------------------------------------------------------------------
|
|
; $Rev: 12719 $
|
|
; $Id: hartm330.cmm 12719 2023-11-14 13:47:01Z mschaeffner $
|
|
|
|
LOCAL ¶meters
|
|
ENTRY %LINE ¶meters
|
|
|
|
LOCAL ¶m_prepareonly
|
|
¶m_prepareonly=(STRing.SCAN(STRing.UPpeR("¶meters"),"PREPAREONLY",0)!=-1)
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; CPU setup
|
|
|
|
IF SYStem.MODE()<5
|
|
(
|
|
SYStem.RESet
|
|
|
|
ON ERROR GOSUB ErrorSystemCPU
|
|
SYStem.CPU HARTM330 ;A33G538
|
|
ON ERROR
|
|
SYStem.Option.ResBreak OFF
|
|
SYStem.Option.WaitReset 100.ms
|
|
|
|
SYStem.Up
|
|
)
|
|
|
|
; Setup flash wait states to 3 wait cycle for code and data flash
|
|
;Data.Set 0x40000100 %Word 0x0202
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; Flash declaration
|
|
|
|
FLASH.RESet
|
|
|
|
; Program flash
|
|
FLASH.Create 1. 0x00000000--0x000bffff 0x800 TARGET Long
|
|
; Data flash
|
|
FLASH.Create 2. 0x0f000000--0x0f007fff 0x800 TARGET Byte
|
|
|
|
FLASH.TARGET 0x20000000 0x20001000 0x1000 ~~/demo/arm/flash/byte/hartm330.bin
|
|
|
|
; 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
|
|
|
|
; Reset device
|
|
SYStem.Down
|
|
SYStem.Up
|
|
)
|
|
|
|
ENDDO
|
|
|
|
|
|
; --------------------------------------------------------------------------------
|
|
; CPU selection for the case selection HART-M310 is not supported by
|
|
; Trace32 software version.
|
|
|
|
ErrorSystemCPU:
|
|
SYStem.CPU CortexM3
|
|
RETURN
|