Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
Open Source Software and Platforms
Open Source Software and Platforms
Wiki Guide to Set Up Debugging Environment for Total Compute Software Stack
  • Help
  • Jump...
  • Cancel
  • About this wiki
  • Supported platforms
  • Obtaining support
  • +Arm Reference Platforms deliverables
  • -A-class platforms
    • +Juno
    • +FVPs
    • -Total Compute Platforms
      • Guide to Set Up Debugging Environment for Total Compute Software Stack
      • Guide to Debug RSS Firmware Booting on Total Compute Platform
      • Guide to Debug SCP Firmware Booting on Total Compute Platform
      • Guide to Set Up TF-A Firmwares Debug Environment on Arm DS for Total Compute Platform
      • Guide to Debug Hafnium on Total Compute Platform
      • Guide to Disable AP Secure Images on Total Compute Platform
      • Guide to Run OpenEuler Embedded on TC2 Platform
      • Guide to add "Hello World" application into edk2 of TC2 LSC platform?
      • Guide to Set Up Linux Kernel Debug Environment on Arm DS for Total Compute Platform
      • Guide to Set Up U-boot Debug Environment on Arm DS for Total Compute Platform
    • +Morello Platform
    • +System Guidance for Infrastructure (SGI)
    • +System Guidance for Mobile (SGM)
    • Corstone-500
    • Cortex-A5 DesignStart
    • +Neoverse N1 SDP
    • Neoverse Reference Designs
    • +Legacy platforms
  • +M-class platforms
  • +R-class platforms
  • +FPGA prototyping boards
  • +Open source software

Guide to Set Up Debugging Environment for Total Compute Software Stack

Arm Total Compute Solutions (TCS) is the platform for mobile computing, with double double-digit gains in CPU performance and efficiency to power the next generation of AI and immersive mobile gaming experiences.

Total Compute (TC) software stack is a reference software stack for the Arm Total Compute Fixed Virtual Platform (FVP). The TC software consists of firmware, kernel and file system components that can run on the associated FVP.

Some of its main components are as follows:

  • RSS firmware, which provides Hardware Root of Trust
  • SCP firmware, which is responsible for system initialization, clock and power control;
  • AP firmware, which is Trusted Firmware-A (TF-A)
  • Secure Partition Manager - Hafnium
  • Secure Partitions:
    • OP-TEE Trusted OS in Buildroot
    • Trusted Services in Buildroot
    • Trusty Trusted OS in Android
  • U-Boot, which loads and verifies kernel and rootfs
  • Linux Kernel

This blog shows you how to set up the debugging environment step by step, including how to configure the debug environments for RSS, SCP, and AP.

Prerequisites

This blog assumes that you already set up the following environment:

  • Host PC (Ubuntu Linux 20.04)
  • TC2 Fast Model platform (FVP) (version 11.23.17)
  • Arm Development Studio (Latest version)
  • Download and build TC2 software stack, by following the Total Compute User Guide. 

Overview

This blog describes the following steps to set up debugging environment for Total Compute Software Stack:

Step 1: Import TC FVP Model into Arm DS.

Step 2: Start FVP and launch the Iris debug server.

Step 3: Establish debug connections in Arm DS, including:

Application Processor debug connection.
System Control Processor debug connection.
Runtime Security Subsystem debug connection.

Step 4: Load corresponding symbol tables file and start debugging.

Step 1: Import TC FVP Model into Arm DS

Arm DS supports some built-in FVP models, but TC2 FVP is not included in the built-in models of Arm DS. Before you start debugging TC2, you must use the Model Configuration wizard in Arm DS to create debug configurations for new models:

  1. Open the Model Configuration wizard
    From the Main menu, select File -> New -> Other -> Configuration Database -> Model Configuration and click Next, as follows:



  2. Create the configuration database where you want to include your TC2 model, as follows:



  3. Choose Configuration Database and click Next, as follows:



  4. Select Iris as the model interface for connecting to your model, as follows:



  5. Select the Launch and connect to specific to your model, as follows:



  6. In Model Selection from File System dialog box, click File to browse for a model and select it, as follows:



  7. Click the Import button to import the TC2 FVP model, as follows:

  8. Verify whether the import is successful, by checking for the imported model in the Project Explorer, as follows:



Note: If you encounter a smiliar error message, as shown in the following figure, during the import process, it is because the current version of Arm DS cannot recognize the latest CPU type. In this case, you must update Arm DS to the latest version to support this CPU type.

Step 2: Start FVP and launch the Iris debug server

By default, to run the software stack for TC, the following command is used to launch the FVP.

./run-scripts/tc2/run_model.sh -m <model binary path> -d <distro>

For debugging TC software with Arm DS, it is necessary to start the Iris debug server when starting the FVP. This allows Arm DS to connect to the debug server later. To initiate the Iris debug server during FVP startup, include an additional option -I. When connecting Arm DS to the Iris debug server, the server port is required. To print this port during startup, include an additional parameter -p. This way, the FVP can be launched by using the following command:

./run-scripts/tc2/run_model.sh -m <model binary path> -d <distro> -- -I -p

