Debugging with S32 Debug Probe from flash for S32V23x targets

Note: This section applies only to S32V23x targets.

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 by S32 Flash Programmer to flash memory external to the target. The application is launched by the S32 Debugger.

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. To learn more about using launch groups, refer to Creating a launch group.

  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.


    S32 Debuger Flash Programmer main tab

  6. On the Main tab you can add, remove, edit and change order of binary elf-files.

    To add new binary file press Add button. Add binary application dilog will appear. Specify the details and press OK.


    Adding flash debugger image

  7. Enable the Erase all flash memory option to apply the respective action before writing data to flash.
    Note: In order to write a new flash image or debug a new application the board should be placed in serial boot mode.
  8. Go to the Debugger tab and make sure that the following settings are defined properly:


    S32 Debuger Flash Programmer configuration

    Table 1. Debugger tab: Settings for debugging with S32 Debug Probe
    Setting Description
    Hardware Specify the settings related to the target:
    • 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.

      To specify the script particular to your evaluation board, go to the following folder:

      <S32 Design Studio installation folder>/S32DS/tools/S32Debugger/Debugger/scripts/s32xxxx

      The last folder in the path is named as your target processor, for instance, /s32v234. Find the information about the available script files in the README file located in this folder.

    • Flash name and Flash type: Expand the menus and select the flash device and the type.
    Debug Probe Connection Configure the connection between the board and the computer:
    • Interface: Specify the connection interface.
    • USB device: For the USB connection, specify the COM port to which the board is connected.

      If the board is not connected with the USB cable, connect it and wait for the probe's TX/RX indicator to get green. Then click Refresh for the connected COM port to appear on the Port menu.

      If you have a problem with the USB connection:
      • On Windows, install the S32 Debug Probe driver manually. For details, refer to readme.txt in S32DS/tools/S32Debugger/Debugger/drivers/usb/.
      • On Linux, install the udevadm utility, this tool detects the used port.
    • Hostname or IP: For the Ethernet connection, specify the host name or IP address of the probe network adapter.
      Note: To learn the host name of the probe, refer to the documentation provided with the delivery kit. For the static IP address assigned to the probe, consult your network administrator.
    • Test connection: click the button to check the connection.
    Target Communication Speed Specify the JTAG communication settings:
    • JTAG Speed (KHz): Specify the JTAG speed.
    • Timeout: Specify the JTAG timeout.
    • Delay after reset: Enable this option to perform software reset on the device at the beginning of the debug session. Specify the board initialization delay (in milliseconds).
    GDB server Specify the GDB server settings:
    • Launch server: This option launches the GDB server. Always enabled.
    • Server port number: Specify the GDB server port. When debugging multiple cores of a single processor, specify the same port in all debug configurations. Default: 45000.
    • Enable log: Enable this option to log the GDB server output. This option is disabled by default.
      Note: Logging may greatly reduce the speed of the debugging process.
    GDB Client Specify the GDB client settings:
    • Executable: The path of the GDB client. This path is generated automatically. And can be changed automatically when you click the Select device button and select the target device.
    • Commands: If required, specify commands to be executed after the GDB client is started. These commands are executed next to the commands specified on the Startup tab.
    Secure debugging Configure settings for secured chips:
    • Enable secure debugging: Enable this option to start a debug session on locked chip.
    • Debugging type: Select the authentication method. Options: Password, Challenge & Response.
    • Clear data stored: Click the button to delete any data from secure storage.
    Note: The availability and support of the option depends on the target device.
    Note: If the chip is unlocked, enabling secure debuging is meaningless.
    Note: Secure debugging Challenge & Response is only supported on Windows.
    Note: Secure debugging with Password is supported on both Windows and Linux.
  9. Click Apply to save your updates to the debug configuration.
  10. 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.
  11. 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.
  12. Go back to the launch group and click Debug.
  13. 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.