Skip to main content
Graduate II
February 14, 2025
Solved

STM32H733 data cache initialization issue

  • February 14, 2025
  • 2 replies
  • 2841 views

Hello,

I am using a STM32H733VGT on a custom design board. On a fresh project in CubeMX, I tried to activate data cache but the autogenerated code crashes at  SCB_EnableDCache(); . (nothing has been activated on the CubeMX, just the external crystal and debugging port)

i tried enabling or disabling MPU as well, same results.

I need data cache for activating ethernet.

 

Any help would be highly appreciated.

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    I didn't find that exact device STM32H733VGT but tested your ioc file on NUCLEO-H723ZI board (STM32H723ZI) and I didn't reproduce the behavior.

    Don't step into SCB_EnableICache() and SCB_EnableDCache().

    If you put a break point on HAL_Init() and run, do you reach it? 

    2 replies

    Technical Moderator
    February 14, 2025

    Hello,

    Are you sure you've generated a project for STM32H733 and not another MCU device?

    Is that possible to share your ioc file?

    amirshnAuthor
    Graduate II
    February 14, 2025

    Hi 
    I think so , here is my ioc file:

    Thanks

    Technical Moderator
    February 14, 2025

    Could you please replace the MPU config like the following?:

    void MPU_Config(void)
    {
     MPU_Region_InitTypeDef MPU_InitStruct = {0};
    
     /* Disables the MPU */
     HAL_MPU_Disable();
    
     /** Initializes and configures the Region and the memory to be protected
     */
     MPU_InitStruct.Enable = MPU_REGION_ENABLE;
     MPU_InitStruct.Number = MPU_REGION_NUMBER0;
     MPU_InitStruct.BaseAddress = 0x0;
     MPU_InitStruct.Size = MPU_REGION_SIZE_4GB;
     MPU_InitStruct.SubRegionDisable = 0x87;
     MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
     MPU_InitStruct.AccessPermission = MPU_REGION_NO_ACCESS;
     MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
     MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
     MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
     MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
    
     HAL_MPU_ConfigRegion(&MPU_InitStruct);
     /* Enables the MPU */
     HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
    
    }
    

     

    mƎALLEmAnswer
    Technical Moderator
    February 18, 2025

    Hello,

    I didn't find that exact device STM32H733VGT but tested your ioc file on NUCLEO-H723ZI board (STM32H723ZI) and I didn't reproduce the behavior.

    Don't step into SCB_EnableICache() and SCB_EnableDCache().

    If you put a break point on HAL_Init() and run, do you reach it? 

    amirshnAuthor
    Graduate II
    February 18, 2025

    Hi,

    yeah, that's the case, unexpectedly if I put a breakpoint after these two (SCB_EnableICache() and SCB_EnableDCache()) , I'll reach HAL_Init(). (I just figured this out).

    Could you tell me why is it behaving like this?

     

    Thanks a lot for your help.