I have an application (and bootloader) that every couple times power is cycled, will hard fault on bootup (after bootloader) otherwise works just fine. I've done some troubleshooting and investigating with the trace, and to me it looks like the PC is getting corrupted or the value is somehow shifted.
In the map output file there is a newer segment of code that is located in memory at 0x0801E408 which does seem to correlate somehow to the issue. Looking at the trace, you can see in the stack (R3) and the PC a value that looks like that address shifted right by a byte and then something else gets shifted to the MSB. But that is an invalid address for an instruction, so I'm wondering how that ended up in the PC! If I move the function call from that address around, sometimes I'll see the same but instead of the MSB being 41 it's 69 or 0D.
FaultType: HardFault
Context:
R0 : 20001188
R1 : 00000000
R2 : 00000000
R3 : 410801E4
R4 : 20004874
R5 : 200138B0
R6 : 2000A340
R7 : 00000000
R8 : FFFFFFFF
R9 : 00000620
R10 : 00000000
R11 : 00000000
R12 : 00000000
SP : 2000A2A8
LR : 0802D10F
PC : 410801E4
xPSR : 60000000
PSP : 2000A288
MSP : 10007FD8
CPUID: 410FC241
HFSR : 40000000
MMFSR: 00000001
BFSR : 00000000
UFSR : 00000000
DFSR : 00000000
AFSR : 00000000
SHCSR: 00000000
Mode : Thread
Priv : Privileged
Stack: PSP