-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Examples: update Fault example for Cortex-M7 (AVH)
- Loading branch information
1 parent
5e32195
commit 85da277
Showing
29 changed files
with
169 additions
and
183 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
solution: | ||
description: Fault example (Cortex-M7) | ||
created-for: CMSIS-Toolbox@2.6.0 | ||
cdefault: | ||
|
||
select-compiler: | ||
# list of tested compilers that can be selected | ||
- compiler: AC6 | ||
- compiler: GCC | ||
|
||
packs: | ||
- pack: Keil::V2M-MPS2_CMx_BSP@^1.8.0 | ||
|
||
target-types: | ||
- type: FVP_MPS2_Cortex-M7 | ||
board: ARM::V2M-MPS2:B | ||
device: ARM::CMSDK_CM7_SP_VHT | ||
|
||
build-types: | ||
- type: Debug | ||
debug: on | ||
optimize: debug | ||
|
||
projects: | ||
- project: Fault.cproject.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Fault example (Cortex-M7) | ||
|
||
This project is a simple **Fault** component example running on an **Arm Cortex-M7** microcontroller simulated by | ||
[**Arm Virtual Hardware**](https://www.arm.com/products/development-tools/simulation/virtual-hardware) with the **FVP_MPS2_Cortex-M7** model simulator. | ||
|
||
The application allows triggering of specific faults upon which the fault information is saved and system is reset. | ||
When system restarts the fault information is output via the **Event Recorder**. | ||
|
||
The fault information can also be inspected with **Component Viewer** in a debug session. | ||
|
||
> **Note** | ||
> This example runs on the [**Arm Virtual Hardware**](https://www.arm.com/products/development-tools/simulation/virtual-hardware) simulator | ||
> and does not require any hardware. | ||
## Prerequisites | ||
|
||
### Software | ||
|
||
- [**Arm Keil Studio for VS Code**](https://marketplace.visualstudio.com/items?itemName=Arm.keil-studio-pack) | ||
- [**eventlist**](https://github.com/ARM-software/CMSIS-View/releases/tag/tools%2Feventlist%2F1.1.0) **v1.1.0** or newer | ||
|
||
## Build and Run | ||
|
||
To try the example with the **Arm Keil Studio**, follow the steps below: | ||
|
||
1. open the example in the **Visual Studio Code**. | ||
2. in the **Configure Solution** tab select the desired compiler (**AC6** or **GCC**), and click on the **OK** button. | ||
3. build the solution (in the **CMSIS** extension view click on the **Build solution** button). | ||
4. run the **FVP model** from the command line by executing the following command: | ||
- for **AC6**: | ||
```shell | ||
FVP_MPS2_Cortex-M7 -f fvp_config.txt out/Fault/FVP_MPS2_Cortex-M7/Debug/Fault.axf | ||
``` | ||
- for **GCC**: | ||
```shell | ||
FVP_MPS2_Cortex-M7 -f fvp_config.txt out/Fault/FVP_MPS2_Cortex-M7/Debug/Fault.elf | ||
``` | ||
|
||
> **Note** | ||
> **The Arm Virtual Hardware executable files have to be in the environment path**. | ||
> You can install **Arm Virtual Hardware** via **Arm Keil Studio** by following these steps: | ||
> - click on the **Arm Tools**. | ||
> - select **Add Arm Tools Configuration to Workspace**. | ||
> - under **Arm Virtual Hardware for Cortex®-M based on Fast Models** select the latest available version. | ||
> - save the **vcpkg-configuration.json** file. | ||
|
||
5. follow the instructions in the **simulator console**. | ||
6. the result of example running is an `EventRecorder.log` file that contains events that were generated during the code execution. | ||
7. view the events by using `eventlist` utility by executing the following command: | ||
```shell | ||
eventlist -I %CMSIS_PACK_ROOT%/ARM/CMSIS-View/1.2.0/Fault/ARM_Fault.scvd -I %CMSIS_PACK_ROOT%/ARM/CMSIS-View/1.2.0/EventRecorder/EventRecorder.scvd -I %CMSIS_PACK_ROOT%/ARM/CMSIS-RTX/5.9.0/RTX5.scvd EventRecorder.log | ||
``` | ||
|
||
> **Note** | ||
> If `CMSIS-View v1.2.0` or `CMSIS-RTX v5.9.0` packs are not installed, in the previous command replace the corresponding path with the path of the latest installed packs | ||
> (for example replace `%CMSIS_PACK_ROOT%/ARM/CMSIS-View/1.2.0/Fault/` with `%CMSIS_PACK_ROOT%/ARM/CMSIS-View/1.2.1/Fault/`) | ||
|
||
## User Interface | ||
|
||
This example uses **simulator console** for User Interface. | ||
|
||
The fault triggering is done by entering a number via **simulator console**, see possible values below: | ||
|
||
- `0` : Terminate the example | ||
- `1` : trigger the Data access (precise) Memory Management fault | ||
- `2` : trigger the Data access (precise) Bus fault | ||
- `3` : trigger the Data access (imprecise) Bus fault | ||
- `4` : trigger the Instruction execution Bus fault | ||
- `5` : trigger the Undefined instruction Usage fault | ||
- `6` : trigger the Divide by 0 Usage fault |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions
43
Examples/Fault/FVP_MPS2_Cortex-M7/RTE/_Debug_FVP_MPS2_Cortex-M7/RTE_Components.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* CSOLUTION generated file: DO NOT EDIT! | ||
* Generated by: csolution version 2.6.0 | ||
* | ||
* Project: 'Fault.Debug+FVP_MPS2_Cortex-M7' | ||
* Target: 'Debug+FVP_MPS2_Cortex-M7' | ||
*/ | ||
|
||
#ifndef RTE_COMPONENTS_H | ||
#define RTE_COMPONENTS_H | ||
|
||
|
||
/* | ||
* Define the Device Header File: | ||
*/ | ||
#define CMSIS_device_header "CMSDK_CM7_SP.h" | ||
|
||
/* ARM::CMSIS-Compiler:STDERR:Custom@1.1.0 */ | ||
#define RTE_CMSIS_Compiler_STDERR /* CMSIS-Compiler STDERR */ | ||
#define RTE_CMSIS_Compiler_STDERR_Custom /* CMSIS-Compiler STDERR: Custom */ | ||
/* ARM::CMSIS-Compiler:STDIN:Custom@1.1.0 */ | ||
#define RTE_CMSIS_Compiler_STDIN /* CMSIS-Compiler STDIN */ | ||
#define RTE_CMSIS_Compiler_STDIN_Custom /* CMSIS-Compiler STDIN: Custom */ | ||
/* ARM::CMSIS-Compiler:STDOUT:Custom@1.1.0 */ | ||
#define RTE_CMSIS_Compiler_STDOUT /* CMSIS-Compiler STDOUT */ | ||
#define RTE_CMSIS_Compiler_STDOUT_Custom /* CMSIS-Compiler STDOUT: Custom */ | ||
/* ARM::CMSIS-View:Event Recorder&Semihosting@1.6.0 */ | ||
#define RTE_CMSIS_View_EventRecorder | ||
#define RTE_CMSIS_View_EventRecorder_DAP | ||
#define RTE_CMSIS_View_EventRecorder_Semihosting | ||
/* ARM::CMSIS-View:Fault:Record@1.1.0 */ | ||
#define RTE_CMSIS_View_Fault_Record | ||
/* ARM::CMSIS-View:Fault:Storage@1.1.0 */ | ||
#define RTE_CMSIS_View_Fault_Storage | ||
/* ARM::CMSIS:RTOS2:Keil RTX5&Source@5.9.0 */ | ||
#define RTE_CMSIS_RTOS2 /* CMSIS-RTOS2 */ | ||
#define RTE_CMSIS_RTOS2_RTX5 /* CMSIS-RTOS2 Keil RTX5 */ | ||
#define RTE_CMSIS_RTOS2_RTX5_SOURCE /* CMSIS-RTOS2 Keil RTX5 Source */ | ||
/* Keil::CMSIS Driver:USART@1.0.3 */ | ||
#define RTE_Drivers_USART | ||
|
||
|
||
#endif /* RTE_COMPONENTS_H */ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.