Debugging with S32 Debug Probe from flash

This topic describes how to debug a bare-metal application on the board connected to the computer with the S32 Debug Probe. The application is loaded to flash memory of the target.

To debug an application with the S32 Debug Probe from flash:

  1. Create an application project and specify “S32 Debugger” as the debugger.
  2. Build the project.
    If you have selected multiple cores when creating your project, build the project for each selected core.
  3. Right-click the project in the Project Explorer and click Debug As > Debug Configurations on the context menu.
  4. In the Debug Configurations dialog box, go to the Launch Group section in the left pane.

    The project creation wizard has generated several launch groups for your application. In the left pane, click the launch group intended for debugging from flash:


    The launch group for debugging from flash with S32 Debugger

    The right pane displays the debug configurations in the order of execution. The top configuration is intended for loading the executable code to flash memory of the target. The “Wait until terminated” action indicates that the next debug configuration will be run only after the flash loading session has finished.

  5. Expand the S32 Debugger Flash Programmer interface in the left pane and click the debug configuration that is located on top in the launch group.
  6. Go to the Debugger tab and make sure that the following settings are defined properly:
    • Device: This field is populated automatically from the project settings. If correction is needed, use the Select device button to choose the right device.
    • Initialization script: The initialization script is populated automatically based on the device information. All configurations in the launch group use the same script file.
    • Flash name and Flash type: Expand the menus and select the flash device and the type.
    • Debug Probe Connection settings: Specify whether the S32 Debug Probe is connected to the workstation through USB or Ethernet. If the probe is connected to a USB port, select the COM port from the menu. If the Ethernet connection is used, show the IP address of the probe network adapter.
    • Launch server: This flag is set automatically.


    Updating the flash debugger configuration

  7. Go to the Main tab. Enable the Erase all flash memory option to apply the respective action before writing data to flash.
  8. Click Apply to save your updates to the debug configuration.
  9. Expand the S32 Debugger interface in the left pane and click the debug configuration that follows the top one in the launch group. Specify the settings as described in the above step.
    The following settings are required if the debug configuration is the first one to be executed after the flash loading session:
    • Initial core: Keep this option enabled for the evaluation board to be initialized.
    • Launch server: Keep this option enabled for the GDB server to be started. Remove this flag only if you are going to run the GDB server from the command line.

  10. If the launch group includes more debug configurations for other cores, open them from the left pane under S32 Debugger as described above. Make sure that all these configurations have the Initial core option not selected.
  11. Go back to the launch group and click Debug.
  12. When the debug session is started, the execution stops at the first software breakpoint (typically, at main) that is specified on the Startup tab in the Set breakpoint at field. Step over and continue debugging your program on the target as you always do.