2025-02-11
8:20 AM
- last edited on
2025-02-11
8:27 AM
by
Lina_DABASINSKA
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?
2025-02-11 9:48 AM
Hi @MVanb.1
This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.
Regards,
Billy
2025-04-23 6:01 AM
Hi,
Could you please share the method to read data from the high-cycle flash ?
Regards
Greg
2025-05-12 11:25 AM
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
2025-05-12 12:11 PM
Dear @mahirmahota ,
You can look to our example here :
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(®ion);
/* 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.
Hope it is helping.
STOne-32.