When a new application project is created using the New Project Wizard, it is possible to select the debugger to be used. This results in the associated debugger configurations being created within the new project. But what if support for multiple debuggers is required or it is desired to switch to a different debugger? There are easy ways to resolve this. One is as simple as creating a new debug configuration. Another method is by creating new application project, selecting the new debugger to be supported. Then either repurposing the associated debug configuration or duplicating then modifying the debug configuration to support instead the previously existing project. This minimizes the effort by benefiting from the automation of the New Project Wizard.
Detailed below are the steps to add a new debug configuration.
Create A New S32 Debugger Configuration
Load the existing project. For this demonstration, the SDK project ‘hello_world_s32v234’ will be used.
Select the project so it appears highlighted in blue. Notice that the other project, ‘New_App_Project’, is bold text. This is because the main.c file open in the editor window to the right is the currently selected source file and is from this project. This has no effect on the process detailed in this document.
Check that the existing project has been build and the executable is present. If the executable is not present, then an error will be displayed within the Debug Configurations menu and the executable file will need to be selected in a later additional step after it has been created.
Open the Debug Configurations menu. Run -> Debug Configurations
Now select the Debugger Group for which you wish to create the new configuration. In this case, we will select ‘S32 Debugger’.
Next, click ‘New Launch Configuration’
Now a new Debug Configuration has been created for your project and for the S32 Debugger. Most of the fields are already completed for you. Select the Debugger tab to see the source of the error message.
The error message indicates ‘Specify Device and Core’. So click on ‘Select device and core’.
Now expand the lists until the Device and Core are visible. Select the correct core for your project. In the demonstration example, the correct Device and Core are ‘S32V234’ and ‘M4’, respectively. Click OK, when done.
If you have a debug probe connected, it may have been detected. If not, the Debug Probe Connection section will need to be completed. Now select the ‘Common’ tab to setup the storage location for this new Debug Configuration.
Select ‘Shared file’ and then ‘Browse…’
Expand the lists until ‘Project_Settings/Debugger’ is open. Select ‘Debugger’, then click OK.
Now the basic debug configuration settings are complete. It is now ready to be used and the Debug button could be clicked to start debug. Otherwise, you may have more customizations to make, such as for Attach Mode.
Repurpose S32 Debugger Configuration From A New Project
Create new project
New -> S32DS Application Project
New Project Wizard, processor and toolchain page
Enter a project name
Select the device and core to match the existing project
If necessary, select the toolchain to match the existing project
Click Next
New Project Wizard, cores and parameters page
Select the number of cores to match the existing project
Select the debugger, S32 Debugger
If necessary, select other parameters to match the existing project
Click Finish
Open existing project which does not already have the S32 Debugger debug configurations (for this demonstration, we will use the hello_world_s32v234 example project from the S32 SDK)
Copy debug configurations and modify settings to adapt to existing project
Run -> Debug Configurations...
Debug Configurations window
Within the S32 Debugger grouping, select the debug configuration for the new project which corresponds to the build configuration and core of the existing project
Change the name of the debug configuration. Change the portion of the name containing the project name to match the name of the existing project.
Main tab
Project field
Click Browse...
Select existing project
C/C++ Application
Click Search Project...
Select the Elf file
Common tab
Save as field
Click Browse...
Select {existing_project_name}\Project_Settings\Debugger
Debugger tab, Debug Probe Connection
Setup connection parameters
Click Apply
Repeat as needed for all core/build config options
The existing project now has the S32 Debugger configurations and is ready for debug with the S32 Debug Probe.
View full article