Skip to content

Commit aef2267

Browse files
committed
Remove build.py script and replace it with native CMSIS Solution build
1 parent 443c0aa commit aef2267

5 files changed

Lines changed: 46 additions & 250 deletions

File tree

‎.github/workflows/cmsis_rv2.yml‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
compiler: [AC6, GCC, Clang, IAR]
23+
compiler: [AC6, GCC, CLANG, IAR]
2424
rtos: [RTX5, FreeRTOS]
25+
device: [CM0plus, CM3, CM4, CM7, CM23, CM33, CM55, CM85]
2526

2627
runs-on: ubuntu-24.04
2728

29+
env:
30+
FVP_EXEC: ${{ fromJSON('{"CM0plus":"FVP_MPS2_Cortex-M0plus","CM3":"FVP_MPS2_Cortex-M3","CM4":"FVP_MPS2_Cortex-M4","CM7":"FVP_MPS2_Cortex-M7","CM23":"FVP_MPS2_Cortex-M23","CM33":"FVP_MPS2_Cortex-M33","CM55":"FVP_MPS2_Cortex-M55","CM85":"FVP_MPS2_Cortex-M85"}')[matrix.device] }}
31+
IMG_EXT: ${{ fromJSON('{"AC6":"axf","GCC":"elf","CLANG":"elf","IAR":"out"}')[matrix.compiler] }}
32+
2833
steps:
2934
- uses: actions/checkout@v6
3035
with:
@@ -55,17 +60,13 @@ jobs:
5560
python-version: '3.13'
5661
cache: 'pip'
5762

58-
- name: Python requirements
59-
run: |
60-
pip install -r ./CMSIS-RTOS2_Validation/Project/requirements.txt
61-
6263
- name: Install tools
63-
uses: ARM-software/cmsis-actions/vcpkg@v1
64+
uses: ARM-software/cmsis-actions/vcpkg@v1.1
6465
with:
6566
config: "CMSIS-RTOS2_Validation/.ci/vcpkg-configuration.json"
6667

6768
- name: Activate Arm tool license
68-
uses: ARM-software/cmsis-actions/armlm@v1
69+
uses: ARM-software/cmsis-actions/armlm@v1.1
6970
with:
7071
code: ${{ env.ARM_UBL_ACTIVATION_CODE }}
7172

