Skip to content
Merged
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
11 changes: 5 additions & 6 deletions .ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ Content of `.ci` Directory | Description

## GitHub Action Workflows

The [**`GitHub Actions`**](https://docs.github.com/en/actions) in the directory `.github/workflows` are the scripts for the CI tests. These scripts contain detailed comments about each step that is executed.
Projects in the Arm csolution-examples uses the **`ARM compiler (AC6)`** as well as the **`GCC`** toolchains. Not all workflows are using both compilers.
The [**GitHub Actions**](https://docs.github.com/en/actions) workflows in the directory `.github/workflows` run the CI tests. The examples use the **Arm Compiler (AC6)**, **GCC**, and **CLANG** toolchains. The toolchains tested depend on the example.

- **`Hello-CI.yml`** implements a build and execution test. The build steps are using **`AC6`** and **`GCC`** toolchains. The execution tests runs on [**`Arm Virtual Hardware - Fixed Virtual Platforms (AVH FVP)`**](https://arm-software.github.io/AVH/main/simulation/html/index.html) simulation models. The directory **`FVP`** contains configuration files for the **`FVP simulation models`**.
- **`Hello-CI.yml`** builds and executes the Debug and Release variants with **AC6**, **GCC**, and **CLANG**. The execution tests run on an [Arm Virtual Hardware Fixed Virtual Platform (AVH FVP)](https://arm-software.github.io/AVH/main/simulation/html/index.html). The directory `FVP` contains the simulation model configuration.

- **`DualCore-CI.yml`** implements a build test for a DualCore (**`cm0plus, cm4`**) project by using the **`AC6`** toolchain. The output of this build test is stored as artifact and can be downloaded.
- **`DualCore-CI.yml`** builds the dual-core Cortex-M0+ and Cortex-M4 project with **AC6**. The build output is stored as a downloadable artifact.

- **`SimpleTZ-CI.yml`** implements build tests for a **`TrustZone`** based project by using the **`AC6`** and **`GCC`** toolchains. The execution tests runs on [**`Arm Virtual Hardware - Fixed Virtual Platforms (AVH FVP)`**](https://arm-software.github.io/AVH/main/simulation/html/index.html) simulation models. The directory **`FVP`** contains configuration files for the **`FVP simulation models`**.
- **`SimpleTZ-CI.yml`** builds and executes the Debug and Release target sets of the TrustZone project with **AC6**. The execution tests run on an [Arm Virtual Hardware Fixed Virtual Platform (AVH FVP)](https://arm-software.github.io/AVH/main/simulation/html/index.html) using the configuration in the `FVP` directory.

- **`CubeMX-CI.yml`** implements a build test for a **`CubeMX`** generated project by using only the **`AC6`** toolchain.
- **`CubeMX-CI.yml`** builds the CubeMX-generated project with **AC6**.
6 changes: 3 additions & 3 deletions .github/workflows/CubeMX-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
uses: actions/checkout@v7.0.1

- name: Install tools
uses: ARM-software/cmsis-actions/vcpkg@8a50b77681a484568e08f31fb7c2285c4735f682 #v1.3
uses: ARM-software/cmsis-actions/vcpkg@v1.3
with:
config: ".ci/vcpkg-configuration.json"

- name: Activate Arm tool license
uses: ARM-software/cmsis-actions/armlm@8a50b77681a484568e08f31fb7c2285c4735f682 #v1.3
uses: ARM-software/cmsis-actions/armlm@v1.3

- name: Build project with AC6
working-directory: ./CubeMX/
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/DualCore-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
uses: actions/checkout@v7.0.1

- name: Install tools
uses: ARM-software/cmsis-actions/vcpkg@8a50b77681a484568e08f31fb7c2285c4735f682 #v1.3
uses: ARM-software/cmsis-actions/vcpkg@v1.3
with:
config: ".ci/vcpkg-configuration.json"

- name: Activate Arm tool license
uses: ARM-software/cmsis-actions/armlm@8a50b77681a484568e08f31fb7c2285c4735f682 #v1.3
uses: ARM-software/cmsis-actions/armlm@v1.3

- name: Build HelloWorld with AC6 and all contexts
working-directory: ./DualCore/
run: cbuild HelloWorld.csolution.yml --packs --toolchain AC6

- name: Upload HelloWorld AC6 build Artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
uses: actions/upload-artifact@v7.0.1
with:
name: HelloWorld_AC6
path: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/Hello-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
uses: actions/checkout@v7.0.1

- name: Install tools
uses: ARM-software/cmsis-actions/vcpkg@8a50b77681a484568e08f31fb7c2285c4735f682 #v1.3
uses: ARM-software/cmsis-actions/vcpkg@v1.3
with:
config: ".ci/vcpkg-configuration.json"

- name: Activate Arm tool license
uses: ARM-software/cmsis-actions/armlm@8a50b77681a484568e08f31fb7c2285c4735f682 #v1.3
uses: ARM-software/cmsis-actions/armlm@v1.3

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 #v7.0.0
uses: actions/setup-python@v7.0.0
with:
python-version: '3.14'

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/SimpleTZ-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
uses: actions/checkout@v7.0.1

- name: Install tools
uses: ARM-software/cmsis-actions/vcpkg@8a50b77681a484568e08f31fb7c2285c4735f682 #v1.3
uses: ARM-software/cmsis-actions/vcpkg@v1.3
with:
config: ".ci/vcpkg-configuration.json"

- name: Activate Arm tool license
uses: ARM-software/cmsis-actions/armlm@8a50b77681a484568e08f31fb7c2285c4735f682 #v1.3
uses: ARM-software/cmsis-actions/armlm@v1.3

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 #v7.0.0
uses: actions/setup-python@v7.0.0
with:
python-version: '3.14'

- name: Build project CM33_s and CM33_ns for build-type ${{ matrix.build.type }} with ${{ matrix.compiler.name }}
working-directory: ./SimpleTrustZone/
run: cbuild SimpleTZ.csolution.yml --packs --context .${{ matrix.build.type }}+AVH --toolchain ${{ matrix.compiler.name }}
run: cbuild SimpleTZ.csolution.yml --packs --active AVH@${{ matrix.build.type }} --toolchain ${{ matrix.compiler.name }}


- name: Execute project CM33_s and CM33_ns for build-type ${{ matrix.build.type }} with ${{ matrix.compiler.name }} using FVP_MPS2_Cortex-M33
Expand Down
38 changes: 33 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,48 @@ Module.symvers
Mkfile.old
dkms.conf

# Clangd
.clangd

# uv2csolution generated log file
uv2csolution.log

# CMSIS Solution files and folders not to be tracked
# generated RTE files
**/RTE/_*/RTE_Components.h
**/RTE/_*/Pre_Include_*.h

# default directory of build artifacts
**/out
# directory containing intermediate files to be regenerated
**/tmp
#
.clangd

# Update config files must be merged before commit
*.update@*

# cbuild output files
*.cbuild.yml
*.cbuild-idx.yml
*.cbuild-run.yml
*.cbuild-set.yml
# RTE_Components.h files are always regenerated and must not be checked in
RTE_Components.h
# outdated file types

# .vscode JSON and debug adapter files generated by CMSIS Solution even if opened in a subfolder
**/.vscode/cmsis.json
**/.vscode/launch.json
**/.vscode/tasks.json
**/.vscode/settings.json
.cmd.jlink

# Exception for line 2: "*.d"
# CMSIS Solution drop-ins are user managed source files, despite the directory suffix ".d"
!.vscode.d/

# legacy intermediate project file
*.cprj

# SDS files
*.[sS][dD][sS]

# FVP model generated files when using with SDS
**/__pycache__/
sdsio.log
90 changes: 54 additions & 36 deletions CubeMX/CubeMX.csolution.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
solution:
created-for: CMSIS-Toolbox@2.6.0
description: Simple CubeMX example
cdefault:
compiler: AC6 # currently required for components Compiler:I/O

# it is recommended to list the pack or packs that define the device or board used in the csolution.yml file
packs:
- pack: ARM::CMSIS@^6.1.0
- pack: Keil::B-U585I-IOT02A_BSP@^2.0.0
- pack: Keil::STM32U5xx_DFP@^3.0.0
- pack: ARM::CMSIS-RTX@^5.9.0
target-types:
- type: MyBoard_ROM # My evaluation kit (Execution from ROM)
board: B-U585I-IOT02A # Board name as defined by the pack
variables:
- regions_header: RTE/Device/STM32U585AIIx/regions_B-U585I-IOT02A_ROM.h

- type: MyBoard_RAM # My evaluation kit (Execution from RAM)
board: B-U585I-IOT02A # Board name as defined by the pack
variables:
- regions_header: RTE/Device/STM32U585AIIx/regions_B-U585I-IOT02A_RAM.h
define:
- VECT_TAB_SRAM

build-types: # defines toolchain options for 'debug' and 'release'
- type: Debug
debug: on
optimize: debug

- type: Release
debug: off
optimize: balanced

projects: # list related projects
- project: ./CubeMX.cproject.yml
solution:
created-for: CMSIS-Toolbox@2.14.0
description: Simple CubeMX example
cdefault:
compiler: AC6 # currently required for components Compiler:I/O

# it is recommended to list the pack or packs that define the device or board used in the csolution.yml file
packs:
- pack: ARM::CMSIS@^6.1.0
- pack: Keil::B-U585I-IOT02A_BSP@^2.0.0
- pack: Keil::STM32U5xx_DFP@^3.0.0
- pack: ARM::CMSIS-RTX@^5.9.0
target-types:
- type: MyBoard_ROM # My evaluation kit (Execution from ROM)
board: B-U585I-IOT02A # Board name as defined by the pack
variables:
- regions_header: RTE/Device/STM32U585AIIx/regions_B-U585I-IOT02A_ROM.h
target-set:
- set: Debug
images:
- project-context: CubeMX.Debug
- set: Release
images:
- project-context: CubeMX.Release

- type: MyBoard_RAM # My evaluation kit (Execution from RAM)
board: B-U585I-IOT02A # Board name as defined by the pack
variables:
- regions_header: RTE/Device/STM32U585AIIx/regions_B-U585I-IOT02A_RAM.h
define:
- VECT_TAB_SRAM
target-set:
- set: Debug
images:
- project-context: CubeMX.Debug
- set: Release
images:
- project-context: CubeMX.Release

build-types:
- type: Debug # toolchain options for 'debug'
debug: on
optimize: debug
misc:
- for-compiler: AC6
C:
- -funwind-tables # ensure reliable stack unwinding with GDB

- type: Release # toolchain options for 'release'
debug: off
optimize: balanced

projects: # list related projects
- project: ./CubeMX.cproject.yml
32 changes: 15 additions & 17 deletions CubeMX/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,57 @@ This project uses two different target-types to configure execution from Flash R

### Tools

- [CMSIS-Toolbox 2.6.0](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases) or higher
- [Keil MDK 5.40](https://www2.keil.com/mdk5/) or higher
- [CMSIS-Toolbox 2.14.0](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases) or higher
- [Keil Studio](https://marketplace.visualstudio.com/items?itemName=Arm.keil-studio-pack)
- [STM32CubeMX 6.11](https://www.st.com/en/development-tools/stm32cubemx.html) or higher

>**Note:**
>
> This example uses the Arm Compiler 6 (AC6). [Using GCC Compiler](#using-gcc-compiler) explains how to configure for different compiler. A similar process also works for IAR.
> [!NOTE]
> This example uses the Arm Compiler 6 (AC6). [Using GCC Compiler](#using-gcc-compiler) explains how to configure it for a different compiler. A similar process also works for IAR.

### Packs

- Required packs are listed in the file [`CubeMX.csolution.yml`](./CubeMX.csolution.yml)

## Build Project

This command builds the project and downloads missing packs. If the file `CubeMX.cbuild-set.yml` is missing it creates this file with the context-set selection of the first `target-type` and the first `build-type`.
Build the `Debug` target set for the `MyBoard_ROM` target and download missing packs with:

```bash
> cbuild setup CubeMX.csolution.yml --context-set --packs
> cbuild CubeMX.csolution.yml --active MyBoard_ROM@Debug --packs
```

## Run CubeMX

To change the device configuration, start STM32CubeMX using the following command.

```bash
> csolution CubeMX.csolution.yml run --generator CubeMX --context-set
> csolution CubeMX.csolution.yml run --generator CubeMX --active MyBoard_ROM@Debug
```

For using CubeMX refer to the documentation
[**CMSIS-Toolbox > Configure STM32 Devices with CubeMX**](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/tree/main/docs/CubeMX).
For information about using CubeMX, refer to
[**CMSIS-Toolbox > Configure STM32 Devices with CubeMX**](https://open-cmsis-pack.github.io/cmsis-toolbox/CubeMX/).

The source code generated by CubeMX is imported using the file [STM32CubeMX\<target-type>\CubeMX.cgen.yml](./STM32CubeMX/MyBoard_ROM/CubeMX.cgen.yml). This allows you to create different settings for each target, for example evaluation board and custom hardware.

>**Note:**
>
> Refer to the pack overview page, for example the [STM32F4_DFP](https://www.keil.arm.com/packs/stm32f4xx_dfp-keil) for information on how to use an IDE workflow with CubeMX.
> [!NOTE]
> Refer to the [STM32U5xx_DFP pack overview](https://www.keil.arm.com/packs/stm32u5xx_dfp-keil) for information on how to use an IDE workflow with CubeMX.

## Execute Project

You may use the debugger of choice for executing this program.

## Using GCC Compiler

By default this project is the Arm Compiler 6 (AC6). Using STM32CubeMX it can be reconfigured for the GCC or IAR compiler. To configure it for the GCC compiler execute these steps:
By default, this project uses Arm Compiler 6 (AC6). It can be reconfigured for the GCC or IAR compiler using STM32CubeMX. To configure it for GCC, follow these steps:

- In the file [`CubeMX.csolution.yml`](./CubeMX.csolution.yml) set `compiler: GCC`.

- Launch the STM32CubeMX generator with this CMSIS-Toolbox command: `csolution <solution_name>.csolution.yml run -g CubeMX -c <context>`
- Launch the STM32CubeMX generator with this CMSIS-Toolbox command: `csolution <solution_name>.csolution.yml run -g CubeMX -a <target-type>@<target-set>`

- In STM32CubeMX:
- Open from the menu Project Manager - Project - Toolchain/IDE:
- Select STM32CubeIDE and disable Generate Under Root.
- Click GENERATE CODE to recreate the CubeMX generated files for the GCC compiler.

- In the file [CubeMX.cproject.yml](./CubeMX.cproject.yml), update `linker:` node to reference the GCC linker script generated by CubeMX, typically found in folder `./STM32CubeMX/<target-type>/STM32CubeMX/STM32CubeIDE`. You may customize this linker script to meet your project's specific needs, but it should remain consistent with the CubeMX-generated startup and system files.
- [Rebuild the project](#build-project) using the CMSIS-Toolbox command `cbuild` with the option `--rebuild`.
- In the file [CubeMX.cproject.yml](./CubeMX.cproject.yml), update the `linker:` node to reference the GCC linker script generated by CubeMX, typically found in the folder `./STM32CubeMX/<target-type>/STM32CubeMX/STM32CubeIDE`. You may customize this linker script to meet your project's specific needs, but it should remain consistent with the CubeMX-generated startup and system files.
- Rebuild the selected target set with `cbuild CubeMX.csolution.yml --active <target-type>@<target-set> --rebuild`.
10 changes: 7 additions & 3 deletions DualCore/HelloWorld.csolution.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
solution:
created-for: CMSIS-Toolbox@2.12.0
created-for: CMSIS-Toolbox@2.14.0
cdefault:

# List of tested compilers that can be selected
Expand Down Expand Up @@ -31,11 +31,15 @@ solution:
start-pname: cm4

build-types:
- type: Debug
- type: Debug # toolchain options for 'debug'
debug: on
optimize: debug
misc:
- for-compiler: AC6
C:
- -funwind-tables # ensure reliable stack unwinding with GDB

- type: Release
- type: Release # toolchain options for 'release'
debug: off
optimize: balanced

Expand Down
11 changes: 5 additions & 6 deletions DualCore/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Dual Core project

This example generates **HelloWorld** executables for the **FRDM-K32L3A6** evaluation board. The used **K32L3** microcontroller is a dual-core MCU ([**Cortex-M0plus**](https://developer.arm.com/Processors/Cortex-M0-Plus) and [**Cortex-M4**](https://developer.arm.com/Processors/Cortex-M4))
This example generates **HelloWorld** executables for the **FRDM-K32L3A6** evaluation board. The **K32L3** microcontroller is a dual-core MCU with a [**Cortex-M0+**](https://developer.arm.com/Processors/Cortex-M0-Plus) and a [**Cortex-M4**](https://developer.arm.com/Processors/Cortex-M4).

## Prerequisites

### Tools

- [CMSIS-Toolbox 2.6.0](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases) or higher
- [CMSIS-Toolbox 2.14.0](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases) or higher
- Arm Compiler 6.22 or higher
- GCC Compiler 13.2.1 or higher

### Packs

Expand All @@ -18,8 +17,8 @@ This example generates **HelloWorld** executables for the **FRDM-K32L3A6** evalu

The project is generated using the [CMSIS-Toolbox](https://open-cmsis-pack.github.io/cmsis-toolbox/build-overview) and is defined in [`csolution`](https://open-cmsis-pack.github.io/cmsis-toolbox/YML-Input-Format) format:

- [`HelloWorld.csolution.yml`](./HelloWorld.csolution.yml) lists the required packs, defines, hardware targets, and the build-types (along with the compiler).
- [`./cm0plus/HelloWorld_cm0plus.cproject.yml`](./cm0plus/HelloWorld_cm0plus.cproject.yml) defines the source files and the software components for the **Cortex-M0plus** core.
- [`HelloWorld.csolution.yml`](./HelloWorld.csolution.yml) lists the required packs and defines the hardware target, build types, compiler, and target set that groups both core images and configures the debugger.
- [`./cm0plus/HelloWorld_cm0plus.cproject.yml`](./cm0plus/HelloWorld_cm0plus.cproject.yml) defines the source files and the software components for the **Cortex-M0+** core.
- [`./cm4/HelloWorld_cm4.cproject.yml`](./cm4/HelloWorld_cm4.cproject.yml) defines the source files and the software components for the **Cortex-M4** core.

## Generate the project binaries
Expand All @@ -30,4 +29,4 @@ The project is generated using the [CMSIS-Toolbox](https://open-cmsis-pack.githu

## Execute Project

You may use the debugger of choice for executing this program.
Select the `FRDM-K32L3A6` target with `--active FRDM-K32L3A6` to build the Debug application containing both core images. The target set configures MCU-Link with pyOCD for downloading and debugging the application.
Loading
Loading