; -------------------------------------------------------------------------------- ; @Title: Load the Position Independent Terminal example (DCC mode) ; @Description: ; Load the position independent t32term demo for ARM7/9/11, XSCALE, CortexA/R ; into RAM. ; The example shows how a simple terminal can be implemented using TRACE32 ; and mrc/mcr instructions. The DCC mode transfers one byte with every ; transaction. ; When to use this terminal method? ; => ARM7/9/11, XSCALE, CortexA/R ; => low protocol overhead, low bandwidth ; For more information please check ~~/pdf/debugger_arm.pdf ; ; Prerequisites: ; * System is connected ; * RAM is accessible Read/Write/Execute ; ; Usage: ; DO ~~/demo/arm/etc/virtual_terminal/dcc_based/demo_term_dcc ; e.g. DO ~~/demo/arm/etc/virtual_terminal/dcc_based/demo_term_dcc 0x1000 ; @Author: AME ; @Copyright: (C) 1989-2019 Lauterbach GmbH, licensed for use with TRACE32(R) only ; -------------------------------------------------------------------------------- ; $Id: demo_term_dcc.cmm 15223 2019-11-05 16:29:45Z bschroefel $ PRIVATE ¶m &offset ENTRY ¶m ; -------------------------------------------------------------------------------- ; Prerequisites: Simulator? Connected? IF INTERFACE.SIM() ( PRINT %ERROR "Error: This demo does not work with the simulator." ENDDO FALSE() ) IF !SYSTEM.UP() ( PRINT %ERROR "Error: Please connect to the CPU first." ENDDO FALSE() ) IF STATE.RUN() Break GOSUB ParseParameters ¶m RETURNVALUES &offset IF (STRing.SCAN(CORENAME(),"ARM7",0)>=0)||(STRing.SCAN(CORENAME(),"ARM9",0)>=0) ( Data.LOAD.Elf ~~~~/term_demo_dcc_pic_arm7_arm9.elf &offset /RelPATH /Verify ) ELSE IF (STRing.SCAN(CORENAME(),"ARM11",0)>=0)||(STRing.SCAN(CORENAME(),"CORTEXA",0)>=0) ( Data.LOAD.Elf ~~~~/term_demo_dcc_pic_arm11_cortex.elf &offset /RelPATH /Verify ) ELSE IF (STRing.SCAN(CORENAME(),"XSCALE",0)>=0) ( Data.LOAD.Elf ~~~~/term_demo_dcc_pic_xscale.elf &offset /RelPATH /Verify ) ELSE IF (STRing.SCAN(CORENAME(),"CORTEXR",0)>=0) ( IF ((Data.Long(C15:0x1)&0x80000000)!=0x0) ( IF VERSION.BUILD.BASE()>=77512. ( Data.LOAD.Elf ~~~~/term_demo_dcc_pic_arm11_cortex_be.elf &offset /RelPATH /Verify ) ELSE ( PRINT %ERROR "Error: Please use more recent software. Contact support@lauterbach.com." ENDDO FALSE() ) ) ELSE Data.LOAD.Elf ~~~~/term_demo_dcc_pic_arm11_cortex.elf &offset /RelPATH /Verify ) ELSE ( PRINT %ERROR "Error: Coretype not supported by this script." ENDDO FALSE() ) ; -------------------------------------------------------------------------------- ; preboot executable - run to *main* Go main\1 WAIT !STATE.RUN() ; setup the terminal TERM.RESet TERM.METHOD DCC TERM.view ; start the demo Go ENDDO TRUE() ; -------------------------------------------------------------------------------- ; SUBROUTINES ; ParseParameters: ;(param) ( PRIVATE ¶m &offset ENTRY ¶m &offset=STRing.SCANAndExtract("¶m","0x","") IF "&offset"=="" ( PRINT %ERROR "Error: Missing Argument - Usage DO demo_term_dcc.cmm 0x " ENDDO FALSE() ) ; ensure parameter is HEX and round down to the nearest LONG &offset="0x&offset" &offset=(&offset)&~0x3 IF !SYStem.Up() ( PRINT %ERROR "Error: Not connected to target. - Please use SYStem.Up before." ENDDO FALSE() ) RETURN "&offset" )