Skip to main content
Visitor II
February 16, 2024
Solved

Debugger hangs at SCB_EnableDCache();

  • February 16, 2024
  • 3 replies
  • 2788 views

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.

    This topic has been closed for replies.
    Best answer by Imen.D

    Hello @gvenkatr13 

    As recommendation, I invite you to review this FAQ: 

    DMA is not working on STM32H7 devices - STMicroelectronics Community

    3 replies

    Imen.DAnswer
    Technical Moderator
    February 16, 2024

    Hello @gvenkatr13 

    As recommendation, I invite you to review this FAQ: 

    DMA is not working on STM32H7 devices - STMicroelectronics Community

    Technical Moderator
    February 16, 2024

    @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?

    Visitor II
    February 17, 2024

    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();

     

     

    Super User
    February 16, 2024

    @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).

     

    ST Employee
    July 11, 2025

    Any idea on what's causing the delay when debugging the code? is it H/W related or S/W related?

    Super User
    July 12, 2025

    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.