The NXP device S32R45 has accelerators that can be programmed. The S32 Debugger included within the S32 Design Studio for S32 Platform IDE with the S32 Debug Probe provides the ability to debug these accelerators. The accelerator covered in this document: Signal Processing Toolbox (SPT).
Section map:
Preparation
Setup the software tools
Setup the hardware
Procedure
Create A New Debug Configuration
Start A Debug Session
Multi-Core
Preparation
- Setup the software tools
- Install S32 Design Studio for S32 Platform
- Install the S32R4xx development package and the Radar extension package for s32R4xx. Both of these are required for the SPT accelerator.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173323iE193FF26861DE06F/image-size/large?v=v2&px=999)
- Setup the hardware
- Confirm the setup of the S32R45 evaluation board.
- Connect the power supply cable
- Setup the S32 Debug Probe. Refer to the S32 Debug Probe User Manual for installation instructions.
- Connect the S32 Debug Probe to the evaluation board via JTAG cable.
- Connect the S32 Debug Probe to the host PC via USB cable OR via Ethernet cable (via LAN or directly connected and configured for static IP address) and power supply connected to USB port.
- Launch S32 Design Studio for S32 Platform
- Open existing project or create a new project and check that it successfully builds. If creating a new project, be sure the S32 Debugger is selected in the New Project Wizard.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173324i9B05398AC188BBB6/image-size/large?v=v2&px=999)
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173325iE82A6AC0066A14A2/image-size/large?v=v2&px=999)
Procedure
The procedure for starting a debug session and accessing the associated accelerator-specific registers is detailed here.
Debugging SPT is only conducted through the multi-core method. The SPT executable is included within A53 executable, the A53 application loads the SPT executable to the SPT core and both A53 and SPT core are available for debugging. The debug connection is made to the two cores through one of two methods:
- Baremetal/Bareboard: the debugger connects to both the A53 and SPT cores using the probe over JTAG.
- Linux BSP: the debugger connects to the A53 core, which is running Linux BSP, using a remote Linux connection over Ethernet and then connects to the SPT core using the debug probe over JTAG.
Before a debug session can be started a debug configuration must exist.
Create A New Debug Configuration
If the New Project Wizard was used to create the project using the S32DS Application Project option, then there was an opportunity to select the desired debugger from within the wizard. If the desired debugger option was selected at this time, then the needed configuration already exists and will only require adjustments to the hardware connection settings.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173326i02AF7CDE935FAAC3/image-size/large?v=v2&px=999)
If the New Project Wizard was not used to create the project OR the currently desired debugger was not the one selected at the time of project creation, a new debug configuration must be created.
- With the existing project selected in Project Explorer, open the Debug Configurations Menu: Run -> Debug Configurations
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173327iD072DBDC5A80552A/image-size/large?v=v2&px=999)
Having the existing project selected in the Project Explorer view will make the creation of a new launch configuration easier as many settings will be imported from the selected project. To select a project, click on it so it becomes highlighted.
- Next, select the debugger for which the new debug configuration will be created.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173329i5BCFE73BC5732066/image-size/large?v=v2&px=999)
- To create the new configuration, either click on the ‘New launch configuration’ button from the toolbar at the top and to the left, or right-click on the ‘S32 Debugger’ and select ‘New Configuration’ from the menu.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173330i14D2AB7BB276EF0C/image-size/large?v=v2&px=999)
- Once the configuration is created it will be displayed and any errors with the configuration will be shown. If the project was selected in the Project Explorer, then the Name of the debug configuration will contain the project’s name and the Project and C/C++ Application fields will be populated as well. The C/C++ Application field will only be populated if the build output executable exists. Confirm these values are correct before moving on.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173331i510D50D90999F19A/image-size/large?v=v2&px=999)
- There is an error showing that the Device core ID is not specified on the Debugger tab. Switch to the Debugger tab and click on the button ‘Select device and core’.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173332i6A05083352B14A1D/image-size/large?v=v2&px=999)
- From the Select Target Device and Core window, expand the listing until all cores are listed. Notice that all supported cores on the S32R45 are listed. Select the SPT31 core and click OK.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173333i6F4141864A05F250/image-size/large?v=v2&px=999)
- Now that the device and core are selected, the attach script is selected automatically. The attach script will allow to start debugging on a core that is already initialized. This is correct for the SPT core as it is always launched in multicore scenario. Refer to the document 'README.txt' located in the same folder as these script files for details on all of the provided scripts.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173334iAC477B6EBD3CCD93/image-size/large?v=v2&px=999)
- Confirm the setting of the ‘Initial core’ checkbox. This box should be checked within the debug configuration that establishes the first connection to the target device via S32 Debug Probe. When this box is checked, the Debug Probe Connection interface and GDB Server settings become available. The probe connection only needs to be configured once and only one GDB Server needs to be running for each debug session. Therefore, this box should be checked for multicore debugging where A53 core is debugged via Remote Linux. If, however, the A53 and SPT cores are debugged via the S32 Debug Probe, then this box should be checked for the A53 debug configuration and should not be checked for the SPT debug configuration.
- If the ‘Initial core’ box was checked in the previous step, setup the Debug Probe Connection. Select either USB or Ethernet, depending upon your hardware setup. If USB is selected, the COM port for the S32 Debug Probe will automatically be detected (unless not connected or more than one probe is connected). If Ethernet is selected, then enter either the hostname (fsl + last 6 digits of MAC address) or IP address. It is highly recommended to press the ‘Test connection’ button to confirm the hardware connection is correctly configured. See the included ‘S32_Debug_Probe_User_Guide.pdf’ for more details on the setup of the S32 Debug Probe.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173335i3598B4539EA8B5A8/image-size/large?v=v2&px=999)
- Check that the GDB Client section has the correct path to the SPT GDB executable. It should point to the variable ‘S32DS_R45_GDB_SPT_PATH’.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173336i26D2A48B1A4819EC/image-size/large?v=v2&px=999)
- Startup tab check the following settings
- Load image is NOT checked for multicore debugging. Basically, if it is loaded by A53 core (SPT executable is contained within A53 ELF file), then it does not need to be loaded.
- Load symbols is NOT checked. The SPT source file is assembly code, so there are no symbols to load.
- Set breakpoint at main and Resume are NOT checked for multicore debugging.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173337iF9D932646F27C37A/image-size/large?v=v2&px=999)
- After saving the new configuration with the ‘Apply’ button, SPT debugging can be performed.
Start A Debug Session
For convenience, the example project for S32 Design Studio from the RSDK, ‘RSDK_S32DS_template’, will be used to demonstrate multi-core A53/SPT debugging. The SPT core does not support standalone debugging. For instructions on loading this example project to your workspace, see ‘HOWTO: Create New Project from Example RSDK_S32DS_template from Radar SDK’.
A53 / SPT Multi-Core
For multi-core debugging, the A53 core is executing an application on the Linux BSP. The EVB should be setup to boot from a flash device which has been loaded with the S32R45 Linux BSP.
- Before beginning the debug sessions, be sure to load the driver dependencies (oal_driver, rsdk_spt_driver, and rsdk_lax_driver) as described in the RSDK User Manual, RSDK Offline Example section ‘Running the application’.
- Start A53 debug. From the menu at the top, select Run -> Debug Configurations…
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173338i275D459EFF83E22D/image-size/large?v=v2&px=999)
- In the Debug Configurations menu, from the configuration list, expand the ‘C/C++ Remote Application’ group and select the ‘RSDK_S32DS_template_A53_Debug’ configuration.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173339i677C59011AD9BCA9/image-size/large?v=v2&px=999)
- On the Main tab, create a new connection for using the IP address of the EVB. The IP address could be determined either by issuing a Linux command over the serial connection, such as ‘ifconfig’, by accessing the local network connected device list, or perhaps the EVB was setup with a static IP address and it is already known.
- Click New… in the Connection section.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173340iC07681180C783007/image-size/large?v=v2&px=999)
- Select ‘SSH’ for connection type.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173341iB4EA17EBA9F3E325/image-size/large?v=v2&px=999)
- Enter the IP address in Host: field, use ‘root’ in User: field, and leave password field empty.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173342iC2564F253689C4BD/image-size/large?v=v2&px=999)
- Click Debug to start debugging on the A53 core.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173343i3DE608EA0FD5C455/image-size/large?v=v2&px=999)
- The debugger will launch and execute until the first executable line in main(). See Debugger tab in Debug Configurations menu to adjust this setting.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173344i7A5BB48E83C223FF/image-size/large?v=v2&px=999)
- Once the A53 debug session is running, advance the program counter to a line after the desired SPT kernel is loaded to memory but before the SPT kernel is launched. In the example here, this would be in ‘spt_bbe32_proc.c’, line 318, where ‘ExampleLaunchSptKernel()’ function is called. This is best done by setting a breakpoint on the line and clicking Resume.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173345i83DE8B168F55F66E/image-size/large?v=v2&px=999)
- After the breakpoint is reached, the SPT debug session can be started.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173346i5AD1EBB7A29CFB76/image-size/large?v=v2&px=999)
- Return to the Debug Configurations menu, select the SPT debug configuration ‘RSDK_S32DS_template_SPT31_attach’, confirm the Debug Probe Connection settings and click Debug.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173347iE0A6EA504C6B02FE/image-size/large?v=v2&px=999)
- Wait for the SPT debug session to launch and stop in the disassembly. Select the SPT debug thread to change the context of the Disassembly, Registers and etc.views. Now you can step through the assembly code, access registers, etc.
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173348iAAB1B5081C127298/image-size/large?v=v2&px=999)
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173349i888B013D00DD8BC5/image-size/large?v=v2&px=999)
![image.png image.png](https://community.nxp.com/t5/image/serverpage/image-id/173350iFC57E62EC07FAADF/image-size/large?v=v2&px=999)