Skip to content

Commit 084568b

Browse files
authored
Merge pull request #2268 from RonanSynnottArm/zenadebug
Zena CSS debug with Arm DS
2 parents 7f63e12 + 16ed91d commit 084568b

File tree

11 files changed

+546
-0
lines changed

11 files changed

+546
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: Debug Arm Zena CSS Reference Software Stack with Arm Development Studio
3+
4+
draft: true
5+
cascade:
6+
draft: true
7+
8+
description: Learn how to set up a debug environment for Arm Zena CSS Reference Software Stack
9+
10+
minutes_to_complete: 60
11+
12+
who_is_this_for: This topic is for software developers who wish to use Arm Development Studio to explore and debug the Arm Zena CSS Reference Software Stack.
13+
14+
learning_objectives:
15+
- Set up debug configuration for the Arm Zena CSS FVP
16+
- Debug Runtime Security Engine (RSE) from boot time
17+
- Debug Safety Island (SI)
18+
- Debug Linux OS on Primary Compute cores
19+
## - Debug Linux application
20+
21+
prerequisites:
22+
- Ubuntu 22.04 host machine
23+
- Arm Development Studio 2024.1 (or later) and an appropriate license
24+
- A basic understanding of the Arm Zena CSS software stack and Arm processors
25+
26+
author: Ronan Synnott
27+
28+
### Tags
29+
skilllevels: Introductory
30+
subjects:
31+
armips:
32+
- Arm Zena CSS
33+
operatingsystems:
34+
- Linux
35+
tools_software_languages:
36+
- Arm Development Studio
37+
38+
39+
further_reading:
40+
- resource:
41+
title: Arm Zena Compute System (CSS)
42+
link: https://developer.arm.com/Compute%20Subsystems/Arm%20Zena%20Compute%20Subsystem
43+
type: website
44+
- resource:
45+
title: Arm Development Studio
46+
link: https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio
47+
type: website
48+
49+
50+
### FIXED, DO NOT MODIFY
51+
# ================================================================================
52+
weight: 1 # _index.md always has weight of 1 to order correctly
53+
layout: "learningpathall" # All files under learning paths have this same wrapper
54+
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
55+
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# ================================================================================
3+
# FIXED, DO NOT MODIFY THIS FILE
4+
# ================================================================================
5+
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
6+
title: "Next Steps" # Always the same, html page title.
7+
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
8+
---
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
# User change
3+
title: "Model Configuration"
4+
5+
weight: 4 # 1 is first, 2 is second, etc.
6+
7+
# Do not modify these elements
8+
layout: "learningpathall"
9+
---
10+
11+
# Debug Configuration
12+
13+
Arm Development Studio requires a `Debug Configuration` of the target that it will connect to.
14+
15+
As of 2025.0, there is no such configuration provided 'out-of-the-box' for the Zena CSS FVP. However creating such a configuration is straight forward.
16+
17+
See the Arm Development Studio [Getting Started Guide](https://developer.arm.com/documentation/101469/latest/Migrating-from-DS-5-to-Arm-Development-Studio/Connect-to-new-or-custom-models) for full instructions, but summarized below.
18+
19+
## Launch FVP
20+
21+
As per previous section, launch FVP with the Iris server enabled:
22+
23+
```command
24+
kas shell -c "../layers/meta-arm/scripts/runfvp -t tmux --verbose -- --iris-server --iris-port 7100"
25+
```
26+
or if connecting to the FVP remotely:
27+
28+
```command
29+
kas shell -c "../layers/meta-arm/scripts/runfvp -t tmux --verbose -- --iris-server --iris-port 7100 -A"
30+
```
31+
{{% notice Note %}}
32+
A local connection is assumed for the remainder of this learning path.
33+
{{% /notice %}}
34+
35+
## Configuration Database
36+
37+
Debug Configurations are stored in a configuration database. You must first create a local database in which to store the configuration.
38+
39+
Navigate to `File` > `New` > `Other`, and then select `Configuration Database` > `Configuration Database` from the drop-down list.
40+
41+
Click `Next`. Give the Database a meaningful name, and click `Finish`.
42+
43+
## Debug Configuration
44+
45+
Navigate to the same wizard as above, and select `Model Configuration`.
46+
47+
Click `Next`, and you will be prompted to select the above `Configuration Database`. Click `Next` again, and you will be prompted to select a Model Interface.
48+
49+
Select `Iris` from the pulldown, and click `Next`.
50+
51+
You will then be prompted to locate the model to connect to.
52+
53+
Select `Browse for model running on local host`. The FVP will be detected and interrogated by the debugger.
54+
55+
{{% notice Note %}}
56+
Use `Connect to model running on either local or remote host` if connecting remotely.
57+
{{% /notice %}}
58+
59+
A `model.mdf` file will be created that identifies all CPUs within the FVP.
60+
61+
You can change the `Manufacturer Name` and `Platform Name` to something more meaningful (such as `Arm` and `Zena_CSS_FVP`), then `Save`, and `Import` into the configuration database.
62+
63+
The debugger is now aware of the FVP and you are ready to debug.
27.3 KB
Loading
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
# User change
3+
title: "Debug Connections"
4+
5+
weight: 5 # 1 is first, 2 is second, etc.
6+
7+
# Do not modify these elements
8+
layout: "learningpathall"
9+
---
10+
11+
## Debug Connections
12+
13+
You are now ready to create debug connections for each of the sub-systems within Zena CSS. This section will create the connections, which will be subsequently enhanced in the following section. You may prefer to fully set up one such connection before moving to others.
14+
15+
Development Studio has full support for Heterogeneous systems such as Zena CSS, and so you can connect to all processors simultaneously.
16+
17+
### Debug connection project
18+
19+
It may be sensible to create a project to store these connections (`.launch` files) in.
20+
21+
Select `File` > `New...` > `Project` > `General` > `Project`, and give it a meaningful name (`Connections`).
22+
23+
### RSE (Cortex-M55)
24+
25+
Runtime Security Engine (RSE) is based on [Cortex-M55](https://developer.arm.com/Processors/Cortex-M55) core and is a security subsystem fulfilling the role of Root of Trust.
26+
27+
Select `File` > `New` > `Model Connection`.
28+
29+
{{% notice Note %}}
30+
You can also use `File` > `New` > `Other` > `Arm Debugger` > `Model Connection`, or
31+
32+
`Create a debug connection...` shortcut in the `Debug Control` pane.
33+
{{% /notice %}}
34+
35+
Specify a connection name (`RSE`), and associate with the above `Connections` project. Click `Next`.
36+
37+
Locate the FVP based on the name you gave it previously (`Zena_CSS_FVP`). The text filter can help locate easily.
38+
39+
You will then be presented with the `Edit configuration` pane. In the `Connection` tab, scroll down to locate `Bare Metal Debug` > `Arm_Cortex-M55`.
40+
41+
As we shall be later launching the FVP with the software stack loaded, select `Connect to an already running model`.
42+
43+
Assuming the same host will be running both the FVP and the debugger, specify the `Connection address` as the default `127.0.0.1:7100`.
44+
45+
{{% notice Note %}}
46+
`127.0.0.1` is the same as `localhost`, that is the same host machine as is running the FVP.
47+
48+
It is also possible to connect to a remote host by specifying appropriate IP address, and launching FVP with the `-A` option.
49+
50+
`7100` is the default port number. You may need to change this if necessary.
51+
{{% /notice %}}
52+
53+
Click `Apply` to save the connection information, and `Close`. Observe that `RSE.launch` is created inside the `Connections` project.
54+
55+
### Safety Island (Cortex-R82AE)
56+
57+
The Safety Island is a subsystem based on [Cortex-R82AE](https://developer.arm.com/Processors/Cortex-R82AE) core. The software running on the Safety Island is responsible for power, clock and CMN control.
58+
59+
The procedure to create this connection is very similar to the above, other than to select `Bare Metal Debug` > `Arm_Cortex-R82AE` from the pull down.
60+
61+
{{% notice %}}
62+
For convenience you can copy-and-paste `RSE.launch` as `SI.launch` and simply modify the CPU.
63+
{{% /notice %}}
64+
65+
### Primary Compute (Cortex-A720AE)
66+
67+
The Primary Compute consists of four processor clusters to run a rich OS such as Linux. Each processor cluster includes four [Cortex-A720AE](https://developer.arm.com/Processors/Cortex-A720AE) cores and a [DSU-120AE](https://developer.arm.com/Processors/DSU-120AE) DynamIQ Shared Unit.
68+
69+
The application processors will be debugged in an SMP configuration with Linux Kernel awareness.
70+
71+
As above, create `Primary_init.launch` connection and scroll to `Bare Metal Debug` > `ARM_Cortex-A720AE_0`. This will connect to just CPU0, leaving the other CPUs free to run.
72+
73+
To debug the Linux kernel we can make use of the [OS awareness](https://developer.arm.com/documentation/101470/latest/Debugging-Embedded-Systems/About-OS-awareness) feature of the Arm Debugger.
74+
75+
Create `Primary_Linux.launch` connection and scroll to `Linux Kernel Debug` > `ARM_Cortex-A720AEx16 SMP Cluster 1`. This will connect to all 16 `Cortex-A720AE` processors present in the FVP, though only cores 0-3 are used.
145 KB
Loading
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
# User change
3+
title: "Launch FVP"
4+
5+
weight: 3 # 1 is first, 2 is second, etc.
6+
7+
# Do not modify these elements
8+
layout: "learningpathall"
9+
---
10+
11+
## Launch FVP
12+
13+
From the [documentation](https://arm-auto-solutions.docs.arm.com/en/v2.0/rd-aspen/user_guide/reproduce.html#run-the-fvp) the default command to launch the FVP (within the virtual environment) with the software stack loaded is:
14+
15+
```command
16+
kas shell -c "../layers/meta-arm/scripts/runfvp -t tmux --verbose"
17+
```
18+
19+
It is sensible to continue to use this method to launch the FVP whilst debugging. However this command as shown does not enable the Iris debug server inside the model, and so will not be debuggable.
20+
21+
Additional command options are necessary.
22+
23+
We will use the following. See output of `FVP_RD_Aspen --help` for full list and explanation. Options are case-sensitive.
24+
25+
| Option | Alias | Notes |
26+
|---------------------- |--------- |---------------------------------------------- |
27+
| `--iris-server` | `-I` | Start Iris Debug Server |
28+
| `--iris-port` | | Specify a port number (default = `7100`) |
29+
| `--run` | `-R` | Run simulation when debug server started |
30+
| `--iris-allow-remote` | `-A` | Allow remote connections (if different hosts) |
31+
32+
### Launch FVP with additional options
33+
34+
To launch the FVP with additional options, modify the above command by adding `--` and then the options.
35+
36+
For example, to launch the model with the debug server and hold at the initial reset condition:
37+
38+
```command
39+
kas shell -c "../layers/meta-arm/scripts/runfvp -t tmux --verbose -- --iris-server --iris-port 7100"
40+
```
41+
42+
To launch the model and start running (so that it can start to boot up):
43+
44+
```command
45+
kas shell -c "../layers/meta-arm/scripts/runfvp -t tmux --verbose -- --iris-server --iris-port 7100 --run"
46+
```
47+
48+
To launch the model so that remote hosts can access it (not recommended if not needed), using options aliases:
49+
50+
```command
51+
kas shell -c "../layers/meta-arm/scripts/runfvp -t tmux --verbose -- -I -A --iris-port 7100"
52+
```
53+
54+
{{% notice Note %}}
55+
It is recommended to specify the port number used even if it is the default as that must match the debug connection setting (see later).
56+
{{% /notice %}}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
# User change
3+
title: "Debug Primary Compute and Linux"
4+
5+
weight: 8 # 1 is first, 2 is second, etc.
6+
7+
# Do not modify these elements
8+
layout: "learningpathall"
9+
---
10+
11+
## Debug Primary Compute
12+
13+
The Primary Compute application processors (`Cortex-A720AE`) are the final processors to be enabled.
14+
15+
As before we can connect whilst powered down and monitor the point that they are enabled.
16+
17+
You can debug the initialization code and/or the final Linux Operating System (OS) threads.
18+
19+
### Connect debugger to target
20+
21+
Use the following debugger commands in the `Primary_init.launch` to load the symbols for the `BL2` initialization code, setting a breakpoint at `bl2_entrypoint`.
22+
23+
Note that an address "offset" is used to specify the exception level that the image is relevant to. If the processor changes exception level, the debug information would need to also be loaded to the corresponding EL address space.
24+
25+
For example the processors start in `EL3` and move to `EL2N` when the Linux kernel is enabled.
26+
27+
``` text
28+
stop
29+
add-symbol-file /arm-auto-solutions/build/tmp_baremetal/work/fvp_rd_aspen-poky-linux/trusted-firmware-a/2.11.0+git/image/firmware/bl2.elf EL3:0x0
30+
tbreak bl2_entrypoint
31+
```
32+
{{% notice Note %}}
33+
Exact paths may differ for your set up.
34+
{{% /notice %}}
35+
36+
Run the code to the `bl2_entrypoint` and you can debug as expected.
37+
38+
### Debug Linux kernel modules
39+
40+
To make use of the OS awareness, disconnect `Primary_init` and connect to `Primary_Linux` as created previously. Load the symbols from `vmlinux` image.
41+
42+
``` text
43+
stop
44+
add-symbol-file /arm-auto-solutions/build/tmp_baremetal/work/fvp_rd_aspen-poky-linux/linux-yocto/6.6.54+git/linux-fvp_rd_aspen-standard-build/vmlinux EL2N:0x0
45+
set substitute-path /usr/src/kernel/ /arm-auto-solutions/build/tmp_baremetal/work-shared/fvp-rd-aspen/kernel-source/
46+
```
47+
Run the FVP until the OS prompt appears.
48+
49+
{{% notice %}}
50+
If only interested in kernel debug, modify the launch command for the FVP to include `--run` to start execution immediately.
51+
52+
``` command
53+
kas shell -c "../layers/meta-arm/scripts/runfvp -t tmux --verbose -- --iris-server --iris-port 7100 --run"
54+
```
55+
{{% /notice %}}
56+
57+
You can now enable the `Threads` view in the `Debug Control` pane.
58+
59+
Right-click on the connection, and select `Display Threads`. You can also do this by entering `thread` in the `Command` pane.
60+
61+
The view will then change from listing the 16 application processors to the OS threads.
62+
63+
{{% notice Note %}}
64+
A warning of the form:
65+
``` text
66+
WARNING(ROS60): Could not enable OS support as the OS does not appear to be initialized. This might be caused by a mismatch between the loaded symbols and the code on the target or because the OS is not up and running. Enabling OS support will be re-attempted when the target next stops.
67+
```
68+
may be emitted if the OS is not booted when you connect. It can safely be ignored.
69+
{{% /notice %}}

0 commit comments

Comments
 (0)