Why D-cache invalidation hangs?
Just noticed that my application TouchGXF task hanged. Other FreeRTOS tasks are continue to work.
Debugger shows that problem is within core_cm7 SCB_CleanInvalidateDCache():
/* clean & invalidate D-Cache */
sets = (uint32_t)(CCSIDR_SETS(ccsidr));
do {
ways = (uint32_t)(CCSIDR_WAYS(ccsidr));
do {
SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) |
((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) );
#if defined ( __CC_ARM )
__schedule_barrier();
#endif
} while (ways-- != 0U);
} while(sets-- != 0U);sets = 69
ways = 3682273424 and counting down
I think it will stop counting eventually, but it takes time...
During regular run initial values are: sets = 127, ways = 3, ant it has sense because ARM documentation says CCSIDR sets bits are [27:13] and ways bits are [12:3] (in Cortex M7allowed values are 0x01 for instruction caches and 0x03 for data caches)
STM32CubeIDE Version: 1.7.0
ARM CMSIS 5.7.0
Cube IDE STM32H7 MCU package 1.9.1
TouchGFX 4.17.0
Is it a bug? Is there a way to fix this?