Debug the application
When you've added and changed code in your application, it is likely that something will not work as expected. At that point, you need to debug the application to determine what is wrong, or how to optimize the desired behavior. Similar to building an application and programming the board, you can use an IDE or command line options to debug the application.
Use Eclipse IDE
When using the Eclipse IDE, if installed, click the appropriate "
Program
" link in the Quick Panel for the selected application.
Refer to the "Program and Debug" chapter in the
Eclipse IDE for ModusToolbox™ user guide
for details about launch configs and various debugger settings.
Export to another IDE
If you prefer to use an IDE other than Eclipse, refer to your preferred IDE's documentation for debugging instructions. As noted under the
Build and program
section, you export a ModusToolbox™ application to a supported IDE following instructions in
Using supported IDEs
. There are also some debugging set-up instructions in that section.
Switch to J-Link
By default, most ModusToolbox™ applications are set to use the KitProg3 connection on the kit.
For Eclipse and VS Code
, if you want to use J-Link instead, you must set a couple of make variables as follows:
Open your ModusToolbox™ single-core application's
Makefile
, or multi-core application's
common.mk
file, and enter the following variable:
BSP_PROGRAM_INTERFACE=JLink
If you install J-Link software in a non-default location, or intend to use make commands, such as
make program
and
make qprogram
, also enter the following variable:
MTB_JLINK_DIR=<path to J-Link>
Note: If you want all projects/applications for the BSP to use the J-Link programmer/debugger, you can specify the
BSP_PROGRAM_INTERFACE
and
MTB_JLINK_DIR
variables in the bsp.mk file instead.
Save the
Makefile
.
In a bash terminal run the applicable
make <ide>
variable for the IDE you wish to use.
For a VS code example, run:
make vscode
For an Eclipse example click
Generate Launches for ...
, or run:
make eclipse
When the command completes, J-Link configurations will be shown where applicable.
For IAR Embedded Workbench and Keil μVision
, you can make changes using their GUI tools.
For more specific details, refer to the specific user guide for the IDE you're using.