Skip to content

Initial tech review of Linux on FVP LP #1986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ title: Run and Debug a Linux Software Stack on Arm Virtual Platforms

minutes_to_complete: 180

draft: true
cascade:
draft: true

who_is_this_for: This introductory topic is designed for developers interested in running Linux on Arm Fixed Virtual Platforms (FVPs) and debugging Trusted Firmware-A and the Linux Kernel using Arm Development Studio.

learning_objectives:
learning_objectives:
- Run a Linux software stack using Arm Fixed Virtual Platforms.
- Debug the firmware and Linux kernel using Arm Development Studio.

Expand All @@ -33,7 +29,7 @@ tools_software_languages:

further_reading:
- resource:
title: Fast Models Fixed Virtual Platforms Reference Guide
title: Fast Models Fixed Virtual Platforms Reference Guide
link: https://developer.arm.com/documentation/100966/
type: documentation
- resource:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,90 +6,32 @@ weight: 6
layout: learningpathall
---

## Debug using Arm Development Studio

To debug TF-A and Linux kernel, you can use the Arm Development Studio (Arm DS) debugger. You can get it from the [Arm Development Studio download page](https://developer.arm.com/downloads/view/DS000B).

DWARF 5 is the default option in GCC 11 and Arm Development Studio version v2022.2 includes initial support for DWARF 5 debug information.

If your GCC version is later than GCC 11, download the latest Arm Development Studio to get support for DWARF 5.

Arm Development Studio includes the following Base FVP models:

* FVP_Base_Cortex-A32x1
* FVP_Base_Cortex-A35x1
* FVP_Base_Cortex-A510x2
* FVP_Base_Cortex-A53x1
* FVP_Base_Cortex-A55x1
* FVP_Base_Cortex-A55x4+Cortex-A75x2
* FVP_Base_Cortex-A55x4+Cortex-A76x2
* FVP_Base_Cortex-A57x1
* FVP_Base_Cortex-A57x2-A53x4
* FVP_Base_Cortex-A65AEx2
* FVP_Base_Cortex-A65x2
* FVP_Base_Cortex-A710x2
* FVP_Base_Cortex-A72x1
* FVP_Base_Cortex-A72x2-A53x4
* FVP_Base_Cortex-A73x1
* FVP_Base_Cortex-A73x2-A53x4
* FVP_Base_Cortex-A75x1
* FVP_Base_Cortex-A76AEx2
* FVP_Base_Cortex-A76x1
* FVP_Base_Cortex-A77x2
* FVP_Base_Cortex-A78AEx2
* FVP_Base_Cortex-A78Cx2
* FVP_Base_Cortex-A78x2
* FVP_Base_Cortex-X1Cx2
* FVP_Base_Cortex-X1x2
* FVP_Base_Cortex-X2x2

Arm FVPs that are not provided by Arm DS installation must be defined in the PATH environment variable to be available for Arm Development Studio. Otherwise, you might get the following error when starting the debug connection.

![Connection Failed Screen #center](failed.png")

For Linux, set up the PATH in the appropriate shell configuration file.

For example, add the following line in your `~/.bashrc` file:

```console
export PATH=<your model path>/bin:$PATH
```

After changing the search PATH, you need to start Arm Development Studio from a terminal with the new PATH.

Start Development Studio by running the `armds_ide` command:

```console
/opt/arm/developmentstudio-2022.2/bin/armds_ide
```

![Arm DS IDE #center](armds_ide.png)

## FVP Debug Connection

Before debugging, the FVP model you want to use must be available in the Arm DS configuration database so that you can select it in the Model Connection dialog box.

If the FVP model is not available, you must import it and create a new model configuration. For details, see [create a new model](https://developer.arm.com/documentation/101470/2022-2/Platform-Configuration/Model-targets/Create-a-new-model-configuration).
## Debug the Software Stack with Arm Development Studio

Most CPU FVP models are available for your edition of Arm DS and the FVPs are listed under the Arm FVP (Installed with Arm DS) and Arm FVP as shown in the following figure:
Once your software stack is running on the FVP, you can debug Trusted Firmware-A and the Linux kernel using Arm Development Studio (Arm DS).

![Debug Configurations screen #center](debug_config.png)
### Step 1: Install Arm Development Studio

To use Arm DS to connect to an FVP model for bare-metal debugging, perform the following steps:
Download and install the latest version from the [Arm Development Studio download page](https://developer.arm.com/downloads/view/DS000B).

1. From the Arm Development Studio main menu, select Run > Debug Configurations.
DWARF 5 is enabled by default in GCC 11 and later. Arm DS v2022.2 or newer is recommended to support DWARF 5 debug information.

2. Select the Generic Arm C/C++ Application from the left panel and click the new launch configuration button to create a new debug configuration.

3. In the Connection tab, select the target and connection settings:

In the Select target panel confirm the target selected. For example, select Arm FVP (Installed with Arm DS) Base_A55 x4 > Bare Metal Debug:
Launch Arm DS:
```
/opt/arm/developmentstudio-2022.2/bin/armds_ide
```

![Select target #center](Select_target.png)

Specify the Model parameters under the Connections. The model parameters are similar to those listed below. These parameters are described at the section Run software stack on FVP. Different CPU FVPs might have different parameters.
### Step 2: Create a Debug Configuration
1. Open Arm DS, go to Run > Debug Configurations.
2. Select Generic Arm C/C++ Application and create a new configuration.
3. In the Connection tab:
- Choose your FVP model (e.g., Base_A55x4).
- Enter model parameters:

```console
```output
-C pctl.startup=0.0.0.0 \
-C bp.secure_memory=0 \
-C cache_state_modelled=0 \
Expand All @@ -108,27 +50,40 @@ Specify the Model parameters under the Connections. The model parameters are sim
--data cluster0.cpu0=<SRC_PATH>/output/aemfvp-a/aemfvp-a/fvp-base-revc.dtb@0x83000000
```

4. Configure debugger settings in the Debugger
### Step 3: Load Debug Symbols

In Run control, choose Connect only to the target.
In the Debugger tab:
- Select “Connect only to the target.”
- Enable Execute debugger commands and add:
```output
add-symbol-file "~/arm/sw/cpufvp-a/arm-tf/build/fvp/debug/bl1/bl1.elf" EL3:0
add-symbol-file "~/arm/sw/cpufvp-a/arm-tf/build/fvp/debug/bl2/bl2.elf" EL1S:0
add-symbol-file "~/arm/sw/cpufvp-a/arm-tf/build/fvp/debug/bl31/bl31.elf" EL3:0
add-symbol-file "~/arm/sw/cpufvp-a/linux/out/aemfvp-a/defconfig/vmlinux" EL2N:0
```

5. Select the Execute debugger commands option and add load symbols commands if you want to debug your application at source level. For example, add TF-A and Linux kernel debug symbols as follows:
Click Apply and then Close.

```
add-symbol-file “~/arm/sw/cpufvp-a/arm-tf/build/fvp/debug/bl1/bl1.elf” EL3:0
add-symbol-file “~/arm/sw/cpufvp-a/arm-tf/build/fvp/debug/bl2/bl2.elf” EL1S:0
add-symbol-file “~/arm/sw/cpufvp-a/arm-tf/build/fvp/debug/bl31/bl31.elf” EL3:0
add-symbol-file “~/arm/sw/cpufvp-a/linux/out/aemfvp-a/defconfig/vmlinux” EL2N:0
```
### Step 4: Start Debugging

1. In the Debug Control view, double-click your new configuration.
2. Wait for the target to connect and symbols to load.
3. Set breakpoints, step through code, and inspect registers or memory.

You might get the following error when starting the debug connection.

6. Click Apply and then Close to save the configuration settings and close the Debug Configurations dialog box.
![Connection Failed Screen #center](failed.png)

7. In the Debug Control view, double-click the debug configuration that you create.
This means your Arm FVP is not provided by default in the Arm DS installation. Set the `PATH` in this case:

This step starts the debug connection, loads the application on the model, and loads the debug information into the debugger.
```bash
export PATH=<your model path>/bin:$PATH
```

8. Set breakpoints and click Continue running application to continue running your FVP.
{{% notice tip %}}
Ensure your FVP instance is running and matches the model and parameters selected in Arm DS.
{{% /notice %}}

9. After these steps, you can debug the software stack as shown in the following figure:
After these steps, you can debug the software stack as shown in the following figure:

![FVP running #center](Select_target.png)
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,76 +1,46 @@
---
title: Introduction to Arm Ecosystem Fixed Virtual Platforms
title: Introduction to Arm Fixed Virtual Platforms (FVPs)
weight: 2

### FIXED, DO NOT MODIFY
layout: learningpathall
---

Arm Ecosystem Fixed Virtual Platforms (FVPs) model hardware subsystems and target different market segments and applications.
Arm Fixed Virtual Platforms (FVPs) are simulation models that let you run and test full software stacks on Arm systems before physical hardware is available. They replicate the behavior of Arm CPUs, memory, and peripherals using fast binary translation.

FVPs use binary translation technology to deliver fast, functional simulations of Arm-based systems, including processor, memory, and peripherals. They implement a programmer's view suitable for software development and enable execution of full software stacks, providing an available platform to run software before silicon is available.
### Why Use FVPs?
FVPs are useful for developers who want to:
- Prototype software before silicon availability
- Debug firmware and kernel issues
- Simulate multicore systems

Arm provides two different types of FVPs.
FVPs provide a programmer's view of the hardware, making them ideal for system bring-up, kernel porting, and low-level debugging.

## Arm Ecosystem FVPs
### Freely Available Arm Ecosystem FVPs
Several pre-built Armv8-A FVPs can be downloaded for free from the [Arm Ecosystem Models](https://developer.arm.com/Tools%20and%20Software/Fixed%20Virtual%20Platforms#Downloads) page. Categories include:
- Architecture
- Automotive
- Infrastructure
- IoT

There are several freely available, pre-built Armv8‑A FVPs for download from [Arm Ecosystem Models](https://developer.arm.com/Tools%20and%20Software/Fixed%20Virtual%20Platforms#Downloads) on the Arm Developer website. You can use these FVPs without a license.
A popular model is the **AEMv8-A Base Platform RevC**, which supports Armv8.7 and Armv9-A. The [Arm reference software stack](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst) is designed for this model.

There are multiple categories of Ecosystem FVPs such as:
- Architecture FVPs
- Automotive FVPs
- Infrastructure FVPs
- IoT FVPs
### CPU-Specific Arm Base FVPs
Other FVPs target specific CPU types and come pre-configured with a fixed number of cores. These are often called **CPU FVPs**.

For example, in the architecture category, the AEMv8-A Base Platform RevC FVP is freely available, and it supports the latest Armv8‑A architecture versions up to v8.7 and Armv9-A.
Here are some examples:
- FVP_Base_Cortex-A55x4
- FVP_Base_Cortex-A72x4
- FVP_Base_Cortex-A78x4
- FVP_Base_Cortex-A510x4+Cortex-A710x4

The [Arm reference software stack](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst) is based on the above RevC model.
To use these, request access via [support@arm.com](mailto:support@arm.com).

## Arm Base FVPs specific CPU types
### Setting Up Your Environment
This Learning Path uses the [Arm reference software stack](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst).

Arm Base Armv8-A FVPs with specific CPU types are configured with a fixed number of cores. These are also called CPU FVPs because they specify the CPU types instead of the architecture version.

The FVP_Base_Cortex-\<xxx> FVP is available for you to build and run on Linux computers. Contact Arm Support [support@arm.com](mailto:support@arm.com) to request access.

You can use any of the FVPs listed below to run the reference software stack:

* FVP_Base_Cortex-A510x4
* FVP_Base_Cortex-A510x4+Cortex-A710x4
* FVP_Base_Cortex-A53x4
* FVP_Base_Cortex-A55x4
* FVP_Base_Cortex-A55x4+Cortex-A75x4
* FVP_Base_Cortex-A55x4+Cortex-A78x4
* FVP_Base_Cortex-A57x2-A35x4
* FVP_Base_Cortex-A57x2-A53x4
* FVP_Base_Cortex-A57x4
* FVP_Base_Cortex-A57x4-A35x4
* FVP_Base_Cortex-A57x4-A53x4
* FVP_Base_Cortex-A65AEx4
* FVP_Base_Cortex-A65AEx4+Cortex-A76AEx4
* FVP_Base_Cortex-A65x4
* FVP_Base_Cortex-A710x4
* FVP_Base_Cortex-A72x2-A53x4
* FVP_Base_Cortex-A72x4
* FVP_Base_Cortex-A72x4-A53x4
* FVP_Base_Cortex-A73x2-A53x4
* FVP_Base_Cortex-A73x4
* FVP_Base_Cortex-A73x4-A53x4
* FVP_Base_Cortex-A75x4
* FVP_Base_Cortex-A76AEx4
* FVP_Base_Cortex-A76x4
* FVP_Base_Cortex-A77x4
* FVP_Base_Cortex-A78AEx4
* FVP_Base_Cortex-A78Cx4
* FVP_Base_Cortex-A78x4
* FVP_Base_Cortex-X1Cx4
* FVP_Base_Cortex-X1x4
* FVP_Base_Cortex-X2x4
* FVP_Base_Neoverse-E1x4
* FVP_Base_Neoverse-N1x4

### Set up the environment

This Learning Path uses the [Arm reference software](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst) stack.

Follow the [Armv-A Base AEM FVP Platform Software User Guide](https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-docs/-/blob/master/docs/aemfvp-a/user-guide.rst) to set up the environment, download the software stack, and get the toolchain.
To get started:
1. Follow the software user guide to download the stack.
2. Set up the required toolchain and environment variables.

Once configured, you’ll be ready to run and debug Linux on your selected Arm FVP model.
Loading
Loading