cancel
Showing results for 
Search instead for 
Did you mean: 

D-Cache failed again?

ktrofimo
Senior III

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)

3 REPLIES 3
ktrofimo
Senior III

Yes. It is D-Cache not updating properly problem.

Call to ​SCB_CleanInvalidateDCache(); before copying quite large amount of data helps.

Uptime 9h for now and no HardFaults

Romain DIELEMAN
ST Employee

What MCU are you using again ? What version of TouchGFX did you try it with ?

/Romain

MCU: STM32H743IIT6

STM32CubeIDE Version: 1.7.0

ARM CMSIS 5.7.0

Cube IDE STM32H7 MCU package 1.9.1

TouchGFX 4.17.0

"Again" - because I ​already had similar issues with D-Cache: https://community.st.com/s/question/0D53W00001K3F7WSAV/why-dcache-invalidation-hangs