11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Target script fileThe target interface system uses CrossStudios JavaScript (ECMAScript) interpreter tosupport board and target-specific behaviour.The main use <strong>for</strong> this is to support non-standard target and board reset schemes andalso to configure the target after reset, see Reset Script <strong>for</strong> more in<strong>for</strong>mation.The target script system can also be used to carry out target specific operations whenthe debugger attaches, stops or starts the target. This can be useful when debuggingwith caches enabled as it provides a mechanism <strong>for</strong> the debugger to flush and disablecaches when the processor enters debug state and then re-enable the caches when theprocessor is released into run state. See Attach Script, Stop Script, and Run Script <strong>for</strong>more in<strong>for</strong>mation.In order to reduce script duplication, when the target interface runs a reset, attach, runor stop script it first looks in the current active project <strong>for</strong> a file marked with a projectproperty File Type set to Reset Script. If a file of this type is found it will be loadedprior to executing the scripts, each of the scripts can then call functions within thisscript file.Reset ScriptThe Reset Script property held in the Target project property group is used to define ascript to execute to reset and configure the target.The aim of the reset script is to get the processor into a known state. When the scripthas executed the processor should be reset, stopped on the first instruction andconfigured appropriately.As an example, the following script demonstrates the reset script <strong>for</strong> an Evaluator 7Ttarget board with a memory configuration that re-maps SRAM to start from0x00000000. The Evaluator7T_Reset function carries out the standard <strong>ARM</strong> reset andstops the processor prior to executing the first instruction. TheEvaluator7T_ResetWithRamAtZero function calls this reset function and thenconfigures the target memory by accessing the configuration registers directly. SeeTargetInterface Object <strong>for</strong> a description of the TargetInterface object which is used bythe reset script to access the target hardware.function Evaluator7T_Reset(){TargetInterface.setNSRST(0);TargetInterface.setICEBreakerBreakpoint(0, 0x00000000, 0xFFFFFFFF,0x00000000, 0xFFFFFFFF, 0x100,0xF7);TargetInterface.setNSRST(1);TargetInterface.waitForDebugState(1000);TargetInterface.trst();}Chapter 14Target script file159

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!