cancel
Showing results for 
Search instead for 
Did you mean: 

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

Nikita91
Lead II

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Principal III

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 ?

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
AScha.3
Principal III

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 ?

If you feel a post has answered your question, please click "Accept as Solution".
Nikita91
Lead II

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