From 85da277a610b9e06ac0ac7d495556b15d0e55d88 Mon Sep 17 00:00:00 2001 From: MiloradCvjetkovic Date: Thu, 21 Nov 2024 14:27:00 +0100 Subject: [PATCH] Examples: update Fault example for Cortex-M7 (AVH) --- .../ARM_FaultTrigger.c | 0 .../ARM_FaultTrigger.h | 0 .../Fault.c | 31 ++--- .../Fault.cproject.yml | 23 ++-- .../FVP_MPS2_Cortex-M7/Fault.csolution.yml | 25 ++++ Examples/Fault/FVP_MPS2_Cortex-M7/README.md | 70 +++++++++++ .../RTE/CMSIS-View/EventRecorderConf.h | 0 .../CMSIS-View/EventRecorderConf.h.base@1.1.0 | 0 .../RTE/CMSIS/RTX_Config.c | 0 .../RTE/CMSIS/RTX_Config.c.base@5.2.0 | 0 .../RTE/CMSIS/RTX_Config.h | 0 .../RTE/CMSIS/RTX_Config.h.base@5.6.0 | 0 .../RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h | 0 .../CMSDK_CM7_SP_VHT/RTE_Device.h.base@1.0.0 | 0 .../RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct | 0 .../CMSDK_CM7_SP_VHT/ac6_arm.sct.base@1.0.0 | 0 .../RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld | 0 .../CMSDK_CM7_SP_VHT/gcc_arm.ld.base@1.1.0 | 0 .../CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c | 0 .../startup_CMSDK_CM7.c.base@1.1.0 | 0 .../CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c | 0 .../system_CMSDK_CM7.c.base@1.1.0 | 0 .../RTE_Components.h | 43 +++++++ .../debug.ini | 0 .../fvp_config.txt} | 0 .../retarget_stdio.c | 0 .../VHT_MPS2_Cortex-M7/Fault.csolution.yml | 19 --- Examples/Fault/VHT_MPS2_Cortex-M7/README.md | 115 ------------------ .../Fault/VHT_MPS2_Cortex-M7/cdefault.yml | 26 ---- 29 files changed, 169 insertions(+), 183 deletions(-) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/ARM_FaultTrigger.c (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/ARM_FaultTrigger.h (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/Fault.c (88%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/Fault.cproject.yml (63%) create mode 100644 Examples/Fault/FVP_MPS2_Cortex-M7/Fault.csolution.yml create mode 100644 Examples/Fault/FVP_MPS2_Cortex-M7/README.md rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/CMSIS-View/EventRecorderConf.h (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/CMSIS-View/EventRecorderConf.h.base@1.1.0 (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/CMSIS/RTX_Config.c (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/CMSIS/RTX_Config.c.base@5.2.0 (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/CMSIS/RTX_Config.h (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/CMSIS/RTX_Config.h.base@5.6.0 (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h.base@1.0.0 (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct.base@1.0.0 (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld.base@1.1.0 (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/Device/CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/Device/CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c.base@1.1.0 (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/Device/CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/RTE/Device/CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c.base@1.1.0 (100%) create mode 100644 Examples/Fault/FVP_MPS2_Cortex-M7/RTE/_Debug_FVP_MPS2_Cortex-M7/RTE_Components.h rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/debug.ini (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7/vht_config.txt => FVP_MPS2_Cortex-M7/fvp_config.txt} (100%) rename Examples/Fault/{VHT_MPS2_Cortex-M7 => FVP_MPS2_Cortex-M7}/retarget_stdio.c (100%) delete mode 100644 Examples/Fault/VHT_MPS2_Cortex-M7/Fault.csolution.yml delete mode 100644 Examples/Fault/VHT_MPS2_Cortex-M7/README.md delete mode 100644 Examples/Fault/VHT_MPS2_Cortex-M7/cdefault.yml diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/ARM_FaultTrigger.c b/Examples/Fault/FVP_MPS2_Cortex-M7/ARM_FaultTrigger.c similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/ARM_FaultTrigger.c rename to Examples/Fault/FVP_MPS2_Cortex-M7/ARM_FaultTrigger.c diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/ARM_FaultTrigger.h b/Examples/Fault/FVP_MPS2_Cortex-M7/ARM_FaultTrigger.h similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/ARM_FaultTrigger.h rename to Examples/Fault/FVP_MPS2_Cortex-M7/ARM_FaultTrigger.h diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/Fault.c b/Examples/Fault/FVP_MPS2_Cortex-M7/Fault.c similarity index 88% rename from Examples/Fault/VHT_MPS2_Cortex-M7/Fault.c rename to Examples/Fault/FVP_MPS2_Cortex-M7/Fault.c index b6d468b..9e3c686 100644 --- a/Examples/Fault/VHT_MPS2_Cortex-M7/Fault.c +++ b/Examples/Fault/FVP_MPS2_Cortex-M7/Fault.c @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------------------- +/*----------------------------------------------------------------------------- * Name: Fault.c * Purpose: Fault example program *----------------------------------------------------------------------------*/ @@ -25,9 +25,9 @@ extern int stdio_init (void); osThreadId_t tid_AppThread; osThreadId_t tid_FaultTriggerThread; -/*--------------------------------------------------------------------------- +/*----------------------------------------------------------------------------- * Application thread - *---------------------------------------------------------------------------*/ + *----------------------------------------------------------------------------*/ static __NO_RETURN void AppThread (void *argument) { volatile uint32_t counter = 0U; @@ -39,9 +39,9 @@ static __NO_RETURN void AppThread (void *argument) { } } -/*--------------------------------------------------------------------------- +/*----------------------------------------------------------------------------- * Fault trigger thread - *---------------------------------------------------------------------------*/ + *----------------------------------------------------------------------------*/ static __NO_RETURN void FaultTriggerThread (void *argument) { char ch; @@ -50,13 +50,13 @@ static __NO_RETURN void FaultTriggerThread (void *argument) { // Display user interface message printf("\r\n--- Fault example ---\r\n\r\n"); printf("To trigger a fault please input a corresponding number:\r\n"); - printf(" - 0: terminate the example\r\n"); - printf(" - 1: data access (precise) Memory Management fault\r\n"); - printf(" - 2: data access (precise) Bus fault\r\n"); - printf(" - 3: data access (imprecise) Bus fault\r\n"); - printf(" - 4: instruction execution Bus fault\r\n"); - printf(" - 5: undefined instruction Usage fault\r\n"); - printf(" - 6: divide by 0 Usage fault\r\n\r\n"); + printf(" - 0: Terminate the example\r\n"); + printf(" - 1: Data access (precise) Memory Management fault\r\n"); + printf(" - 2: Data access (precise) Bus fault\r\n"); + printf(" - 3: Data access (imprecise) Bus fault\r\n"); + printf(" - 4: Instruction execution Bus fault\r\n"); + printf(" - 5: Undefined instruction Usage fault\r\n"); + printf(" - 6: Divide by 0 Usage fault\r\n\r\n"); printf("Input>"); for (;;) { @@ -69,9 +69,9 @@ static __NO_RETURN void FaultTriggerThread (void *argument) { } } -/*--------------------------------------------------------------------------- +/*----------------------------------------------------------------------------- * Application main function - *---------------------------------------------------------------------------*/ + *----------------------------------------------------------------------------*/ int main (void) { SystemCoreClockUpdate(); // Update SystemCoreClock variable @@ -114,5 +114,6 @@ int main (void) { tid_FaultTriggerThread = osThreadNew(FaultTriggerThread, NULL, NULL); osKernelStart(); // Start thread execution - for (;;); + for (;;) { // Loop forever + } } diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/Fault.cproject.yml b/Examples/Fault/FVP_MPS2_Cortex-M7/Fault.cproject.yml similarity index 63% rename from Examples/Fault/VHT_MPS2_Cortex-M7/Fault.cproject.yml rename to Examples/Fault/FVP_MPS2_Cortex-M7/Fault.cproject.yml index 2fb0e0d..5695eb1 100644 --- a/Examples/Fault/VHT_MPS2_Cortex-M7/Fault.cproject.yml +++ b/Examples/Fault/FVP_MPS2_Cortex-M7/Fault.cproject.yml @@ -1,10 +1,11 @@ project: + description: Fault example (Cortex-M7) packs: - - pack: ARM::CMSIS@>=6.0.0-0 - - pack: ARM::CMSIS-RTX@>=5.8.0-0 - - pack: ARM::CMSIS-Compiler@>=2.0.0-0 - - pack: ARM::CMSIS-View + - pack: ARM::CMSIS-View@^1.2.0-0 + - pack: ARM::CMSIS@^6.1.0 + - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-RTX@^5.9.0 groups: - group: Documentation @@ -19,19 +20,25 @@ project: components: - component: CMSIS:CORE + - component: CMSIS:OS Tick:SysTick - component: CMSIS:RTOS2:Keil RTX5&Source - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDOUT:Custom - component: CMSIS-Compiler:STDIN:Custom + - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:Custom - component: CMSIS-View:Event Recorder&Semihosting - component: CMSIS-View:Fault:Record - component: CMSIS-View:Fault:Storage - - component: Board Support&V2M-MPS2:Common - + - component: Device:Startup&C Startup - component: CMSIS Driver:USART - - component: Device:Startup&C Startup + linker: + - script: ./RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct + for-compiler: AC6 + + - script: ./RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld + for-compiler: GCC diff --git a/Examples/Fault/FVP_MPS2_Cortex-M7/Fault.csolution.yml b/Examples/Fault/FVP_MPS2_Cortex-M7/Fault.csolution.yml new file mode 100644 index 0000000..4a87f30 --- /dev/null +++ b/Examples/Fault/FVP_MPS2_Cortex-M7/Fault.csolution.yml @@ -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 diff --git a/Examples/Fault/FVP_MPS2_Cortex-M7/README.md b/Examples/Fault/FVP_MPS2_Cortex-M7/README.md new file mode 100644 index 0000000..ff2f143 --- /dev/null +++ b/Examples/Fault/FVP_MPS2_Cortex-M7/README.md @@ -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 diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS-View/EventRecorderConf.h b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS-View/EventRecorderConf.h similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS-View/EventRecorderConf.h rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS-View/EventRecorderConf.h diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS-View/EventRecorderConf.h.base@1.1.0 b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS-View/EventRecorderConf.h.base@1.1.0 similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS-View/EventRecorderConf.h.base@1.1.0 rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS-View/EventRecorderConf.h.base@1.1.0 diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.c b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.c similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.c rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.c diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.c.base@5.2.0 b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.c.base@5.2.0 similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.c.base@5.2.0 rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.c.base@5.2.0 diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.h b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.h similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.h rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.h diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.h.base@5.6.0 b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.h.base@5.6.0 similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.h.base@5.6.0 rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/CMSIS/RTX_Config.h.base@5.6.0 diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h.base@1.0.0 b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h.base@1.0.0 similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h.base@1.0.0 rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/RTE_Device.h.base@1.0.0 diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct.base@1.0.0 b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct.base@1.0.0 similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct.base@1.0.0 rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/ac6_arm.sct.base@1.0.0 diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld.base@1.1.0 b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld.base@1.1.0 similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld.base@1.1.0 rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/gcc_arm.ld.base@1.1.0 diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c.base@1.1.0 b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c.base@1.1.0 similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c.base@1.1.0 rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/startup_CMSDK_CM7.c.base@1.1.0 diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c.base@1.1.0 b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c.base@1.1.0 similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c.base@1.1.0 rename to Examples/Fault/FVP_MPS2_Cortex-M7/RTE/Device/CMSDK_CM7_SP_VHT/system_CMSDK_CM7.c.base@1.1.0 diff --git a/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/_Debug_FVP_MPS2_Cortex-M7/RTE_Components.h b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/_Debug_FVP_MPS2_Cortex-M7/RTE_Components.h new file mode 100644 index 0000000..96a319d --- /dev/null +++ b/Examples/Fault/FVP_MPS2_Cortex-M7/RTE/_Debug_FVP_MPS2_Cortex-M7/RTE_Components.h @@ -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 */ diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/debug.ini b/Examples/Fault/FVP_MPS2_Cortex-M7/debug.ini similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/debug.ini rename to Examples/Fault/FVP_MPS2_Cortex-M7/debug.ini diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/vht_config.txt b/Examples/Fault/FVP_MPS2_Cortex-M7/fvp_config.txt similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/vht_config.txt rename to Examples/Fault/FVP_MPS2_Cortex-M7/fvp_config.txt diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/retarget_stdio.c b/Examples/Fault/FVP_MPS2_Cortex-M7/retarget_stdio.c similarity index 100% rename from Examples/Fault/VHT_MPS2_Cortex-M7/retarget_stdio.c rename to Examples/Fault/FVP_MPS2_Cortex-M7/retarget_stdio.c diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/Fault.csolution.yml b/Examples/Fault/VHT_MPS2_Cortex-M7/Fault.csolution.yml deleted file mode 100644 index f92e588..0000000 --- a/Examples/Fault/VHT_MPS2_Cortex-M7/Fault.csolution.yml +++ /dev/null @@ -1,19 +0,0 @@ -solution: - - created-for: CMSIS-Toolbox@2.0.0 - cdefault: - - packs: - - pack: Keil::V2M-MPS2_CMx_BSP@1.8.0 - - target-types: - - type: VHT_MPS2_Cortex-M7 - device: ARM::CMSDK_CM7_SP_VHT - - build-types: - - type: Debug - debug: on - optimize: none - - projects: - - project: ./Fault.cproject.yml diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/README.md b/Examples/Fault/VHT_MPS2_Cortex-M7/README.md deleted file mode 100644 index 7472420..0000000 --- a/Examples/Fault/VHT_MPS2_Cortex-M7/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# Fault example (Cortex-M7) - -This project is a simple **Fault** component example running on **Arm Cortex-M7** microcontroller simulated by -[**Arm Virtual Hardware**](https://arm-software.github.io/AVH/main/simulation/html/Using.html) with the **VHT_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** simulator and does not require any hardware. - -## Prerequisites - -### Software - - - [**CMSIS-Toolbox v2.0.0**](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases) or newer - - [**Keil MDK v5.38**](https://www.keil.com/mdk5) or newer containing: - - Arm Compiler 6 (part of the MDK) - - Arm Virtual Hardware (AVH) for MPS2 platform with Cortex-M7 (part of the MDK-Professional) - - [**eventlist v1.1.0**](https://github.com/ARM-software/CMSIS-View/releases/tag/tools%2Feventlist%2F1.1.0) or newer - - [**Arm GNU Toolchain v12.3.Rel1**](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) - (only necessary when building example with GCC) - -### CMSIS Packs - - - Required packs: - - ARM::CMSIS-View - - ARM::CMSIS v6.0.0 or newer - - ARM::CMSIS-RTX v1.0.0 or newer - - ARM::CMSIS-Compiler v2.0.0 or newer - - Keil::V2M-MPS2_CMx_BSP v1.8.0 - -Missing packs can be installed by executing the following `csolution` and `cpackget` commands: - -``` -csolution list packs -s Fault.csolution.yml -m >missing_packs_list.txt -cpackget add -f missing_packs_list.txt -``` - -## Build - -1. Use the `csolution` command to create `.cprj` project files (for **Arm Compiler 6** toolchain): - ``` - csolution convert -s Fault.csolution.yml - ``` - or, for **GCC** toolchain use the following command: - ``` - csolution convert -s Fault.csolution.yml -t GCC - ``` - -2. Use the `cbuild` command to create executable files: - ``` - cbuild Fault.Debug+VHT_MPS2_Cortex-M7.cprj - ``` - -## Run - -### AVH Target - -Execute the following steps: - - run the AVH model (with example built with **Arm Compiler 6** toolchain) from the command line by executing the following command: - ``` - VHT_MPS2_Cortex-M7 -f vht_config.txt out/Fault/VHT_MPS2_Cortex-M7/Debug/Fault.axf - ``` - or, run the AVH model (with example built with **GCC** toolchain) from the command line by executing the following command: - ``` - VHT_MPS2_Cortex-M7 -f vht_config.txt out/Fault/VHT_MPS2_Cortex-M7/Debug/Fault.elf - ``` - > **Note:** The Arm Virtual Hardware executables have to be in the environment path, otherwise absolute path to the - `VHT_MPS2_Cortex-M7.exe` (e.g. `c:\Keil\ARM\VHT\VHT_MPS2_Cortex-M7`) has to be provided instead of `VHT_MPS2_Cortex-M7`. - - The generated file `EventRecorder.log` contains the events that were generated during the example execution. - This file is the input for the `eventlist` utility which can be used for further analysis. - - - follow the instructions in the simulator console - -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 - -### Running the example in the uVision - - - open `Fault.Debug+VHT_MPS2_Cortex-M7.cprj` with the **uVision** - - open **Options for Target** - - select **Debug** tab - - under **Use** select **Models Cortex-M Debugger** and click on **Settings** button end enter the following: - - Command: `$K\ARM\VHT\VHT_MPS2_Cortex-M7.exe` - - Target: `armcortexm7ct` - - Configuration File: `.\vht_config.txt` - - under **Initialization File:** enter the following: `.\debug.ini` - - start the **Debug Session** - - **Run** the code - - you can see the events recorded by opening **View** - **Analysis Windows** - **Event Recorder** - - you can see the state of the recorded fault by opening **View** - **Watch Windows** - **Fault** - -## Analysis - -To analyze the result `eventlist` utility is needed, copy the executable `eventlist` file to the same folder where `EventRecorder.log` is located. - -To process `EventRecorder.log` file with the `eventlist` utility in **Windows Command Prompt** (cmd.exe) execute the following command: -``` -eventlist -I %CMSIS_PACK_ROOT%/ARM/CMSIS-View/1.0.0/Fault/ARM_Fault.scvd -I %CMSIS_PACK_ROOT%/ARM/CMSIS-View/1.0.0/EventRecorder/EventRecorder.scvd -I %CMSIS_PACK_ROOT%/ARM/CMSIS-RTX/1.0.0/RTX5.scvd EventRecorder.log -``` - -> **Note** -> - If CMSIS-View v1.0.0 or CMSIS-RTX v1.0.0 packs are not installed, in the previous command replace corresponding path with the path of the latest installed packs - (for example replace `%CMSIS_PACK_ROOT%/ARM/CMSIS-View/1.0.0/Fault/` with `%CMSIS_PACK_ROOT%/ARM/CMSIS-View/1.0.1/Fault/`) diff --git a/Examples/Fault/VHT_MPS2_Cortex-M7/cdefault.yml b/Examples/Fault/VHT_MPS2_Cortex-M7/cdefault.yml deleted file mode 100644 index 337aeb1..0000000 --- a/Examples/Fault/VHT_MPS2_Cortex-M7/cdefault.yml +++ /dev/null @@ -1,26 +0,0 @@ -default: - - compiler: AC6 - - misc: - - for-compiler: AC6 - C-CPP: - - -ffunction-sections - C: - - -std=gnu11 - ASM: - - -masm=auto - Link: - - --entry=Reset_Handler - - --map - - --info summarysizes - - - for-compiler: GCC - C-CPP: - - -ffunction-sections - C: - - -std=gnu11 - Link: - - --entry=Reset_Handler - - --specs=nano.specs - - -Wl,-Map=$elf()$.map