This project is a simple Fault component example running on Arm Cortex-M33 microcontroller on a STMicroelectronics B-U585I-IOT02A evaluation board.
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 and via the STDIO.
The fault information can also be inspected with Component Viewer in a debug session.
This board has to be properly configured with TrustZone enabled.
Please follow the steps below carefully:
Configure the following Option bytes with STM32CubeProgrammer utility:
TZEN
: checkedDBANK
: checkedSECBOOTADD0
: Value = 0x1800 Address = 0x0c000000SECWM1_PSTRT
: Value = 0x0 Address = 0x08000000SECWM1_PEND
: Value = 0x7f Address = 0x080fe000WRP1A_PSTRT
: Value = 0x7f Address = 0x080fe000WRP1A_PEND
: Value = 0x0 Address = 0x08000000SECWM2_PSTRT
: Value = 0x7f Address = 0x08000000SECWM2_PEND
: Value = 0x0 Address = 0x08100000WRP2A_PSTRT
: Value = 0x7f Address = 0x081fe000WRP2A_PEND
: Value = 0x0 Address = 0x08100000To try the example do the following steps:
Fault.uvmpw
in the uVisionProject: Fault_S
projectProject: Fault_NS
projectNote: In the debug session fault information can be inspected in the Component View and Event Recorder windows
The fault triggering is done by entering a number via Serial Terminal application (see possible values below).
Clock Settings:
The example contains 2 applications: Secure and Non-Secure.
Secure application (bare-metal, no RTOS):
Non-Secure application (uses RTX RTOS and Standard C Library):
When a fault is triggered the fault handler saves the fault information with the ARM_FaultSave function. When valid fault information exists it can be viewed with Component Viewer or with ARM_FaultRecord function the fault information can be output to the Event Recorder or with the ARM_FaultPrint function it can be output to the STDIO.