This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiling and running



To compile my code in CCS I have used Run->Debug which appears to compile and load the program to the microcontroller. After this step the green arrow (resume) and red box (terminate) light up on the bar just below the menu bar. In order to run the program on the microcontroller I have been clicking the red box. This works but is this how I should be compiling and running the code?


Daniel

  • Daniel,

    I think in your explanation you meant to say:

    "In order to run the program on the microcontroller I have been clicking the GREEN box."

    This is an option, but I do differently. You may not want to download and debug your code every time you re-compile your code.

    So here is my method.

    1] From CCS Edit perspective, right click in the Project Explorer on your project and select "Build Project".
         This will re-compile all the file that have been modified since last compilation.
          The code will not be downloaded to your device.

    Now to download the code to your part, you have to connect to your device.     

    2] Start a debug session by doing a right click and select Launch Selected Configuration on your target configuration in the Target Configuration Window.

    Now from the debug window, connect your target by doing right click-> Connect Target.

    The debugger is connect to your device. You can now download your code.

    3] Download code to a connected device.
        From the Run menu, select Load->Load-Program. Use the popup window to select the file you want to download.
        You can select from any existing project (Browse Project), or directly any file on your system (Browse).

    The code will be flashed to your device and will automatically run to "main"

    From there you can use the Green option to run your code. (Use the Yellow pause to halt execution)
    You can also step using the yellow arrow.
    The Red stop is do disconnect and reset the debug session.

    If you have to re-compile your code, switch the the Edit perspective and re-build your project. If the project is the same as the one previously downloaded, CCS will ask you if you want to download this new out file. If you say yes, the download will happen automatically. If your answer is NO, than you will have to follow option 3]


    Again, this is my method. There is many other way, just pick up the one you like.