@@ -92,14 +93,21 @@ jobs:
9293
working-directory: ./CMSIS-RTOS2_Validation/Project
9394
run: |
9495
echo "Build test projects ..."
95-
./build.py --verbose -r ${{ matrix.rtos }} -c ${{ matrix.compiler }} build || echo "::warning::=== Some configurations failed to build! ==="
96+
cbuild Validation.csolution.yml --packs --update-rte \
97+
--toolchain ${{ matrix.compiler }} \
98+
--context .${{ matrix.rtos }}+${{ matrix.device }} \
99+
|| echo "::warning::=== Some configurations failed to build! ==="
96100
97101
- name: Execute
98102
if: env.ARM_UBL_ACTIVATION_CODE
99103
working-directory: ./CMSIS-RTOS2_Validation/Project
100104
run: |
101105
echo "Run test projects ..."
102-
./build.py --verbose -r ${{ matrix.rtos }} -c ${{ matrix.compiler }} run || echo "::warning::==== Some configurations failed to run! ==="
106+
${{ env.FVP_EXEC }} -q --simlimit 100 \
107+
-f ../Layer/Board/${{ matrix.device }}/fvp_config.txt \
108+
-a out/Validation/${{ matrix.device }}/${{ matrix.rtos }}/Validation.${{ env.IMG_EXT }} \
109+
> Validation-${{ matrix.rtos }}-${{ matrix.device }}-${{ matrix.compiler }}.junit \
110+
|| echo "::warning::==== Some configurations failed to run! ==="
103111
104112
- name: Deactivate Arm tool license
105113
if: always()
@@ -118,7 +126,7 @@ jobs:
118126
if: ${{ !cancelled() && env.ARM_UBL_ACTIVATION_CODE }}
119127
uses: actions/upload-artifact@v7
120128
with:
121-
name: test-results-${{ matrix.rtos }}-${{ matrix.compiler }}
129+
name: test-results-${{ matrix.rtos }}-${{ matrix.device }}-${{ matrix.compiler }}
122130
path: ./CMSIS-RTOS2_Validation/Project/*.junit
123131

124132

‎Project/README.md‎

Lines changed: 27 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Execute Validation Project
22

3-
Validation project uses CMSIS Project Manager to generate independent projects.
3+
Validation project uses CMSIS-Toolbox to build and run test configurations.
44

5-
Independent project can be generated for specific RTOS, DEVICE and COMPILER. Possible values for all variables are listed below:
5+
The solution file `Validation.csolution.yml` defines all target types and build types. It is the input file for build and references the application layer and the board layer for each target device.
6+
7+
A test configuration can be built for any combination of RTOS, DEVICE and COMPILER. Possible values are listed below:
68

79
| RTOS | Device | Compiler |
810
|----------|----------|----------|
@@ -15,8 +17,6 @@ Independent project can be generated for specific RTOS, DEVICE and COMPILER. Pos
1517
| | CM55 | |
1618
| | CM85 | |
1719

18-
Input file for cbuild is Validation.csolution.yml
19-
2020
## Prerequisites
2121

2222
- [CMSIS-Toolbox 2.13.0 or later](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases)
@@ -27,22 +27,11 @@ Input file for cbuild is Validation.csolution.yml
2727
- [LLVM/Clang Embedded Toolchain 22.1.0 or later](https://developer.arm.com/Tools%20and%20Software/Arm%20Toolchain%20for%20Embedded)
2828
- [CMake 3.31.5 or later](https://cmake.org/download/)
2929
- [Ninja 1.13.2 or later](https://github.com/ninja-build/ninja/releases)
30-
- Python (to use `build.py` script)
3130

32-
These prerequisites can be installed automatically using `vcpkg`:
31+
These prerequisites can be installed automatically using `vcpkg` with the configuration file `.ci/vcpkg-configuration.json`:
3332

3433
```Shell
35-
./Project $ vcpkg activate
36-
```
37-
38-
Python packages required to build and run with `build.py`:
39-
40-
- python-matrix-runner 1.3
41-
42-
These can be installed with `pip`:
43-
44-
```Shell
45-
./Project $ pip install -r requirements.txt
34+
$ vcpkg activate --vcpkg-configuration=.ci/vcpkg-configuration.json
4635
```
4736

4837
Required CMSIS Packs:
@@ -54,53 +43,25 @@ Required CMSIS Packs:
5443

5544
These get installed automatically if missing. One can explicitly install the packs using `cpackget` from CMSIS-Toolbox.
5645

57-
## Build and Execute Projects with Arm Virtual Hardware
58-
59-
The simplest way to execute this validation suite is to build and run configured targets using Python script:
60-
61-
```Shell
62-
./Project $ python build.py build run
63-
```
46+
## Build and Execute Project with Arm Virtual Hardware
6447

65-
Use `--verbose` command to output more information:
48+
The following command will build the project for specified RTOS/Device/Compiler and its output is an executable (either `Validation.axf`, `Validation.elf` or `Validation.out`):
6649

6750
```Shell
68-
./Project $ python build.py --verbose build run
51+
./Project $ cbuild Validation.csolution.yml --update-rte --context .{RTOS}+{DEVICE} --toolchain {COMPILER}
6952
```
7053

71-
Above commands will build all defined projects and run each target. One might be interested in only one RTOS/Device/Compiler combination and can also build and run a project for specific combination, see below.
72-
73-
## Build and Execute Project for Specific Target
74-
75-
To build and execute validation suite for specific target use the following command:
54+
Executable file is then used as input parameter when calling the FVP model to run the validation:
7655

7756
```Shell
78-
./Project $ python build.py build run -r {RTOS} -d {DEVICE} -c {COMPILER}
57+
./Project $ {FVP_MODEL} -q --simlimit 100 -f ../Layer/Board/{DEVICE}/fvp_config.txt -a out/Validation/{DEVICE}/{RTOS}/Validation.{EXT}
7958
```
8059

81-
> Note: Mentioned commands can be executed either in Windows command prompt or bash shell.
82-
83-
Python script is used to simplify build commands and Virtual Hardware Target model execution. One can call cbuild and execute the model manually, see below.
84-
85-
## Manually Build and Execute Project for Specific Target
86-
87-
Behind the scenes, build.py script calls cbuild and VHT model executable to build and execute the test suite.
88-
89-
The following command will build the project for specified RTOS/Device/Compiler and its output is an executable (either Validation.axf or Validation.elf):
90-
91-
```Shell
92-
./Project $ cbuild Validation.csolution.yml --update-rte --context .{RTOS}+{DEVICE} --toolchain {COMPILER}
93-
```
94-
95-
Executable file is then used as input parameter when calling Virtual Hardware Target model to run the validation:
96-
97-
```Shell
98-
./Project $ {AVH_MODEL} -f ../Layer/Board/{DEVICE}/fvp_config.txt -a out/Validation/{DEVICE}/{RTOS}/Validation.axf
99-
```
60+
Test results are output to stdout in JUnit XML format.
10061

101-
Please see a table below for a possible {AVH_MODEL} variable value when a project for specified {DEVICE} was built:
62+
Please see the tables below for possible values of `{FVP_MODEL}` and `{EXT}`:
10263

103-
| AVH_MODEL | DEVICE |
64+
| FVP_MODEL | DEVICE |
10465
|---------------------------|---------|
10566
| FVP_MPS2_Cortex-M0plus | CM0plus |
10667
| FVP_MPS2_Cortex-M3 | CM3 |
@@ -111,13 +72,19 @@ Please see a table below for a possible {AVH_MODEL} variable value when a projec
11172
| FVP_MPS2_Cortex-M55 | CM55 |
11273
| FVP_MPS2_Cortex-M85 | CM85 |
11374

114-
## Debug the Project using Keil MDK-Professional
75+
| EXT | COMPILER |
76+
|------|-------------|
77+
| axf | AC6 |
78+
| elf | GCC / CLANG |
79+
| out | IAR |
11580

116-
All projects can be opened and debugged using Keil MDK-Professional no matter whether the project was build using Python script or manually with cbuild.
117-
After the project was successfully built, follow the steps below:
81+
## Build and Execute Project using Keil Studio for VS Code
11882

119-
1. Go into folder Validation.{RTOS}+{DEVICE}_{COMPILER} and double click the generated cprj file
120-
2. In uVision, open dialog Options for Target->Debug and configure the debugger
121-
- Configuration File 'fvp_config.txt' for each target can be found in folder [**.\Layer\Board**](https://github.com/ARM-software/CMSIS-RTOS2_Validation/tree/main/Layer/Board)
83+
### Quick Start
12284

123-
Documentation on how to [use Keil MDK with Arm Virtual Hardware](https://arm-software.github.io/AVH/main/infrastructure/html/run_mdk_pro.html) describes how to configure the debugger.
85+
1. Install [Keil Studio for VS Code](https://marketplace.visualstudio.com/items?itemName=Arm.keil-studio-pack) from the VS Code marketplace.
86+
2. Open the base directory in VS Code.
87+
3. In VS Code Explorer View right click on `.ci/vcpkg-configuration.json` and select `Activate Environment`. This will download and install
88+
the related tools.
89+
4. Open the [CMSIS View](https://mdk-packs.github.io/vscode-cmsis-solution-docs/userinterface.html#2-main-area-of-the-cmsis-view) in VS Code and use the *Open Solution in Workspace* to open `Project/Validation` solution.
90+
5. In the CMSIS view, use the [Action buttons](https://github.com/ARM-software/vscode-cmsis-csolution?tab=readme-ov-file#action-buttons) to build, load and run the example on the Arm Virtual Hardware FVP models.

‎Project/build.py‎

Lines changed: 0 additions & 174 deletions
This file was deleted.

‎Project/requirements.txt‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)