Skip to main content
Visitor II
February 11, 2025
Question

STM32H5 high cycle flash read.

  • February 11, 2025
  • 3 replies
  • 927 views

What is the correct way to read high cycle flash data.
When i read address 0x916800 i get a Hard fault. Clearing and writing the this address works fine.
With reading i have a problem. bank 2 has EDATA enabled for the last 2 pages.

Can you give me a code example for reading the memory correctly?

    This topic has been closed for replies.

    3 replies

    ST Employee
    February 11, 2025

    Hi @MVanb.1 

     

    This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

     

    Regards,

    Billy

    Visitor II
    April 23, 2025

    Hi,

    Could you please share the method to read data from the high-cycle flash ?
    Regards

    Greg

    Graduate
    May 12, 2025

    Hi! Did you end up getting a solution for this? I'm also trying to get high cycle flash up and running for an H5

    Technical Moderator
    May 12, 2025

    Dear @mahirmahota ,

    You can look to our example here :

    STM32CubeH5/Projects/NUCLEO-H563ZI/Examples/FLASH/FLASH_EDATA_EraseProgram/Src/main.c at main · STMicroelectronics/STM32CubeH5 · GitHub

    You need to configure the MPU region with right address of EDATA 

     

    /* MPU Configuration--------------------------------------------------------*/
    /* By default, all the AHB memory range is cacheable. For regions where caching is not
    practical (High-cycle data area), MPU has to be used to disable local cacheability.
    */

    like this :

    static void MPU_Config(void)
    {
    MPU_Attributes_InitTypeDef attr;
    MPU_Region_InitTypeDef region;

    /* Disable MPU before perloading and config update */
    HAL_MPU_Disable();

    /* Define cacheable memory via MPU */
    attr.Number = MPU_ATTRIBUTES_NUMBER0;
    attr.Attributes = 0 ;
    HAL_MPU_ConfigMemoryAttributes(&attr);

    /* BaseAddress-LimitAddress configuration */
    region.Enable = MPU_REGION_ENABLE;
    region.Number = MPU_REGION_NUMBER0;
    region.AttributesIndex = MPU_ATTRIBUTES_NUMBER0;
    region.BaseAddress = EDATA_USER_START_ADDR;
    region.LimitAddress = EDATA_USER_END_ADDR;
    region.AccessPermission = MPU_REGION_ALL_RW;
    region.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
    region.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
    HAL_MPU_ConfigRegion(&region);

    /* Enable the MPU */
    HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
    }

    Also, have a look on our Reference Manual on the way, we read these Areas : OTP, RO and High Cycle Data - EDATA.

     

    STOne32_0-1747076864777.png

    Hope it is helping.

    STOne-32.