Files
fail/scripts/t32cmm/armm3/init.cmm.in
Martin Hoffmann b8e706b1a5 T32SIM: Integrating Tracing feature of the T32SIM.
After each simulator break, T32Tracer retrieves the latest (16)
trace records from the T32. Memory address and value can now
be evaluated easily from the trace record.

TODO:Nevertheless we still have to traverse the trace to
find the instruction causing the access.
2013-03-21 18:57:46 +01:00

64 lines
1.2 KiB
Plaintext

;RESET
&t32scriptdir=OS.PPD()
;========================================================================
; CPU setup
SYStem.RESet
IF (SIMULATOR())
(
SYS.DOWN
AREA.view
SIM.UNLOAD
SIM.LOAD @T32_NVIC_LIB@
SIM.LIST
SYS.CPU cortexm3
SYS.UP
)
ELSE
(
if OS.FILE(&(t32scriptdir)/armm3cfg.cmm)
(
DO &(t32scriptdir)/armm3cfg.cmm
)
)
IF (SIMULATOR())
(
DATA.LOAD.ELF &appimage
; Copy first bytes to address 0 to make simulator work
DATA.COPY 0x8000000++0x200 0x00
; Load Stack pointer and Instruction Pointer
REGISTER.RES
; Be aware of the HACK!
; To get over the RCC Initialisation, we have to get to the second read
; of the RCC Register and inject some initilized looking values.
; for STM32
BREAK.SET 0x40021000 /Read /DISableHit /Count 2
GO
wait !state.run()
DATA.SET 0x40021000 %long ~0
DATA.SET 0x40021004 %long 0x8
)
else
(
;========================================================================
; Flash programming
;
DO &(t32scriptdir)/loadelf.cmm
)
;========================================================================
; Optional Parts
if OS.FILE(&(t32scriptdir)/t32term.cmm)
(
DO &(t32scriptdir)/t32term.cmm
)
ENDDO