Skip to content

Commit

Permalink
Examples: update .pdsc (+ some cleanup)
Browse files Browse the repository at this point in the history
- update .pdsc
- remove vcpkg-configuration.json
- correct version in .scvd file
- correct version in ARM_Fault.h file
- improve ARM_FaultPrint.c module
- add required board pack to gen_pack.sh
  • Loading branch information
MiloradCvjetkovic authored and RobertRostohar committed Nov 28, 2024
1 parent 00e513a commit 8f18397
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 38 deletions.
18 changes: 13 additions & 5 deletions ARM.CMSIS-View.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
Event Recorder:
- Add support for CMSIS v6
- Update conditions to prevent simultaneous selection of CMSIS-View::Event Recorder and Compiler::Event Recorder components
- Update Event Statistic example to support CMSIS-Toolbox v2
- Update Event Statistic example to support latest tools and packs
Fault component:
- Extend section name for fault information, for easier absolute addressing via the linker script
- Update Fault example for Cortex-M33 (B-U585I-IOT02A) with improved GCC support and add support for building with CMSIS-Toolbox v2
- Update Fault example for AVH Cortex-M7 to support CMSIS-Toolbox v2
- Update Fault example for Cortex-M33 (B-U585I-IOT02A) to support latest tools and packs
- Update Fault example for AVH Cortex-M7 to support latest tools and packs
</release>
</releases>

Expand Down Expand Up @@ -105,7 +105,7 @@
<files>
<file category="header" name="Fault/Include/ARM_Fault.h"/>
<file category="source" name="Fault/Source/ARM_FaultStorage.c"/>
<file category="source" name="Fault/Template/ARM_FaultPrint.c" version="1.0.1" attr="template" select="Output decoded fault information via STDIO"/>
<file category="source" name="Fault/Template/ARM_FaultPrint.c" version="1.1.0" attr="template" select="Output decoded fault information via STDIO"/>
<file category="doc" name="Documentation/html/fault.html"/>
<file category="other" name="Fault/ARM_Fault.scvd"/>
</files>
Expand All @@ -132,11 +132,19 @@
<environment name="csolution" load="EventStatistic.csolution.yml"/>
</project>
</example>
<example name="Fault example" folder="Examples/Fault/FVP_MPS2_Cortex-M7" doc="README.md">
<description>Example that shows the usage of Fault component on a simulated virtual Cortex-M7 device.</description>
<board name="V2M-MPS2" vendor="ARM"/>
<project>
<environment name="csolution" load="Fault.csolution.yml"/>
</project>
</example>
<example name="Fault example" folder="Examples/Fault/B-U585I-IOT02A" doc="README.md">
<description>Example that shows the usage of Fault component on an Cortex-M33 with TrustZone.</description>
<description>Example that shows the usage of Fault component on the B-U585I-IOT02A board (Cortex-M33) with TrustZone.</description>
<board name="B-U585I-IOT02A" vendor="STMicroelectronics"/>
<project>
<environment name="csolution" load="Fault.csolution.yml"/>
<environment name="uv" load="Fault.uvmpw"/>
</project>
</example>
</examples>
Expand Down
23 changes: 0 additions & 23 deletions Examples/vcpkg-configuration.json

This file was deleted.

4 changes: 2 additions & 2 deletions Fault/ARM_Fault.scvd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2023 Arm Limited. All rights reserved.
Copyright (c) 2023-2024 Arm Limited. All rights reserved.
SPDX-License-Identifier: Apache-2.0
Expand All @@ -19,7 +19,7 @@

<component_viewer schemaVersion="1.2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">

<component name="Fault" version="1.0.1"/>
<component name="Fault" version="1.1.0"/>

<typedefs>
<!-- VersionString_t -->
Expand Down
6 changes: 3 additions & 3 deletions Fault/Include/ARM_Fault.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023 Arm Limited. All rights reserved.
* Copyright (c) 2022-2024 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -90,11 +90,11 @@
#endif

// Fault component version
#define ARM_FAULT_VERSION "1.0.1"
#define ARM_FAULT_VERSION "1.1.0"

// Fault Information structure type version
#define ARM_FAULT_FAULT_INFO_VER_MAJOR (1U) // ARM_FaultInfo type Version.Major
#define ARM_FAULT_FAULT_INFO_VER_MINOR (0U) // ARM_FaultInfo type Version.Minor
#define ARM_FAULT_FAULT_INFO_VER_MINOR (1U) // ARM_FaultInfo type Version.Minor

