Install the Development Package for the device you are debugging. In this case, the S32G2xx development package. This package is important as the S32 Debugger support component contains the device-specific Python scripts required for performing the flash programming operations.
Open the application project containing the application to be programmed to the flash memory device.
Build the project, generating the binary executable. This will be our application binary input to the IVT Tool. The IVT Tool must be used to generate the BLOB image which can be programmed to flash memory device and loaded to the RAM by the BootROM.
Select 'S32 Debugger Flash Programmer', then right-click and select New.
Enter an name for the new configuration and click Add... to add the file to be flashed.
Click Browse... to select the project from the workspace where the application binary is located
Select the project and click OK
By default, the ELF file is found. Click Search in project to select the binary file.
Select the .bin file and click OK
Now we must enter the base address. Typically, this could be 0, but you may have other requirements. Click OK.
Just the memory required by the new image needs to be cleared, so only check the box 'Erase all flash memory' if truly needed. Now we are ready to configure the debugger connection settings. Click on the Debugger tab.
Starting from the top and working our way down, click on Select device.
Select the device and click OK
The correct Initialization script will automatically be set. Set the Debug Probe Connection settings to match your setup. When done, click Apply
To start the flashing, click Debug
When complete, the Debug perspective will show at terminated thread.
Happy flashing with GDB!
Note, to debug this application since it will be subsequently started by the BootROM:
use 's32gxx_attach.py' in the Initialization script field on the debugger tab of the Debug Configurations menu
Make the following adjustments on the Startup tab within the Debug Configurations menu:
Uncheck "Load image"
Check "Set program counter at:" and enter the value "Reset_Handler"