diff --git a/content/learning-paths/laptops-and-desktops/system76-auto/_index.md b/content/learning-paths/laptops-and-desktops/system76-auto/_index.md new file mode 100644 index 0000000000..001d278dd6 --- /dev/null +++ b/content/learning-paths/laptops-and-desktops/system76-auto/_index.md @@ -0,0 +1,32 @@ +--- +title: Develop Arm automotive software on the System76 Thelio Astra + +minutes_to_complete: 60 + +who_is_this_for: This is an introductory topic for automotive developers interested in local development using the System76 Thelio Astra Linux desktop computer. + +learning_objectives: + - Create an efficient automotive development environment on the System76 Thelio Astra desktop. + - Build and run the Arm Automotive Solutions Software Reference Stack locally. + +prerequisites: + - A System76 Thelio Astra desktop computer running Ubuntu 24.04. + +author_primary: Jason Andrews + +### Tags +skilllevels: Introductory +subjects: Containers and Virtualization +armips: + - Neoverse +operatingsystems: + - Linux +tools_software_languages: + - Automotive + +### FIXED, DO NOT MODIFY +# ================================================================================ +weight: 1 # _index.md always has weight of 1 to order correctly +layout: "learningpathall" # All files under learning paths have this same wrapper +learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content. +--- diff --git a/content/learning-paths/laptops-and-desktops/system76-auto/_next-steps.md b/content/learning-paths/laptops-and-desktops/system76-auto/_next-steps.md new file mode 100644 index 0000000000..05846422f7 --- /dev/null +++ b/content/learning-paths/laptops-and-desktops/system76-auto/_next-steps.md @@ -0,0 +1,27 @@ +--- +# ================================================================================ +# Edit +# ================================================================================ + +next_step_guidance: > + You have successfully learned how to build and run the Arm Automotive Solutions Software Reference Stack on the System76 Thelio Astra. + +recommended_path: "/learning-paths/cross-platform/docker-build-cloud/" + +further_reading: + - resource: + title: Arm Automotive Solutions Documentation + link: https://arm-auto-solutions.docs.arm.com/en/v1.1/index.html + type: documentation + - resource: + title: Parsec + link: https://parsec.community/ + type: documentation + +# ================================================================================ +# FIXED, DO NOT MODIFY +# ================================================================================ +weight: 21 # set to always be larger than the content in this path, and one more than 'review' +title: "Next Steps" # Always the same +layout: "learningpathall" # All files under learning paths have this same wrapper +--- diff --git a/content/learning-paths/laptops-and-desktops/system76-auto/_review.md b/content/learning-paths/laptops-and-desktops/system76-auto/_review.md new file mode 100644 index 0000000000..52e2e4b39c --- /dev/null +++ b/content/learning-paths/laptops-and-desktops/system76-auto/_review.md @@ -0,0 +1,42 @@ +--- +# ================================================================================ +# Edit +# ================================================================================ + +# Always 3 questions. Should try to test the reader's knowledge, and reinforce the key points you want them to remember. + # question: A one sentence question + # answers: The correct answers (from 2-4 answer options only). Should be surrounded by quotes. + # correct_answer: An integer indicating what answer is correct (index starts from 0) + # explanation: A short (1-3 sentence) explanation of why the correct answer is correct. Can add additional context if desired + + +review: + - questions: + question: > + To get enough memory, the Arm Automotive Solutions Software Reference Stack must be built on an Arm cloud instance. + answers: + - "True" + - "False" + correct_answer: 2 + explanation: > + You can build the automotive software stack on a local machine using the System76 Thelio Astra Linux desktop. + + - questions: + question: > + Which things below are benefits of Parsec? + answers: + - "Platform Agnostic API" + - "Secure boot and attestation" + - "Key management and cryptography" + - "All of the above" + correct_answer: 4 + explanation: > + All of these help Parsec provide unified access to hardware security. + +# ================================================================================ +# FIXED, DO NOT MODIFY +# ================================================================================ +title: "Review" # Always the same title +weight: 20 # Set to always be larger than the content in this path +layout: "learningpathall" # All files under learning paths have this same wrapper +--- diff --git a/content/learning-paths/laptops-and-desktops/system76-auto/build.md b/content/learning-paths/laptops-and-desktops/system76-auto/build.md new file mode 100644 index 0000000000..d30f867dcb --- /dev/null +++ b/content/learning-paths/laptops-and-desktops/system76-auto/build.md @@ -0,0 +1,54 @@ +--- +# User change +title: "Build the Arm Automotive Solutions Software Reference Stack" + +weight: 3 + +layout: "learningpathall" +--- + +The Arm Automotive Solutions Software Reference Stack can be run on the Arm Reference Design-1 AE. + +This is a concept hardware design built on the Neoverse V3AE Application Processor (as primary compute) and augmented with an Arm Cortex-R82AE based safety island. + +The system additionally includes a Runtime Security Engine (RSE) used for the secure boot and runtime secure services. + +The software stack consists of firmware, boot loader, hypervisor, Linux kernel, file system, and applications. + +The development environment uses the Yocto Project build framework. + +## Build the automotive software stack + +The Thelio Astra makes it possible to build the complete software stack on an Arm-based local machine, instead of alternatives such as an Arm-based cloud instances or a non-Arm desktop computer. + +You can build the Using the Arm Automotive Solutions Software Reference Stack from the command line of the Ubuntu 20.04 Multipass virtual machine. + +Create a new directory and clone the repository: + +```console +mkdir -p ~/arm-auto-solutions +cd ~/arm-auto-solutions +git clone https://git.gitlab.arm.com/automotive-and-industrial/arm-auto-solutions/sw-ref-stack.git --branch v1.1 +``` + +Open the configuration menu: + +```console +kas menu sw-ref-stack/Kconfig +``` + +Use the space bar and arrow keys to select the three components show in the screen capture below: +- Accept the END USER LICENSE AGREEMENT +- Safety Island Actuation Demo +- Baremetal + +![configuration #center](configure.png) + +{{% notice Note %}} +To build and run you much accept the EULA. +{{% /notice %}} + +Use tab to navigate to the `Build` button and press enter to start the build. + +The build will take some time, depending on the number of CPUs in your virtual machine. + diff --git a/content/learning-paths/laptops-and-desktops/system76-auto/configure.png b/content/learning-paths/laptops-and-desktops/system76-auto/configure.png new file mode 100644 index 0000000000..6bf63fccb5 Binary files /dev/null and b/content/learning-paths/laptops-and-desktops/system76-auto/configure.png differ diff --git a/content/learning-paths/laptops-and-desktops/system76-auto/run.md b/content/learning-paths/laptops-and-desktops/system76-auto/run.md new file mode 100644 index 0000000000..f8e096b5c9 --- /dev/null +++ b/content/learning-paths/laptops-and-desktops/system76-auto/run.md @@ -0,0 +1,139 @@ +--- +# User change +title: "Run the Parsec demo" + +weight: 4 + +layout: "learningpathall" +--- + + +There are a number of example applications which demonstrate the software stack running the reference hardware system modeled by a Fixed Virtual Platform (FVP). The Parsec demo is explained below. + +The [Parsec-enabled TLS demo](https://arm-auto-solutions.docs.arm.com/en/v1.1/design/applications/parsec_enabled_tls.html) illustrates a HTTPS session. A simple web page is transferred using a Transport Layer Security (TLS) connection. + +Parsec, or Platform AbstRaction for SECurity, is an open-source initiative that provides a common API to hardware security and cryptographic services. + +This enables applications to interact with the secure hardware of a device without needing to know the specific details of the hardware itself. The Parsec abstraction layer makes it easier to develop secure applications that can run on different devices and platforms.   + +Follow the instructions below to run the Parsec demo. + +## Run the Parsec SSL demo + +From the command line, start a Tmux session. + +```console +tmux new-session -s arm-auto-solutions +``` + +Tmux makes it possible to connect to the output from multiple hardware subsystems in the reference design. + +To run the software stack on the FVP run: + +```console +cd ~/arm-auto-solutions +kas shell -c "../layers/meta-arm/scripts/runfvp -t tmux --verbose" +``` + +This will run the entire software stack on a model of the hardware. + +At anytime you can use Tmux to interact with the different subsystems using `Ctrl-b` then `w` to bring up a list of windows. Use the arrow keys to select a window. + +After the software boots, you reach a Linux login prompt: `fvp-rd-kronos login:` + +Enter `root` for the login name, no password is required. + +Make sure the initialization process is complete by running: + +```console +systemctl is-system-running --wait +``` + +If the output is `running`, continue to the next step. If not, re-run the command until the output is `running`. + +On the primary compute run the SSL server: + +```console +ssl_server & +``` + +The output from the server is printed: + +```output + . Seeding the random number generator... ok + . Loading the server cert. and key... ok + . Bind on https://localhost:4433/ ... ok + . Setting up the SSL data.... ok + . Waiting for a remote connection ... +``` + +The SSL client runs in a standard Ubuntu 22.04 container and requests a web page from the SSL server. The client has been modified to use Parsec, making it more portable and abstracting the details of the hardware security services. + +Run the Parsec enabled SSL client: + +```console +docker run --rm -v /run/parsec/parsec.sock:/run/parsec/parsec.sock -v /usr/bin/ssl_client1:/usr/bin/ssl_client1 --network host docker.io/library/ubuntu:22.04 ssl_client1 +``` + +The container will be downloaded and run. The SSL client application named `ssl_client1` runs. + +The client application requests a webpage from the SSL server and the output is: + +```output + . Seeding the random number generator... ok + . Loading the CA root certificate ... ok (0 skipped) + . Connecting to tcp/localhost/4433... ok + . Performing the SSL/TLS handshake... ok + . Setting up the SSL/TLS structure... ok + . Performing the SSL/TLS handshake... ok + < Read from client: 18 bytes read + +GET / HTTP/1.0 + + > Write to client: ok + . Verifying peer X.509 certificate... ok + > Write to server: 156 bytes written + +HTTP/1.0 200 OK +Content-Type: text/html + +

Mbed TLS Test Server

+

Successful connection using: TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256

+ + . Closing the connection... ok + . Waiting for a remote connection ... 18 bytes written + +GET / HTTP/1.0 + + < Read from server: 156 bytes read + +HTTP/1.0 200 OK +Content-Type: text/html + +

Mbed TLS Test Server

+

Successful connection using: TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256

+``` + +## Shutdown and clean up + +You can shut down the simulated system: + +```console +shutdown now +``` + +You will return to the command line. + +Type `exit` to leave the Tmux session and `exit` again to leave the Multipass virtual machine. + +To delete the Multipass VM run the commands: + +```console +multipass stop u20-32 +multipass delete u20-32 +multipass purge +``` + +You have run the Parsec example from the Arm Automotive Solutions Software Reference Stack. + +There are many other example applications you can run, refer to the Further Reading section. \ No newline at end of file diff --git a/content/learning-paths/laptops-and-desktops/system76-auto/setup.md b/content/learning-paths/laptops-and-desktops/system76-auto/setup.md new file mode 100644 index 0000000000..b2c67e0329 --- /dev/null +++ b/content/learning-paths/laptops-and-desktops/system76-auto/setup.md @@ -0,0 +1,103 @@ +--- +# User change +title: "Set up an automotive development environment" + +weight: 2 + +layout: "learningpathall" +--- + +## Before you begin + +This Learning Path explains how to do automotive software development using the [System76 Thelio Astra](https://system76.com/desktops/thelio-astra) Linux desktop computer running Ubuntu. + +Before you begin, install Multipass using the [Multipass install guide](/install-guides/multipass/) for Arm Linux. Multipass is used to create a cloud style virtual machine on your desktop computer. + +### About the Thelio Astra + +Thelio Astra is an Arm-based desktop computer designed for autonomous vehicle development and other general purpose Arm software development. + +It uses the Ampere Altra processor, based on Arm Neoverse N1, and ships with the Ubuntu operating system. + +An NVIDIA GPU is included for high performance graphics, and the system can be configured with up to 512 GB of RAM and up to 16 TB of storage. This Learning Path was created using a Thelio Astra with 64 CPUs, 64 GB of RAM, and 1 TB of storage. + +Some of the benefits of using a Thelio Astra for automotive development include: + +- **Access to native performance:** You can execute build and test cycles directly on Arm Neoverse processors, eliminating the performance overhead and complexities associated with instruction emulation and cross-compilation. +- **Improved virtualization:** Familiar virtualization and container tools on Arm simplify the development and test process. +- **Better cost-effectiveness:** There are cost savings of having a local computer with a high core count, large memory, and plenty of storage. +- **Enhanced compatibility:** Support for Arm CPUs and NVIDIA GPUs eliminates the need for Arm instruction emulation, which simplifies the developer process and overall experience. +- **Optimized developer process:** The development process can be optimized by enabling you to run large software stacks on your local machine, making it easier to fix issues and improve performance. + +## Create a virtual machine using Multipass + +A Multipass virtual machine is a good way to create the required automotive development environment and isolate the build and test process. Using Multipass also allows you to split the resources of the Thelio Astra and specify the number of CPUs and the portion of memory and storage for the development environment. It's also easy to delete the VM and create a new one anytime. + +The Arm Automotive Solutions Software Reference Stack requires Ubuntu 20.04 for the build and test machine. The Thelio Astra ships with either Ubuntu 22.04 or 24.04. With Multipass, you can use Ubuntu 20.04 for the development environment, isolate the development from the native operating system, and avoid any compatibility issues. + +To get started, create a Multipass virtual machine named `u20-32` with Ubuntu 20.04 and 32 CPUs: + +```console +multipass launch 20.04 --name u20-32 --cpus 32 --disk 250G --memory 32G +``` + +You can configure different values or CPUs, disk space, and memory, but the more resources you use the faster the builds will complete. + +Start a bash shell in the Ubuntu 20.04 VM: + +```console +multipass shell u20-32 +``` + +Update the Ubuntu software: + +```console +sudo apt update ; sudo apt upgrade -y +``` + +### Create swap space + +Building the automotive software stack requires significant memory resources, so it's best to create swap space. Without swap space, some build processes may fail due to lack of memory. + +Create 10 GB of swap space: + +``` +sudo fallocate -l 10G /swapfile +sudo chmod 600 /swapfile +sudo mkswap /swapfile +sudo swapon /swapfile +``` + +To confirm the swap space has been created run: + +```console +swapon --show +``` + +The output shows the swap space: + +```output +NAME TYPE SIZE USED PRIO +/swapfile file 10G 0B -2 +``` + +### Install the required development tools + +A number of development tools are required to build the Arm Automotive Solutions Software Reference Stack. + +Install the required software: + +```console +sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool file locales libacl1 -y +``` + +Configure the locale and install [Kas](https://kas.readthedocs.io/en/latest/index.html), a setup tool for [BitBake](https://docs.yoctoproject.org/bitbake/): + +```console +sudo locale-gen en_US.UTF-8 +sudo -H pip3 install --upgrade kas==4.3.2 && sudo apt install python3-newt -y +``` + +You now have a Multipass virtual machine running Ubuntu 20.04 with the required swap space and the required development tools installed. + +Proceed to the next section to build the Arm Automotive Solutions Software Reference Stack.