Keil Logo

Debug Script Template

The µVision debugger allows you to construct and execute a sequence of debugger commands using a script file. Using the ULINKplus VTREG IO pins, you can create and run your own test scripts to generate external signal patterns for testing your target board and application.

The Debug_UlinkPlus.ini initialization file may be used as a template to help you get started creating your own test automation scripts. This is an executable debugger script file that:

  • Includes a Configuration Wizard script to manually configure the ULINKplus IO test pins.
  • Contains several debug functions demonstrating how to create digital signals and analog voltage patterns.
  • Creates a Toolbox for easy test execution from the debugger.

The template file is located on your installation drive at [installation_path]\ARM\ULINK\Template\. The default [installation_path] is C:\Keil_V5.

The debug functions in the template are simple examples of how to manipulate the IO pins to create digital and analog signals. Click a button on the Toolbox to run an example. Here is a brief description of each example function:

Toolbox button Description
5x Toggle pin #1 Toggles pin 1 five times with a 100 ms wait after changing the state of the pin.
TableOut 250 ms Creates four signals using pins 0, 1 and 2 with a 250 ms wait between signal changes.
TableSweep 500 ms Generates an analog sweep of fixed voltages from 0.0 to 3.0 volts on pin 7 with a 500 ms delay between voltage changes.
StepSweep 100 ms Generates an analog sweep from 0.0 to 3.3 volts on pin 7 increasing the voltage 0.5 volts every 100 ms.

As an example, take a look at the code of the TogglePin function:

FUNC void TogglePin (uint32_t pin, uint32_t interval, uint32_t count) {
  uint32_t i;

  printf ("%d times toggle pin %d @ state time %d mSec  \n", count, pin, interval);

  for (i = 0; i < count; i++)  {
    ULINK_OUT |= (1 << pin);
    _sleep_ (interval);
    ULINK_OUT &= ~(1 << pin);
    _sleep_ (interval);
  }
  printf ("TogglePin done...\n");
}

Note

  • Please make sure you configure the pins used by a function prior to running the function.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.