D-Cache failed again?
While heavy updating customized DynamicGraph after some time (from 10 minutes to more then an hour) application goes to HardFault.
Investigation shows that problem always happens inside TouchGFX library function CWRUtil::Q5 indexToScreenXQ5( const AbstractDataGraph *graph, const int16_t index const );
Failing code:
ldr r3, [r1, #0]
mov r0, r1
mov r1, r2
ldr.w r3, [r3, #212] <-- HardFault
bx r3
registers at time of HardFault:
r0 = 0x2400f124
r1 = 0x00000130
r2 = 0x00000130
r3 = 0x001c0002 <-- problem! usually it equals to 0x080924ac
So it should go this way:
r3 = &(0x2400f124) = 0x080924ac
0x080924ac + 212 = 0x8092580
&(0x8092580) = 0x0806865d
jump to 0x0806865d (indexToScreenXQ5)
But when it fails:
r3 = &(0x2400f124) = 0x001c0002
0x001c0002 + 212 = 0x001c00d6
&(0x001c00d6) = xxxx
HardFault
P.S.
0x2400f124 - correct pointer to graph class in SRAM
0x080924ac - correct graph class flash code location
0x001c0002 - incorrect (invalid address)