How to resolve "HardFault exception" issue when Trustzone activated on STM32H573VIT6
- May 30, 2023
- 1 reply
- 4079 views
Hi guys! Good day and hope you are doing well.
I am currently working with STM32H573VIT6. I have enabled the Trustzone by using STM32CubeProgrammer (i.e., from the "Option bytes" feature). After that I am having an issue of "Hardfault exception" during debugging(FYI, I am using IAR as IDE). I have got the following logs from the debug log.
- Mon May 29, 2023 16:46:55: Breakpoint hit: Code @ startup_stm32h573xx.s:235.1, type: default (auto)
- Mon May 29, 2023 16:46:55: HardFault exception.
- Mon May 29, 2023 16:46:55: The processor has escalated a configurable-priority exception to HardFault.
- Mon May 29, 2023 16:46:55:
- Mon May 29, 2023 16:46:55: A bus fault has occurred on an instruction prefetch (CFSR.IBUSERR, BFAR).
- Mon May 29, 2023 16:46:55:
- Mon May 29, 2023 16:46:55: Attribution unit violation:
- Mon May 29, 2023 16:46:55: An attempt was made to access parts of the address space that are marked as Secure with NS-Req for the transaction set to Non-secure.
- Mon May 29, 2023 16:46:55: At address 0xfffffff8.
- Mon May 29, 2023 16:46:55:
- Mon May 29, 2023 16:46:55: Could not determine the location where the exception occurred.
- Mon May 29, 2023 16:46:55:
- Mon May 29, 2023 16:46:55: See the call stack for more information.
From the log, it seems that probably the reason is: "An attempt was made to access parts of the address space that are marked as Secure with NS-Req for the transaction set to Non-secure at address 0xfffffff8".
Can someone help me where I am doing something wrong so that these errors are appearing? Is it that I did not set some parameters on "Option bytes" (by using STM32CubeProgrammer. See the attachment for details) or something else I need to check? By the way, I did not able to find "RDP level" in "Option bytes" feature.
Anyway, I will be very grateful for any advices.
Thanks in advance.
N.B: Please find the screenshots in attachment section.




