Variables in IAR

To view Global Variables, do either of the following.

  • Right-click on the variable.

    • Select Add to Watch: varName.

  • Select ViewWatch

    • Enter the name of the variable.

../_images/iar_watch.png

Variable watch window. Note that you can cast values, get address and sizeof, etc.

View –> Locals show the local variables in IAR.

../_images/iar_locals.png

Local variables. This screenshot is taken during execution of the Simple Peripheral init function.

Note

IAR may remove the variable during optimization and inline the usage of the value. If so, add the __root directive in front.