Skip to main content
Explorer II
December 12, 2023
Solved

STM32H563: Reading flash size data register at 0x08FFF80C => Hard Fault

  • December 12, 2023
  • 2 replies
  • 2200 views

I'm using a Nucleo-H563ZI in non-secure mode.
When I access the FLASHSIZE_BASE address:

#define FLASHSIZE_BASE (0x08FFF80CUL) /*!< Flash size data register base address */

I get a hard fault (16 or 32 bit access).

In the debugger the memory dump at address 0x08FFF80C only shows question marks.

Is there anything special to access the flash size data register for the H5 family?

 

    This topic has been closed for replies.
    Best answer by AScha.3

    mmhmm..

     

     void MPU_Config(void)
    {
     HAL_MPU_Disable();
    
     // configure the MPU to prohibit access to after the .bss
     // this will trigger an exception if the stack grows to large
     MPU_Region_InitTypeDef MPU_InitStruct;
     MPU_InitStruct.Enable = MPU_REGION_ENABLE;
     MPU_InitStruct.Number = MPU_REGION_NUMBER0;
     MPU_InitStruct.BaseAddress = 0x08fff800;
     MPU_InitStruct.LimitAddress = 0x08fff900;
     MPU_InitStruct.AttributesIndex = MPU_ATTRIBUTES_NUMBER0;
     MPU_InitStruct.AccessPermission = MPU_REGION_ALL_RO;
     MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
     MPU_InitStruct.IsShareable = MPU_ACCESS_OUTER_SHAREABLE;
     HAL_MPU_ConfigRegion(&MPU_InitStruct);
    
     HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
    }
    * USER CODE END 0 *

     

    from a post today...

    https://community.st.com/t5/stm32-mcus-products/stm32h573-read-otp/m-p/618689#M229775

     

    +

    now you can connect to your H563 ?

    2 replies

    AScha.3Answer
    Super User
    December 12, 2023

    mmhmm..

     

     void MPU_Config(void)
    {
     HAL_MPU_Disable();
    
     // configure the MPU to prohibit access to after the .bss
     // this will trigger an exception if the stack grows to large
     MPU_Region_InitTypeDef MPU_InitStruct;
     MPU_InitStruct.Enable = MPU_REGION_ENABLE;
     MPU_InitStruct.Number = MPU_REGION_NUMBER0;
     MPU_InitStruct.BaseAddress = 0x08fff800;
     MPU_InitStruct.LimitAddress = 0x08fff900;
     MPU_InitStruct.AttributesIndex = MPU_ATTRIBUTES_NUMBER0;
     MPU_InitStruct.AccessPermission = MPU_REGION_ALL_RO;
     MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
     MPU_InitStruct.IsShareable = MPU_ACCESS_OUTER_SHAREABLE;
     HAL_MPU_ConfigRegion(&MPU_InitStruct);
    
     HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
    }
    * USER CODE END 0 *

     

    from a post today...

    https://community.st.com/t5/stm32-mcus-products/stm32h573-read-otp/m-p/618689#M229775

     

    +

    now you can connect to your H563 ?

    Nikita91Author
    Explorer II
    December 20, 2023

    Thank you, this does the trick.

    However it's strange, so I asked for clarification, to no avail so far...

    https://community.st.com/t5/stm32-mcus-products/request-for-explanations-regarding-the-icache-of-h5/m-p/619332#M229959