Bare Metal User Guide

ID 683211
Date 11/30/2015
Public
Document Table of Contents

1.6.1.3. Build and Debug the Project

  1. Then, right click on the project and select "Build Project".
    The “Debug” build directory will be created and the compiled object modules will be placed there.
    Figure 13. Bare Metal "Hello World - 01" Built Done
  2. To download and debug the program, select Run > Debug Configurations.
  3. Right click on DS-5 Debugger and select New to create a new debug configuration.
    Figure 14. New Debug Configuration
  4. In the Connection tab, select Altera > Cyclone V SoC (Single Core) > Bare Metal Debug > Debug Cortex-A9_0 and select "USB-Blaster" from the Target Connection pull-down menu.
    Figure 15. New Debug Configuration Target Connection Setting
  5. Select an available Bare Metal Debug Connection by clicking Browse.
    This will return a list of the available debug connections.
    Figure 16. Connection Browser
  6. Select the hardware and then click Select. Change the name of the configuration from "New_Configuration" to "bare-metal-hello-world-config", and select Apply.
    Figure 17. Bare Metal Hello World Config Connection Settings
  7. Go to the Files tab and select the application to download by clicking “Workspace” and select the object module that was built, bare-metal-hello-world-01.axf.
    It should be in the Debug folder within the project. Make sure that “Load symbols” is selected, and then click on Apply.
    Figure 18. Bare Metal Hello World Config Files Settings
  8. Go to the Debugger tab and make sure that under Run control, Debug from symbol is set to "main".
    Figure 19. Bare Metal Hello World Config Debugger Settings
  9. Select Debug to load and debug the application.
    It runs a query to change to the DS-5 Debug Perspective. Select Yes.
    Figure 20. Confirm Perspective Switch
  10. It switches to the DS-5 Debug Perspective and then download and begin to run the application.
    The program stops at main and waits there. In the Commands view, notice the entry point is 0xFFFF0000, which is the start address specified in the scatter file for the on-chip RAM.
    Figure 21. OCRAM Debug Stop at Main
  11. Click the Step Over Source Line icon or press F6.
  12. Then "Step" again.
    The output appears on the App Console view.
    Figure 22. "App Console" Output
  13. Select Continue to exit out of the application.
  14. Create a breakpoint by double clicking on the left margin of the bare-metal-hello-world-0.1.c Source view. If the Breakpoints view is not shown, then open it by selecting: View > Show View > Breakpoints.
    Figure 23. Debug Breakpoint Setup