#ifdef __cplusplus
extern "C" {
Expand Down
50 changes: 45 additions & 5 deletions Fault/Template/ARM_FaultPrint.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023 Arm Limited. All rights reserved.
* Copyright (c) 2022-2024 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -161,8 +161,9 @@ void ARM_FaultPrint (void) {

/* Output: Decoded MemManage fault information */
if (ARM_FaultInfo.Content.FaultRegs != 0U) {
uint32_t scb_cfsr = ARM_FaultInfo.FaultRegisters.CFSR;
uint32_t scb_mmfar = ARM_FaultInfo.FaultRegisters.MMFAR;
uint32_t scb_cfsr = ARM_FaultInfo.FaultRegisters.CFSR;
uint32_t scb_mmfar = ARM_FaultInfo.FaultRegisters.MMFAR;
uint8_t faults_cnt = 0U;

if ((scb_cfsr & (SCB_CFSR_IACCVIOL_Msk |
SCB_CFSR_DACCVIOL_Msk |
Expand All @@ -175,19 +176,36 @@ void ARM_FaultPrint (void) {
printf(" Fault: MemManage - ");

if ((scb_cfsr & SCB_CFSR_IACCVIOL_Msk) != 0U) {
faults_cnt++;
printf("Instruction execution failure due to MPU violation or fault");
}
if ((scb_cfsr & SCB_CFSR_DACCVIOL_Msk) != 0U) {
faults_cnt++;
if (faults_cnt > 1U) {
printf("\n Fault: MemManage - ");
}
printf("Data access failure due to MPU violation or fault");
}
if ((scb_cfsr & SCB_CFSR_MUNSTKERR_Msk) != 0U) {
faults_cnt++;
if (faults_cnt > 1U) {
printf("\n Fault: MemManage - ");
}
printf("Exception exit unstacking failure due to MPU access violation");
}
if ((scb_cfsr & SCB_CFSR_MSTKERR_Msk) != 0U) {
faults_cnt++;
if (faults_cnt > 1U) {
printf("\n Fault: MemManage - ");
}
printf("Exception entry stacking failure due to MPU access violation");
}
#ifdef SCB_CFSR_MLSPERR_Msk
if ((scb_cfsr & SCB_CFSR_MLSPERR_Msk) != 0U) {
faults_cnt++;
if (faults_cnt > 1U) {
printf("\n Fault: MemManage - ");
}
printf("Floating-point lazy stacking failure due to MPU access violation");
}
#endif
Expand All @@ -200,8 +218,9 @@ void ARM_FaultPrint (void) {

/* Output: Decoded BusFault information */
if (ARM_FaultInfo.Content.FaultRegs != 0U) {
uint32_t scb_cfsr = ARM_FaultInfo.FaultRegisters.CFSR;
uint32_t scb_bfar = ARM_FaultInfo.FaultRegisters.BFAR;
uint32_t scb_cfsr = ARM_FaultInfo.FaultRegisters.CFSR;
uint32_t scb_bfar = ARM_FaultInfo.FaultRegisters.BFAR;
uint8_t faults_cnt = 0U;

if ((scb_cfsr & (SCB_CFSR_IBUSERR_Msk |
SCB_CFSR_PRECISERR_Msk |
Expand All @@ -215,22 +234,43 @@ void ARM_FaultPrint (void) {
printf(" Fault: BusFault - ");

if ((scb_cfsr & SCB_CFSR_IBUSERR_Msk) != 0U) {
faults_cnt++;
printf("Instruction prefetch failure due to bus fault");
}
if ((scb_cfsr & SCB_CFSR_PRECISERR_Msk) != 0U) {
faults_cnt++;
if (faults_cnt > 1U) {
printf("\n Fault: BusFault - ");
}
printf("Data access failure due to bus fault (precise)");
}
if ((scb_cfsr & SCB_CFSR_IMPRECISERR_Msk) != 0U) {
faults_cnt++;
if (faults_cnt > 1U) {
printf("\n Fault: BusFault - ");
}
printf("Data access failure due to bus fault (imprecise)");
}
if ((scb_cfsr & SCB_CFSR_UNSTKERR_Msk) != 0U) {
faults_cnt++;
if (faults_cnt > 1U) {
printf("\n Fault: BusFault - ");
}
printf("Exception exit unstacking failure due to bus fault");
}
if ((scb_cfsr & SCB_CFSR_STKERR_Msk) != 0U) {
faults_cnt++;
if (faults_cnt > 1U) {
printf("\n Fault: BusFault - ");
}
printf("Exception entry stacking failure due to bus fault");
}
#ifdef SCB_CFSR_LSPERR_Msk
if ((scb_cfsr & SCB_CFSR_LSPERR_Msk) != 0U) {
faults_cnt++;
if (faults_cnt > 1U) {
printf("\n Fault: BusFault - ");
}
printf("Floating-point lazy stacking failure due to bus fault");
}
#endif
Expand Down
1 change: 1 addition & 0 deletions gen_pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ PACKCHK_DEPS="
ARM.CMSIS.pdsc
ARM.V2M_MPS3_SSE_300_BSP.pdsc
Keil.B-U585I-IOT02A_BSP.pdsc
Keil.V2M-MPS2_CMx_BSP.pdsc
"

# Optional: restrict fallback modes for changelog generation
Expand Down

0 comments on commit 8f18397

Please sign in to comment.