]> begriffs open source - cmsis-freertos/blob - CMSIS/RTOS2/FreeRTOS/Examples/README.md
chore(deps): bump actions/checkout from 4 to 5 in /.github/workflows
[cmsis-freertos] / CMSIS / RTOS2 / FreeRTOS / Examples / README.md
1 # CMSIS-FreeRTOS Examples
2
3 CMSIS-FreeRTOS provides csolution based examples that can be built for multiple Cortex-M targets.
4
5 The solution file [Examples.csolution.yml](Examples.csolution.yml) defines projects and supported targets.
6
7
8 ## Projects
9
10 | Project-Name                                                     | Purpose                                          | Description                                   |
11 |:-----------------------------------------------------------------|:-------------------------------------------------|:----------------------------------------------|
12 | [Hello](App/Hello/Hello.cproject.yml)                            | Simple Hello World application                   | [README.md](App/Hello/README.md)              |
13 | [TZ_Secure](App/TrustZone/Secure/TZ_Secure.cproject.yml)         | TrustZone application running on Secure side     | [README.md](App/TrustZone/Secure/README.md)   |
14 | [TZ_NonSecure](App/TrustZone/NonSecure/TZ_NonSecure.cproject.yml)| TrustZone application running on Non-secure side | [README.md](App/TrustZone/NonSecure/README.md)|
15
16 ## Targets
17
18 The below table lists supported target processors together with the corresponding context target-types
19 and model executable that shall be used for running the application image.
20
21 | Target processor | Target-Type | Model Executable       |
22 |:-----------------|:------------|:-----------------------|
23 | Cortex-M0        | CM0         | FVP_MPS2_Cortex-M0     |
24 | Cortex-M0+       | CM0plus     | FVP_MPS2_Cortex-M0plus |
25 | Cortex-M3        | CM3         | FVP_MPS2_Cortex-M3     |
26 | Cortex-M4        | CM4         | FVP_MPS2_Cortex-M4     |
27 | Cortex-M7        | CM7         | FVP_MPS2_Cortex-M7     |
28 | Cortex-M23       | CM23        | FVP_MPS2_Cortex-M23    |
29 | Cortex-M23       | CM23_noTZ   | FVP_MPS2_Cortex-M23    |
30 | Cortex-M33       | CM33        | FVP_MPS2_Cortex-M33    |
31 | Cortex-M33       | CM33_noTZ   | FVP_MPS2_Cortex-M33    |
32 | Cortex-M55       | CM55        | FVP_Corstone_SSE-300   |
33 | Cortex-M55       | CM55_noTZ   | FVP_Corstone_SSE-300   |
34 | Cortex-M85       | CM85        | FVP_Corstone_SSE-310   |
35 | Cortex-M85       | CM85_noTZ   | FVP_Corstone_SSE-310   |
36
37 ## Build
38
39 The Examples solution supports only "Debug" Build-Type which is optimized for debugging. It disables
40 compiler optimization and retains all debug related information. By default, Arm Compiler 6 is used to
41 build the projects.
42
43 ## Build in VS Code using Arm Keil Studio Pack extensions
44
45 > - See [Arm Keil Studio Visual Studio Code Extensions User Guide](https://developer.arm.com/documentation/108029/0000/?lang=en)
46 >   for more information about using the Keil Studio extensions.
47 > - Search for [Arm Keil Studio Pack](https://marketplace.visualstudio.com/items?itemName=Arm.keil-studio-pack)
48 >   in the Visual Studio Marketplace to download the extensions.
49
50 To build a project using Keil Studio extensions open CMSIS view, open "Manage CMSIS Solution" view and select
51 "Active Context" and "Active Projects". Build Type is automatically selected since there is only
52 one option.
53
54 Once the context and projects are selected one can build them by selecting "Build" in CMSIS view. 
55
56 ## Build via command line
57
58 > - See [CMSIS-Toolbox documentation](https://open-cmsis-pack.github.io/cmsis-toolbox/)
59 >   to learn more about CMSIS Solution project build and management tools.
60
61 To build the project via command line one can use the following command syntax:
62
63 `cbuild Examples.csolution.yml --context <project-name>.<build-type>+<target-type>`
64
65 To list the available context execute the following command:
66
67 ```sh
68 cbuild list contexts Examples.csolution.yml
69 ```
70
71 ### Hello World example
72
73 - Build example project for Cortex-M3
74   ```sh
75   cbuild Examples.csolution.yml --context Hello.Debug+CM3 --update-rte
76   ```
77
78 ### TrustZone example (for ArmV8-M with TrustZone)
79
80 TrustZone example must always be build in two steps:
81
82 1. Build secure side project for Cortex-M55
83    ```sh
84    cbuild Examples.csolution.yml --context TZ_Secure.Debug+CM55 --update-rte
85    ```
86 2. Build non-secure side project for Cortex-M55
87    ```sh
88    cbuild Examples.csolution.yml --context TZ_NonSecure.Debug+CM55 --update-rte
89    ```
90
91 ## Run Example Project on Virtual Hardware Target model
92
93 Run command syntax:
94
95 `<model-executable> -f ./Target/<target_type>/fvp_config.txt ./out/<project>/<project>.axf`
96
97 Examples:
98
99 - Run Hello World project executable on Cortex-M3 model
100 ```sh
101 FVP_MPS2_Cortex-M3 -f ./Target/CM3/fvp_config.txt ./out/Hello/Hello.axf
102 ```
103
104 - Run TrustZone executable on model for Cortex-M55
105 ```sh
106 FVP_Corstone_SSE-300 -f ./Target/CM55/fvp_config.txt -a ./out/TZ_NonSecure/TZ_NonSecure.axf -a ./out/TZ_Secure/TZ_Secure.axf
107 ```