Bare Metal User Guide

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

1.6.2.2.3. Download and Debug 'Hello World' Example in the SDRAM Memory

  1. Select Run > Debug Configurations.
    Select the same debug configuration.
    Figure 37. Bare Metal "Hello World" Config Debugger
  2. Select Debug to launch.
    Figure 38. Run "Hello World" from SDRAM Stops at Main

    You should notice in the Commands view that the entry point is now S:0x02000000, which is the beginning of the mapped SDRAM.

  3. Click on the “Step Over Source Line” icon or press F6 to see the program counter progress to the next source line.
  4. Click it again to see the "!!!Hello World!!!" message in the App Console view.
    If the App Console view is not currently selected, then the letters are highlighted in bold letters to indicate that there is a message. Select the App Console view to see the output.
    Figure 39. Bare Metal "Hello World" App Console
  5. Select Continue to finish executing the program.
    Figure 40. Bare Metal "Hello World" App Console End
  6. To rerun, select the debug connection from the list in the Debug Control view. In this case, it is “bare-metal-hello-world-01”; and click the yellow arrow.
    This runs the same debug configuration again (and run from Main).
  7. When you are finished with this application, you can disconnect it from the target. To disconnect, right click on the Debug Connection and then click on the “Disconnect from Target”.
    Figure 41. Bare Metal "Hello World" App Console Disconnected
    It is not necessary to remove the disconnected debug connection from the Debug Control view; however, it can be removed since it only needs to run once.
    Note: If you do not remove a disconnected debug connection, then you can re-launch the configuration by selecting it from the Debug Control view and clicking the Connect to Target icon above it.

    Don’t forget that if you reboot the board, then you have to run the Preloader to configure the memory controller before running an application in SDRAM. One quick way to do this is to keep the disconnected debug connection in the Debug Control view; then select it and click on “Connect to Target”. This reproduces the previous launch.

  8. When you are completely finished with this application, you can remove it from the Debug Control view. The connections must be disconnected in order to remove them. To disconnect, select the Debug Connection and then click on the “Disconnect from Target”. Once disconnected you can select “Remove Connection” or “Remove All Connections”.
  9. After removing the Debug Connection from the Debug Control view, rerun the Preloader by using the Debug Configuration that was created for the Preloader. Rerun the demo, using the Debug Configuration that was created for the "Hello World" application.