; --------------------------------------------------------------------------------
; @Title: RTX-ARM Demo for TRACE32 RTOS Debugger
; @Description: 
;   This batchfile loads all necessary files to demonstrate
;   the RTOS Debugger for RTX-ARM.
; @Keywords: awareness, RTOS, rtxarm
; @Author: DIE
; @Chip: ARM920T
; @Copyright: (C) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: rtx.cmm 7821 2014-10-29 11:06:58Z kjmal $


 SCREEN.ON
 WinPAGE.RESet
 WinPOS 0. 25. 70. 7. 0. 0. W000
 AREA.view

; Debugger reset
 PRINT "resetting..."
 RESet

; initialize debugger
 PRINT "initializing..."
 SYStem.CPU ARM920T
 SYStem.Up
 
; load sample application
 PRINT "loading sample application..."
 Data.LOAD.Elf mailbox.axf
 
; patch some peripheral handling for simulator
 IF SIMULATOR()
 (
   Data.Assemble R:Reset_Handler+0x2c nop   ; waiting for PLL
   Data.Assemble T:os_dly_wait bx r14
   Data.Assemble T:fputc+0x0a nop
   Data.Assemble T:fputc+0x14 nop
 )
 
; initialize RTOS support
 PRINT "initializing RTX-ARM support..."
 TASK.CONFIG rtx            ; load RTX-ARM awareness (rtx.t32)
 MENU.ReProgram rtx         ; load RTX-ARM menu (rtx.men)
 HELP.FILTER.Add rtosrtxarm ; add RTX-ARM awareness manual to filtered help

 PRINT "load complete."

; open some windows
 WinPOS 0. 0. 80. 20.
 List.auto
 WinPOS 35. 22. 70. 4.
 TASK.TASK

; set some breakpoints into sample application
 Break.Set send_task
 Break.Set rec_task
 Break.Set os_idle_demon
 
; start application
 Go

 ENDDO
 
