2019-04-23 05:31 PM
Hi,
I got a strange behavior during debugging my bare metal application on STM32F745ZGTx. The emulator is ST-Link V2, with "B 2018 02" printed on the back. The Hard Fault exception (unaligned memory access) is triggered randomly. I mean, the PC causing problem is not at the same place, but randomly. The trouble-shooting steps I have taken:
So it seems the SWO connection is causing the problem. But I am sure the connection is fine, as I can saw the printf content when SWO is connected.
Do you have any idea about the problem? Please see the attached pictures for the crash, and the attached ioc file for my configuration. Thanks in advance.
BR
/Li
Add one more point: I tried to disable the ITM redirect IO and disabled the printf code directly. In such case, if the SWO pin from ST-Link V2 is still connected to the target, the problem will rise too.
2024-11-01 01:11 PM
I thought perhaps the xPortPendSVHandler was being interrupted by a higher priority interrupt, but I have reduced all code execution down to just the IdleTask and the SysTick interrupt as shown here in the Interrupt log:
...
21s 866820.48 us SysTick Leave ---- 0.67 us
21s 867819.79 us SysTick Enter ----
21s 867820.46 us SysTick Leave ---- 0.67 us
21s 868819.78 us SysTick Enter ----
21s 868820.45 us SysTick Leave ---- 0.67 us
21s 869819.76 us SysTick Enter ----
21s 869820.42 us SysTick Leave ---- 0.66 us
21s 870055.88 us HardFault Enter ----
I'm not using printf. The original poster LZhan.1 is.