2020-07-10 12:33 AM
does anybody have a idea why the code is stuck at below do while loop (bold marked)?.
use case: for the boot application , SCB_DisableDCache () is getting called before jumping into use aplication.
__STATIC_INLINE void SCB_DisableDCache (void)
{
#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)
uint32_t ccsidr;
uint32_t sets;
uint32_t ways;
SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* Level 1 data cache */
__DSB();
SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; /* disable D-Cache */
__DSB();
ccsidr = SCB->CCSIDR;
/* 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);
__DSB();
__ISB();
#endif
}
2020-07-10 02:56 PM
Was DCache enabled before you call this?
Are you trying to step thru this function in debugger?
-- pa
2020-07-10 04:18 PM
Haven't sorted out the exact reason behind it, but cache management functions tend to stuck if you try to debug them by stepping in or even stepping over with a single step. Just let them run normally and use breakpoints to stop at specific code.
2020-07-12 02:16 AM
hi , yes i have enabled DCache during init and disabled again in deinit process before jumping into application software.
no, i just let it running and tried without debugger after flashing too, while debugging its observed code is breaking at i mentioned before.
2020-07-12 02:17 AM
hi Piranha, yes tried the same still issue persists.
2020-07-12 02:20 AM
additional info, i use the RAM location to fill the data using linker commands in c file after the necessary configurations in .id file.
do i need to do any sort of memory configurations as below
HAL_MPU_ConfigRegion(&MPU_InitStruct); ??
2020-07-15 01:29 AM
still this issue is not solved?please share your valuable inputs to find the root cause and fix
2020-11-02 03:08 PM
Hi,
Did you solve the problem?
I have exactly the same behavior in this project:
It works fine on STM32F7508-DISCO board but stuck in SCB_DisableDCache (void) on my custom board.
The difference is the microcontroller used. On STM32F7508-DISCO there is STM32F750N8 and on my board I have STM32F750V8.
But I can't find any difference between those chips that could affect DCache invalidating.
2020-11-03 07:13 AM
hi,
please include below part of code during deinit.
SCB_DisableICache();
SCB_DisableDCache();
SCB_CleanDCache();
SCB_InvalidateICache();
SCB_InvalidateDCache();
alternative workaround :
if you have big size array or accessing variables, please use volatile keyword. which don't use cache memory.
Reason for the problem: cache is not cleared properly during de-init procedure.
hope this information helps you.
-Anandh Ram
2020-11-03 07:28 AM
Thanks so much. I'll check this out today and let you know if it worked.