Debugging with S32 Debug Probe from flash for all other 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 loaded from flash memory by the target to RAM memory of the target and launched. The S32 Debugger connects to the running application by Attach method.

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

  1. Create an application project in the wizard and specify “S32 Debugger” as the debugger.
  2. Generate S-Record/Intel HEX/ Binary file selecting the Raw Binary option.
    • Right click on the Project name in Project Explorer.
    • Select Properties > C/C++ Build > Settings > Cross Settings.
    • Check the Create flash image checkbox.
    • Click Apply and Close button.
    • Reopen project settings and go to the Standard S32DS Create Flash Image > General.
    • Select Raw binary option for Output file format.
    • Click Apply and Close button.
  3. Connect the board to your computer. To learn the details about S32 Debug Probe, refer to the S32 Debug Probe User Guide. The PDF version of this document is located in the /S32DS/tools/S32Debugger/Debugger/docs/ folder.
  4. Build the project generating the binary executable.

    This will be your application binary input to the IVT Tool.

  5. Generate the BLOB image which can be programmed to flash memory device and loaded to the RAM by the BootROM using the IVT Tool.
    Note: S32 Flash Programmer supports only IVT image binaries. For help on obtaining IVT image for your project refer to IVT Tool section in Help > Help Contents > S32 Configuration Tools Getting Started.

    The resulting BLOB image file is what can be flashed to the device.

  6. Open the Debug Configurations dialog and double-click the S32 Debugger Flash Programmer.
  7. Specify the new configuration name.
  8. On the Main tab press Add button to add new binary file. Add binary application dilog will appear.
    1. Click Browse button.
    2. Select the project from the workspace where the application binary is located.
    3. Click OK button.

      By default, the ELF file is found.

    4. Click Search in project button
    5. Select the binary file (IVT image obtained at step 5).
    6. Click OK button.
    7. Enter the base address to the Set base address field.
      Note: Typically, this could be 0, but you may have other requirements
    8. Click OK button.
  9. Check the Erase all flash memory checkbox if needed.
    Note: Just the memory required by the new image needs to be cleared.
  10. On the Debugger tab specify the following settings:
    Table 1. Debugger tab: Settings for debugging with S32 Debug Probe from flash
    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 path of the generic initialization script is generated automatically.

      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. Find the information about the available script files in the README file located in the folder.

    • Flash name and Flash type: The flash device and the type will automatically be set.
    Debug Probe Connection Configure the connection between the board and the computer to match your setup.
    • 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. Keep it enabled unless the GDB server is started from the command line.
    • 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 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.
  11. Click Apply to save your updates to the debug configuration.
  12. Expand the S32 Debugger interface in the left pane and click the debug configuration corresponding to your application project since it will be subsequently started by the BootROM.
  13. On the Debugger tab specify the <device>_attach.py script in the Initialization script field.
    Note: For all other Debugger tab setting refer to the Debugging with S32 Debug Probe from RAM topic.
  14. On the Startup tab specify the following settings:
    • Uncheck the Load image checkbox.
    • Check the Set program counter at checkbox and enter the value “Reset_Handler”.
  15. Click Apply to save your updates to the debug configuration.
  16. Click Debug. The debug session is started.
  17. When completed, the terminated thread will be shown in the Debug perspective.
  18. Continue debugging.