HOWTO: Command Line JTAG flash programming with S32 Debug Probe on S32R45 EVB

Showing results for 
Show  only  | Search instead for 
Did you mean: 

HOWTO: Command Line JTAG flash programming with S32 Debug Probe on S32R45 EVB

HOWTO: Command Line JTAG flash programming with S32 Debug Probe on S32R45 EVB

The S32 Debugger included within the S32 Design Studio for S32 Platform IDE provides the capability to access the flash programming capabilities of the S32 Debug Probe via GTA command line and the GDB. This instruction details the steps to perform flash programming of the S32R45 EVB via the JTAG interface with the S32 Debug Probe.


Note: currently only QSPI flashing is supported.



  1. Install S32 Design Studio IDE 
  2. Install the Development Package for the device you are debugging. In this case, the S32R4xx development package. This is important as the S32 Debugger support within it contains the device-specific Python scripts required for initialization of the cores. 

  3. Setup the hardware
    1. Confirm the setup of the S32R45 evaluation board. 
      1. Confirm the JTAG connection. The S32R45 evaluation board supports both 10- and 20- pin JTAG connections. Both are supported by the S32 Debugger and S32 Debug Probe.
      2. Connect the power supply cable
    2. Setup the S32 Debug Probe
      1. Connect the S32 Debug Probe to the evaluation board via JTAG cable. Refer to the S32 Debug Probe User Manual for installation instructions. Use the JTAG connection as was confirmed in the previous step.
      2. Connect the S32 Debug Probe to the host PC via USB OR via Ethernet (via LAN or directly connected, and configured for static IP address) and power supply connected to USB port.
  4. Launch S32 Design Studio for S32 Platform
  5. Create new or open existing project and check that it successfully builds. If creating a new project, be sure the S32 Debugger is selected in the New Project Wizard.





  1. Launch GTA server. From command prompt or Windows File Explorer run the command: 

    {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\Server\gta\gta.exe


    Should see a window appear like this:


  2. Ensure Environment Variable for Python is set. From command prompt, run the command:

    set PYTHONPATH={S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7;{S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages


  3. Start GDB. In a command window, run the command:

    Windows OS:
    {S32DS Install Path}\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb-py.exe (for arm32)
    {S32DS Install Path}\S32DS\tools\gdb-arm\arm64-eabi\bin\aarch64-none-elf-gdb-py.exe (for arm64)
    Linux OS: arm-none-eabi-gdb-py

    A (gdb) prompt should now be displayed in the command window:


  4. Configure the EVB's Boot Mode switches for Serial Boot.


  5. Issue the following commands, replacing the PROBE_IP address and FLASH_NAME, as appropriate:

    source {S32DS Install Path}/S32DS/tools/S32Debugger/Debugger/scripts/gdb_extensions/flash/

    py _FLASH_TYPE = "qspi"

    py _PROBE_IP=""

    py _JTAG_SPEED=20000

    py _GDB_SERVER_PORT=45000

    py _GDB_TIMEOUT=7200


    py _RESET_DELAY=1

    py _RESET_TYPE="default"

    py _INIT_SCRIPT="{S32DS Install Path}/S32DS/tools/S32Debugger/Debugger/scripts/s32r45/"

    py _FLASH_NAME="MX25UW51245G"


    py flash()

    Note: Replace the {S32DS Install Path} in the commands above with the actual path to your installation of S32 Design Studio.

  6. Now flash commands may be used.
    fl_blankcheck -- blank check
    fl_close -- close command
    fl_current -- current device command
    fl_dump -- dump command
    fl_erase -- erase section of memory command, will erase whole sectors starting from 'offset' through 'size' contiguously, so to erase only one sector, ensure that the 'offset' address is within the desired sector and 'size' does not extend into the following sector
    fl_erase_all -- erase all memory command
    fl_info -- info command, shows list of registered devices
    fl_protect -- protect section of memory command
    fl_unprotect -- unprotect section of memory command
    fl_write -- write memory command, hex or binary are supported, options to erase first and verify after write
    fl_write_elf -- write elf file to memory command, options to erase first, verify after, and rearrange flash base

    Type 'help fl_<command>' to print the help info on the specified command
    Type 'help support' to print a list of the fl_ commands

    For example, you may wish to write a binary file:
    1. fl_write -e 0x0 C:\\Users\\<userid_folder>\\workspaceS32DS\\hello_world\\Debug_RAM\\hello_world_blob.bin

  7. Happy flashing with S32DS Flash Programmer!
No ratings
Version history
Last update:
‎04-09-2021 03:21 PM
Updated by: