/AVH-Hello

This repository contains a CI project with a test matrix that uses GitHub Actions on a GitHub-hosted runner with an Ubuntu Linux system.

Primary LanguageCApache License 2.0Apache-2.0

License Build and Execution Test

AVH-Hello

This repository contains a CI project with a test matrix that uses GitHub Actions on a GitHub-hosted runner with an Ubuntu Linux system. The application module hello.c prints "Hello World" with count value to the UART output. It is configured for Arm Virtual Hardware - Fixed Virtual Platforms (AVH FVP), but it is easy to re-target it to hardware that provides a CMSIS Driver:USART.

The test matrix validates the application with GCC and Arm Compiler using a Debug and Release build. It builds and runs the application across the different Arm Cortex-M processors and various Arm Corstone sub-systems. It total it validates that 56 different variants execute correct on AVH FVP simulation models that represent a typical implementation of an Arm processor.

Prerequisites

Project Structure

The project is defined as CMSIS Solution Project that describes the build process for the CMSIS-Toolbox.

Files and directories Content
.github/workflows/ GitHub Action file hello-ci.yml defines a test matrix (with compiler, target, build types) that is iterated to build and run different variants of the application.
Board_IO/ I/O re-targeting to a CMSIS-Driver UART interface.
FVP/ Configuration files for the AVH FVP simulation models.
RTE/Device/ Includes for each device (target-type) the RTE_Device.h file with CMSIS-Driver configuration.
RTE/CMSIS/ RTOS configuration file RTX_Config.h used for all devices (targets).
Hello.csolution.yml Lists the required packs and defines the hardware target and build-types.
Hello.cproject.yml Defines the source files and the software components.
cdefault.yml Contains the setup for different compilers (AC6, GCC, IAR, and CLANG).
vcpkg-configuration.json Specifies the required tools for vcpkg; it is configured to install the latest tool versions.
main.c / main.h Application startup with CMSIS-RTOS
hello.c Test application that prints "Hello World <count>".

Note:

The privileged mode in RTX_Config.h is enabled, to allow the USART initialization.

The workflow allows to build and test the application on different host systems, for example local development computers that are Windows based and CI systems that run Linux.

Build on Local Development Computer

To generate the application for a specific target-type, build-type, and compiler execute the following command line:

> cbuild Hello.csolution.yml --packs --context Hello.Debug+CS300 --toolchain AC6 --rebuild
Parameters\Flags Description
--toolchain Specifies which compiler (GCC or AC6) is used to build the executable.
--rebuild Forces a clean rebuild.
--packs Forces the download of required packs.
--update-rte Updates the Run-Time Environment (RTE directory).
Debug Selects build-type (Debug or Release).
CS300 Selects target-type (CM0 is Cortex-M0, CS300 is Corstone-300).

Execute on Local Development Computer

To execute the application on an AVH FVP simulation model use the following command line:

> FVP_Corstone_SSE-300 -a ./out/Hello/CS300/Debug/AC6/Hello.axf -f ./FVP/FVP_Corstone_SSE-300/fvp_config.txt --simlimit 60
Parameters\Flags Description
-a Defines the path to the generated executable.
-f Specifies the configuration file needed for the Arm Virtual Hardware model.
--simlimit Set the maximum time in seconds for the simulation.

Notes:

  • When using an FVP model for the first time you may need to configure firewalls for the Terminal output.
  • Depending on the local development computers, the --simlimit 60 exceeds to execute the full test run. If this is the case increase the value, i.e. to --simlimit 200.
  • Some FVP models simulate very fast and may not synchronize with the Terminal program. In this case use --quantum 100 to slow down to view the Terminal output.

Automated Build and Execute

The GitHub Action file hello-ci.yml uses the same commands for build and execute, except that the tools use parameters from the text matrix.

For the execution on the AVH FVP models, the UART ouput is redirected to a log file using the parameter -C. This output is checked for correctness.

More CI Examples

Arm is using CI validation tests for many projects. The list below are only a few examples that may be used to derive own CI test projects.

Resource Description
AVH_CI_Template CI Template for unit test automation that uses GitHub Actions.
CMSIS Version 6 Runs a CMSIS-Core validation test across the supported processors using multiple compilers.
RTOS2 Validation Runs the CMSIS-RTOS2 validation across Keil RTX using source and library variants.
STM32H743I-EVAL_BSP Build test of a Board Support Pack (BSP) with MDK-Middleware Reference Applications using Arm Compiler or GCC. The artifacts store the various example projects for testing on the hardware board.
MDK Middleware Build test of MDK-Middleware library and device agonistic Reference Applications using Arm Compiler or GCC.
TFL Micro Speech This example project shows the Virtual Streaming Interface with Audio input and uses software layers for retargeting.

Other Developer Resources

Resource Description
AVH FVP Documentation Is a comprehensive documentation about Arm Virtual Hardware.
AVH FVP Support Forum Arm Virtual Hardware is supported via a forum. Your feedback will influence future roadmap.
AVH-MLOps Shows the setup of a Docker container with foundation tools for CI and MLOps systems.

Related Webinar Recordings