Debugging Standalone Applications in the Vitis IDE - 2023.2 English

Zynq-7000 SoC Embedded Design Tutorial (UG1165)

Document ID
UG1165
Release Date
2024-05-02
Version
2023.2 English
  1. Highlight your application under Vitis Components, click the open settings icon for either Debug or Run under FLOW, and select New Launch Configuration.

    In Target Setup tab, fill the Hardware Platform field with the one exported by the Vivado™ Design Suite, and click the Debug button.

    ../_images/image58.png

    The Debug View opens.

    Note

    You can also quickly switch to the Debug View using the Debug icon on the left hand side of the Vitis IDE.

    ../_images/image59.png

    Note

    The addresses shown on this page might differ slightly from the addresses shown on your system.

    The processor is currently sitting at the beginning of main(). You can confirm this information in the Disassembly view, which shows the assembly-level program execution also suspended at the same address.

    Note

    If the Disassembly view is not visible, select View → Disassembly view.

  2. The helloworld.c window also shows execution suspended at the first executable line of C code.

    Note

    If the Registers view is not visible, select View → Register Inspector or Select Register Inspector from the icon on the right side of the IDE.

  3. Double-click in the margin of the helloworld.c window next to the line of code that reads init_platform() and print(). This sets the breakpoints at init_platform() and print(). To confirm the breakpoints, review the Breakpoints view.

  4. Select Run → Step Into to step into the init_platform() routine.

    The program executes one step. The call stack is now two levels deep.

  5. Select Run → Resume to continue running the program to the breakpoint.

    Program execution stops at the line of code that includes the print command.

    Note

    The execution address in your debugging window might differ if you modify the “Hello World” source code in any way.

  6. Select Run → Resume to run the program to conclusion.

    When the program completes, the Terminal view shows the Hello World print and the Debug view shows that the program is suspended in a routine called exit(). This happens when you are running under control of the debugger.

  7. Rerun your code several times. Experiment with single-stepping, examining memory, breakpoints, modifying code, and adding print statements. Try adding and moving views.

  8. Click the Stop button on the tool bar to disconnect to the board, or exit the Vitis software platform directly.

../_images/debug_icons.PNG

This chapter introduced standalone software building and debugging. In the next chapter, you can start working on Linux applications for Zynq 7000 SoCs.