By default, FVP uses xterm to initialize the serial port output and input for TC platform. In certain situations, the xterm font might appear relatively small, so copying and pasting operations might not be as convenient. For example:

If you want to replace it with the default terminal of Ubuntu, you must add additional parameters as follows:

./run-scripts/tc2/run_model.sh -m <model binary path> -d <distro> -- -I -p \
-C css.terminal_uart1_ap.terminal_command="gnome-terminal -t %title -- telnet localhost %port" \
-C css.terminal_uart_ap.terminal_command="gnome-terminal -t %title -- telnet localhost %port"  \
-C soc.terminal_s0.terminal_command="gnome-terminal -t %title -- telnet localhost %port"  \
-C soc.terminal_s1.terminal_command="gnome-terminal -t %title -- telnet localhost %port "

The serial ports of the TC FVP are as follows:

After running this command, the output is as follows:

Iris server started listening to port 7100
INFO: GPU Model initialized.
INFO: TC2.css.cmn: CI-700 r1p0 model, periphbase=0x0000000050000000, mesh_config_file='TC2_ci700.yml'

terminal_uart_ap: Listening for serial connection on port 5006
terminal_uart1_ap: Listening for serial connection on port 5007
terminal_s0: Listening for serial connection on port 5008
terminal_s1: Listening for serial connection on port 5009
terminal_0: Listening for serial connection on port 5010
terminal_1: Listening for serial connection on port 5011

You can observe the port of the Iris debug server, which can be used later.

Step 3: Establish debug connections in Arm DS

The TC platform has:

  • The Application process
  • The System control processor
  • The Runtime Security Subsystem Processor

These three systems run different software stacks. To debug them separately or simultaneously, you must create debug connections for each of these three systems in Arm DS. 

To create debug connections for these three systems, perform the following steps:

  1. From the main menu, select Run-> Debug Configuration -> Generic Arm C/C++ Application and Click New Launch Configuration, as follows:



  2. Select the previously imported model and choose the CPU core you want to debug.  This example uses Cortex-A520X4 SMP Cluster 0 as an application processor. 

  3. Within the Connections section below, choose Connect to an already running model. The address is 127.0.0.1, and the port is the one printed when launching the FVP.

  4. Click the Apply button. Once applied successfully, you can see the following in the Debug Control on the left: 



For the System Control Processor and Runtime Security Subsystem, you can repeat the above process. The only difference is that when selecting the CPU, choose Cortex-M3 for the System Control Processor and Cortex-M55 for the Runtime Security Subsystem.

 After completing these steps, you have three debug connections as follows:

 Step 4: Load corresponding symbol tables file and start debug

You might need to add different symbol tables for each debug connection. 
To load correspondig symbol tables file and start debug, perform the following steps:

  1. On the debug configuration page, select Debugger -> Connect only -> Execute debugger commands.

  2. Use the add-symbol-file command to add different symbol tables, as follows:



    For the Application processor, you can add the symbol table by using the following command:

    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/tfa/build/tc/debug/bl1/bl1.elf EL3:0
    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/tfa/build/tc/debug/bl2/bl2.elf EL1S:0
    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/tfa/build/tc/debug/bl31/bl31.elf EL3:0
    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/hafnium/secure_tc_clang/hafnium.elf  EL2S:0
    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/u-boot/u-boot  EL2N:0
    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/linux/vmlinux  EL1N:0
    


    For the RSS, you can use the following command:

    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/rss/build/install/outputs/bl1_1.axf
    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/rss/build/install/outputs/bl1_2.axf
    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/rss/build/install/outputs/bl2.axf
    
    


    For the SCP, you can use the following command:

    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/scp/scp/bin/tc2-bl1.elf
    add-symbol-file /workspace/sw/buildroot-tc2-23.10.04/output/buildroot/tmp_build/scp/scp/bin/tc2-bl2.elf
    
    


  3. Start debugging. To start debugging, In the Debug Control window on the left, select the corresponding debug connection, right-click it, and choose Connect to Target, as follows:


You can start with debugging as follows:

NOTE 1: If you encounter an error similar to the following one when starting debugging, check whether your debug port number is set correctly or if the FVP is not started according to the method described above.

NOTE 2: If you encounter an error similar to the following one when load debug symbol file.

ERROR(CMD685-COR11-IMG34): 
! Failed to load symbols for "xxxxx.axf"
! Failed to read the symbols from /workspace/xxxx.axf
! Section .debug_info offset 0x4: DWARF version 5 is not supported. To use the DWARF 5 format, enable the LLVM DWARF parser.
See https://developer.arm.com/documentation/101470/2023-0/Reference/Standards-compliance-in-Arm-Debugger

When the debug symbol is in Dwarf5 format, Arm DS needs to enable the LLVM parser. To enable the LLVM parser (with Dwarf5 support), please follow the steps below: 

Select Window->Preferences->Arm DS->Debugger->Dwarf Parser.
Tick the Use LLVM DWARF parser option.
Click the Apply and Close button.

  • Share
  • History
  • More
  • Cancel
Related
Recommended