HOWTO: Debugging SPT on S32R41 Using S32 Debugger

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

HOWTO: Debugging SPT on S32R41 Using S32 Debugger

HOWTO: Debugging SPT on S32R41 Using S32 Debugger

The NXP device S32R41 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

  1. Setup the software tools
    1. Install S32 Design Studio for S32 Platform
    2. Install the S32R41 development package and the Radar extension package for S32R41. Both of these are required for the SPT3.5 accelerator.
      image.png
  2. Setup the hardware
    1. Confirm the setup of the S32R41 evaluation board.
      1. Connect the power supply cable
    2. Setup the S32 Debug Probe. Refer to the S32 Debug Probe User Guide for installation instructions.
      1. Connect the S32 Debug Probe to the evaluation board via JTAG cable.
      2. 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.
  3. Launch S32 Design Studio for S32 Platform
  4. 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.pngDanielBarbu_0-1718789124668.png

     

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 the Baremetal/Bareboard method. The debugger connects to both the A53 and SPT cores using the 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.

DanielBarbu_1-1718789307585.png

 

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.

  1. With the existing project selected in Project Explorer, open the Debug Configurations Menu: Run -> Debug Configurations
    image.png
    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.
  2. Next, select the debugger for which the new debug configuration will be created.
    image.png
  3. 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
  4. 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 may 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. If the C/C++ Application field is empty, just click ‘Browse..’ button (The ‘Search Project…’ button is setup to identify standard executable file types, not the SPT’s ‘aspt’ file type) and navigate to the folder containing the build output <project name>.aspt. If you like, the tool already knows the project directory path, so you could shorten the path to start with from the ‘Debug’ folder, as shown here.
    image.png
  5. 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
  6. From the Select Target Device and Core window, expand the listing until all cores are listed. Notice that all supported cores on the S32R41 are listed. Select the SPT35 core and click OK.
    image.png
  7. 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
  8. 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. When debugging the SPT3.5 core, the A53 core will always launch first, so this box should be checked for the A53 debug configuration and should not be checked for the SPT debug configuration.
  9. Check that the GDB Client section has the correct path to the SPT GDB executable. It should point to the variable ‘S32DS_R41_GDB_SPT_PATH’.
    image.png
  10. Startup tab check the following settings
    1. 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.
    2. Load symbols is NOT checked. The SPT source file is assembly code, so there are no symbols to load.
    3. Set breakpoint at main and Resume are NOT checked for multicore debugging.
      image.png
  11. After saving the new configuration with the ‘Apply’ button, SPT debugging can be performed.

Start A Debug Session

For convenience, the S32DS Application Project wizard was used to create a new project for demonstrating 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: S32 Design Studio - Create New Application Project’, selecting instead the Processor option Family S32R41 -> S32R41xxx Cortex-A53 SPT3 from the wizard menu.

image.png

A53 / SPT Multi-Core

For multi-core debugging, the A53 core is running an executable which also contains the SPT code. The A53 code will make a call into the SPT to load the SPT code to memory and to start the SPT execution. So the A53 must be started first. The EVB settings are irrelevant as the debugger will take control of the target via the JTAG connection.

  1. Before beginning the debug sessions, be sure each project is built clean.
  2. Start A53 debug. From the menu at the top, select Run -> Debug Configurations…
    image.png
  3. In the Debug Configurations menu, from the configuration list, look for the ‘S32 Debugger’ group and select the A53 Debug_RAM configuration for the project to be debugged. In the case of our example, the ‘New_S32R41_SPT_Project_A53_Debug_RAM_S32Debug’ configuration.
    image.png
  4. On the Debugger tab, check that the Debug Probe Connection settings match with the current hardware connection configuration for the S32 Debug Probe.
    image.png
  5. Use the ‘Test connection’ button to confirm.
    image.png
  6. Click Debug to start debugging on the A53 core.
  7. 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
  8. 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 ‘main.c’, line 57, where ‘StartSptProgram()’ function is called. This can be done by setting a breakpoint on the line and clicking Resume.
    image.png
  9.  After the breakpoint is reached, the SPT debug session can be started.
    image.png
  10. Return to the Debug Configurations menu, select the SPT debug configuration. In the case of this example, ‘New_S32R41_SPT_Project_SPT35_Debug_S32Debug’, and click Debug.
    image.png
  11. Wait for the SPT debug session to launch and stop in the disassembly. Use the Step Over command one time in the A53 debug thread to complete the SPT launch.
    image.png
  12. Select the SPT debug thread to change the context of the Disassembly, Registers and etc.views.
    image.png
    Notice the SPT code is not loaded yet.
    image.pngimage.png
  13. Enable Instruction Stepping Mode and step one time. Notice the SPT code is now loaded.
    image.png
  14. Now you can step through the assembly code, access registers, etc.
    image.pngimage.pngimage.png
評価なし
バージョン履歴
最終更新日:
3 週間前
更新者: