NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
GDB with MSP430 and CCSv6
Contents
Requirements[edit]
- CCSv6.0.0 or later
- CDT GDB Hardware Debug Package
- MSP430 emupack 6.0.1 or later
- MSP430 Redhat GCC
In order to be able to use the CCS GUI for things like setting/removing breakpoints, the project should be an Eclipse C/C++ project rather than a CCS project. The steps to create a C/C++ project using MSP GCC toolchain is documented in this wiki page.
Installation[edit]
MSP Device Support[edit]
Check for updates and install the latest version of the MSP430 emupack.
GCC[edit]
You can install the GCC package from the App Center.
GDB Agent[edit]
Obtain the GDB Agent Installation package and copy the GDB agent console and msp430.dat into your /ccsv6/ccs_base/DebugServer/drivers folder
GDB Support for CCS[edit]
Add the CDT update site to your list of update sites. Go to Help -> Install New Software. Click on the Add button and setup the site as shown below.
You will now see the new features that are available on this site. Select the one for GDB hardware debugging.
Select next and click through the installation steps as shown below. When finished it will prompt you to restart CCS, please do this.
Configuration[edit]
Debug Configuration[edit]
Click the down arrow beside the debug button and select Debug Configurations. This will open the debug configurations dialog.
On the left you will see the different types of debug sessions available. Select the one for GDB hardware debugging and then click the new configuration button at the top.
You need to specify the location of the target program that will be loaded. You can also specify the project to associate this configuration with. This is useful as it helps the debugger find source files. In the case below I have specified the program as relative to the project by clicking the Search Project button after specifying the project being used.
Next click on the Debugger tab. Go down to the button and click on the "select other" link.
Check the box to Use configuration specific settings and select to use Legacy GDB Hardware Debugging Launcher.
Now specify the path to GDB and the other options shown.
GDB Agent Configuration[edit]
GDB talks to a GDB agent or proxy. This agent needs to be started inorder for GDB to be able get access to the target device. In this section we show how to setup an "external tool" in CCS so that you can easily launch the agent using the GUI.
Go to Window -> Customize Perspective
Select the "Command Groups Availability" tab. Then uncheck and check the "Launch" command group. Then click OK.
You should now see the external tools menu group on the toolbar. Click the down arrow beside the external tools button and select "External Tools Configurations".
Now lets create a configuration for the GDB agent console. Select "Program" in the tree on the left and then click the New button.
Fill in the Name, full path of the GDB agent console (where you installed it), working directory (same path) and specify msp430.dat as the argument (this file should be in the same folder). Then click Apply.
Now if you go back to the down arrow beside the external tools button you should be able to launch the GDB Agent Console. If you prefer to use the Agent GUI you can set it up in the same way.
Launching a debug session[edit]
- Go to the external tools drop down in CCS and select your entry for the GDB Agent Console (if it is not already running). This should start up the GDB Agent and it should be "waiting" or "listening" at a specific port.
- Then go to the Debug drop down in CCS and select the Debug Configuration that you created for GDB.
- This will start the debug session, load the program to the target and, depending on the settings, be halted at main.
- At this point you can perform debug operations such as setting breakpoints, and stepping through code.