Keil Logo

Technical Support

On-Line Manuals

µVision User's Guide

About µVision User Interface Creating Applications Debugging Start Debugging Start Energy Measurement without Debug Application Program Execution Debug Windows and Dialogs Breakpoints Window Call Stack and Locals Window Code Coverage Command Window Component Viewer Disassembly Window Editor Window Event Recorder Setup Event Recorder Event Recorder Window Events Filtering Event Statistics Window Post-mortem Analysis Event Viewer Execution Profiler Instruction Trace Window System Analyzer Usage tips Save System Analyzer Contents Statistics Restrictions Logic Analyzer Setup Setup in Detail Restrictions Cortex-M Trace Configuration Memory Map Memory Window Performance Analyzer Registers Window Serial Window Debug (printf) Viewer Symbols Window System Viewer Adding System Viewer Windows System and Thread Viewer Thread States Toolbox Trace Data Window Trace Navigation Trace Exceptions Event Counters ULINKplus Window Watch Window Core Peripherals Cortex-M0 and Cortex-M0+ Nested Vector Interrupt Controller System Control and Configuration System Tick Timer Fault Reports (Cortex-M0+ only) Cortex-M3, Cortex-M4, and Cortex-M7 Nested Vector Interrupt Controller System Control and Configuration System Tick Timer Fault Reports Memory Protection Unit Cortex-M23 and Cortex-M33 Nested Vector Interrupt Controller System Control and Configuration System Tick Timer Fault Reports Memory Protection Unit Security Attribution Unit Debug Scripting Expressions Constants System Variables Peripheral Variables I/O Ports Serial Ports Program Variables (Symbols) Fully Qualified Symbols Non-Qualified Symbols Literal Symbols Using Symbols Line Numbers Bit Addresses Type Specifications Memory Attribution Specifiers Operators Differences between µVision and C Expression Examples Code and Data Trace (Cortex-M) Trace Features Configuring Trace Tracepoint Expressions Tracepoint Intrinsics Tracepoint Limitations Tracepoint Marks Tips and Tricks Review Peripherals and CPU Configuration Simulate I/O Ports Simulate Interrupts and Clock Inputs Simulate external I/O Devices Assign Serial I/O to a PC COM Port Check Illegal Memory Access Command Input from File Preset I/O Ports or Memory Contents Write Debug Output to a File Keyboard Shortcuts TPIU Initialization after RESET (Cortex-M) Prevent Opening Files Show Japanese Messages Debug Commands Debug Functions Simulation Flash Programming Dialogs Utilities Command Line Example Programs Appendix

Expression Examples

The following expressions were entered in the Command page of the Output Window. All applicable output is included with each example. The MEASURE example program were used for all examples.

Constant
>0x1234                               /* Simple constant */
0x1234                                /* Output */
>EVAL 0x1234
4660T 11064Q 1234H '...4'             /* Output in several number bases */
Register
>R1                                   /* Interrogate value of register R1 */
0x000A                                /* Address from ACC = 0xE0, mem type = D: */
>R1 = --R7                            /* Set R1 and R7 equal to value R7-1 */
Function Symbol
>main                                 /* Get address of main() from MEASURE.C */
0x00233DA                             /* Reply, main starts at 0x233DA */

>&main                                /* Same as before */
0x00233DA

>d main                               /* Display: address = main */
0x0233DA: 76 E2 00 04 76 E3 00 04 - 66 E3 FF F7 E6 B6 80 00 v...v...f......
0x0233EA: E6 B7 00 00 E6 5A 40 00 - E6 D8 11 80 E6 2A 3C F6 .....Z@......*<
0x0233FA: E6 28 3C F6 E6 CE 44 00 - BF 88 E6 A8 40 00 BB D8 .(<...D.....@..
0x02340A: E6 F8 7A 40 CA 00 CE 39 - E6 F8 18 44 CA 00 CE 39 ..z@...9...D...
Address Utilization Examples
>&\measure\main\cmdbuf[0] + 10                         /* Address calculation */
0x23026

>_RBYTE (0x233DA)                                      /* Read byte from code address 0x233DA */
0x76 /* Reply */
Symbol Output Examples
>dir \measure\main                                     /* Output symbols from main() in module MEASURE */
  R14 idx . . . uint                                   /* Output */
  R13 i . . . uint
  0x0002301C cmdbuf . . . array[15] of char
Program Counter Examples
>$ = main                                             /* Set program counter to main() */
>dir                                                  /* points to local mem sym. from main() */
    R14 idx . . . uint                                /* Output */
    R13 i . . . uint
    0x0002301C cmdbuf . . . array[15] of char
Program Variable Examples
>cmdbuf                                               /* Interrogate address from cmdbuf */
0x0002301C                                            /* Output of address due to aggregate type (Array)*/
>cmdbuf[0]                                            /* Output contents of first array element */
0x00
>i                                                    /* Output contents from i */
0x00
>idx                                                  /* Output contents from idx */
0x0000
>idx = DPP2                                           /* Set contents from index equal to register DPP2 */
>idx                                                  /* Output contents from idx */
0x0008
Line Number Examples
>\163                                                 /* Address of the line number #104 */
0x000230DA                                            /* Reply */
>\MCOMMAND\91                                         /* A line number of module MCOMMAND */
0x000231F6
Operator Examples
>--R5                                                 /* Auto-decrement also for CPU registers */
0xFE
>mdisplay                                             /* Output a PUBLIC bit variable */
0
>mdisplay = 1                                         /* Change */
>mdisplay                                             /* Check result */
1
Structure Examples
>save_record[0]                                       /* Address of a record */
0x002100A
>save_record[0].time.hour = DPP3                      /* Change struct element of records */

>save_record[0].time.hour /* Interrogation */
0x03
µVision Debug Function Invocation Examples
>printf ("µVision is coming!\n")                      /* String constant within printf() */
µVision is coming!                                    /* Output */
>_WBYTE(0x20000, _RBYTE(0x20001))                     /* Read & Write Memory Byte */
>                                                     /* example useful in debug functions */
>interval.min = getint ("enter integer: ");
Fully Qualified Symbol Examples
>--\measure\main\idx /* Auto INC/DEC valid for qualified symbol */
0xFFFF
Fully Qualified Symbol Examples for Cortex-M
BS \\cpp_template\../../source/RVCT/STM32F10x.s\146, 1
BS \\cpp_template\_numeric.CC\293, 1
  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.