STM32F4 HardFault with 1 bit flipped address access
Hello Everyone,
I have a Communication (UARTs) and DMA intense application running on stm32f439z.
I am getting a strange Hardfault, not very rarely, I would say one per hour average, related to a wrong address access on the bus.
Not happening always for the same address or same point of the code, however, the behavior is same, 1 bit is flipped or corrupted or changed somehow and getting a faulty bus access.
For the example below, while it was trying to read from address 0x2000002c, the register( r3) content is somehow 0x2020002c and this address is out of bounds of course ( Ram end: 0x20030000)
Could anyone have any guess about such a Fault?
Could this be a Flash corruption or Flash-read error?
Could this be related to a voltage/clock error?
I am using internal 16MHz HSI RC, and system clock is 80 MHz. APB1 PCLK is 40MHz, APB2 PCLK is 80MHz.
Hw is custom PCB, Vcc of MCU is 3v3.
Any hint to go further debugging of such fault?
The details of the debug of one example on STM32CubeIDE environment is as follows:
800b60a: 4b18 ldr r3, [pc, #96] ; (800b66c)
800b60c: 4628 mov r0, r5
800b60e: 6819 ldr r1, [r3, #0]
.....
800b66c: 2000002c .word 0x2000002c
RElevant Fault Registers:
Register: CFSR_UFSR_BFSR_MMFSR
Address: 0xe000ed28
Value: 0x8200
Size: 32
Reset value: 0x0
Reset mask: 0xFFFFFFFF
Access permission: RW
Read action:
Description:
Configurable fault status
register
Register: BFAR
Address: 0xe000ed38
Value: 0x2020002c
Size: 32
Reset value: 0x0
Reset mask: 0xFFFFFFFF
Access permission: RW
Read action:
Description:
Bus fault address register
General Purpose registers:
r0 0x2001c6a0 (Hex)
r1 0x0 (Hex)
r2 0x2001ccdc (Hex)
r3 0x2020002c (Hex)
r4 0x2001c558 (Hex)
r5 0x2001c6a0 (Hex)
r6 0x2001ec50 (Hex)
r7 0x2002fe40 (Hex)
r8 0x51 (Hex)
r9 0x2001ec58 (Hex)
r10 0x2001ec54 (Hex)
r11 0x2001ec50 (Hex)
r12 0x1 (Hex)
sp 0x2002fd30 (Hex)
lr 0xffffffe9 (Hex)
pc 0x8004eda (Hex)
xpsr 0x61000003 (Hex)
d0 0x738d (Hex)
d1 0xa8c0 (Hex)
d2 0x0 (Hex)
d3 0x0 (Hex)
d4 0x0 (Hex)
d5 0x0 (Hex)
d6 0x0 (Hex)
d7 0x26dcd (Hex)
d8 0x0 (Hex)
d9 0x0 (Hex)
