; --------------------------------------------------------------------------------
; @Title: TRACE32 load STM Trace Demo
; @Description: 
;   This is a demo to load and display STM data
; @Author: ING
; @Copyright: (C) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: load_csstm.cmm 9952 2016-09-06 19:16:20Z irohloff $

  WinCLEAR

  AREA.Create A000 100. 500.

  SYStem.RESet
  SYStem.CPU STM32F103ZE

// Make "stm." commands available
// Fake a CoreSight STM module
//
// WARNING: 
//   These commands are only available in recent versions of the TRACE32 sw
; Make "stm." commands available
; Fake an ARM STM module
;
; WARNING: 
;   These commands are only available in recent versions of the TRACE32 sw

  SYStem.CONFIG.STM TYPE ARM
  SYStem.CONFIG.STM stpv2 3
  SYStem.CONFIG.STM base 0xE0001000
// Fake that the ARM STM module has ATB ID 4
  STM.TraceID 4

// Fake ITM with ATB ID 5,
  ITM.TraceID 5

// For displaying a raw ATB byte stream
  SYStem.CONFIG dtmconfig ON
  DTM.Mode Byte
  DTM.TraceID  6

  SYStem.Up

; Make sure that "CAnalyzer.list" calls STM decoder for TPIU in continuous mode.
  CAnalyzer.DecodeMode CSSTM

; Init
  CAnalyzer.Init

; load fake data
  CAnalyzer.PipeLOAD tpiu.bin

; Show data from all three CoreSight Trace Sources
  WinPOS 0 0 66. 46.
  STMCAnalyzer.List TP TPC CYcle Address Data /TRACK

  WinPOS 70. 0. 61. 46.
  ITMCA.List TP TPC CYcle Address Data /TRACK

  WinPOS 135. 0. 39. 46.
  DTMCA.List TP TPC Data /TRACK

  STMCAnalyzer.GOTO 0.

