2024-02-16 3:33 AM
When I'm enabling DMA and run the code, the debugger hangs at "SCB_EnableDCache();" even though the function is correctly excuting when I go step by step. Also as seen in the examples the problem gets solved when using a static declaration "static void CPU_CACHE_Enable(void);"
Is it the issue with the debugger or the code.
Solved! Go to Solution.
2024-02-16 5:37 AM
Hello @gvenkatr13
As recommendation, I invite you to review this FAQ:
DMA is not working on STM32H7 devices - STMicroelectronics Community
2024-02-16 5:37 AM
Hello @gvenkatr13
As recommendation, I invite you to review this FAQ:
DMA is not working on STM32H7 devices - STMicroelectronics Community
2024-02-16 6:05 AM
@gvenkatr13 wrote:
When I'm enabling DMA and run the code, the debugger hangs at "SCB_EnableDCache();"
Where did you enable the cache? is that possible to share your code?
2024-02-16 7:06 AM
@gvenkatr13 Do not try to single-step thru SCB_EnableDCache and its friends. This is a known behavior. Whether it is a bug [with complex inline functions] or not IMHO does not matter, just don't do this. Converting the inline to a normal function may help, but ST won't change it because these header files come from upstream (ARM CMSIS).
2024-02-17 1:22 AM
It was automatically generate by cubeMX in main() when I enable DMA.
/* Enable the CPU Cache */
/* Enable I-Cache---------------------------------------------------------*/
SCB_EnableICache();
/* Enable D-Cache---------------------------------------------------------*/
SCB_EnableDCache();
2025-07-11 8:02 AM
Any idea on what's causing the delay when debugging the code? is it H/W related or S/W related?
2025-07-12 3:50 AM
Delay? which delay? The Eclipse debugger is quite heavy so not surprising that it is slow. A machine with fast SSD drive and large RAM may help.
2025-07-12 9:21 AM
You mentioned that when we are single stepping through SCB_EnableDCache() and its friends is not recommeneded and it is a known behaviour. Any reason for this? When single stepping through cache enable code delays in its execution but this doesn't happen we don't debug.
2025-07-12 11:41 PM
I've just noticed it more than once, with several CubeIDE debugger versions (gdb based). I don't know why it happens. Speculation: could be because the debugger knows something about the target caches and invalidates data collected on the host side when it sees that the code touched the cache. And something goes wrong with that. </speculation>