STM32H5 EDATA read err
I refer to than Example
en.stm32cubeh5-v1-3-0\STM32Cube_FW_H5_V1.3.0\Projects\NUCLEO-H563ZI\Examples\FLASH\FLASH_EDATA_EraseProgram
Init and Write data in 0x0900C000 is ok.But when I restart the device and read data from 0x0900C000,the program entered NMI_Handler,but if I read from 0x0900C002,It worked.
If I didn't write data in 0x0900C000,I can read data successful.
Is there anying wrong with the config of MPU?
That's the config of MPU
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 = 0x0900C000U;
region.LimitAddress = 0x0900C000U+(8*(FLASH_EDATA_SIZE/16)) - 1;
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);
}
And after run these code:
if(EE_ProgramWord(0x0900C000, PART_USED_MARK) != HAL_OK)
return HAL_ERROR;
EE_ReadWord(0x09010800U);
EE_ReadWord(0x0900C000U);