2017-11-10 08:11 AM
When i try to run example 'FLASH_EraseProgram' in CubeMx 4.23 version. When i debug , this message 'Can't halt the core' is show. How can i fix this problem.
2017-11-13 08:37 AM
Hello,
Could you please provide more details about your case, the tools, the hardware that you are using and your setting project option , so that it will be easier to understand the issue?
Have a look to thishttps://community.st.com/0D50X00009XkXMtSAN
, it may help you.Best Regards
Imen
2017-11-13 10:50 AM
Thanks for your answer. I try to fixed error 'can't halt the core' by replace
'FLASH_EraseProgram' with
HAL_FLASHEx_Erase. B
ut when i run this code .I get error 'cannot access memory'. How to fix this problem.Thanks in advance your
answer !!!
Here my code :
EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;
EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;
EraseInitStruct.Sector = GetSector(ADDR_FLASH_SECTOR_10);
EraseInitStruct.NbSectors = 1;
HAL_Delay(1000);
HAL_FLASH_Unlock();
if(HAL_FLASHEx_Erase(&EraseInitStruct,&SectorError)==HAL_OK)
{
HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE,ADDR_FLASH_SECTOR_10,0x96);
}
HAL_FLASH_Lock();
d=*(__IO uint8_t *)ADDR_FLASH_SECTOR_10;
HAL_Delay(6000);
HAL_FLASH_Unlock();
if(HAL_FLASHEx_Erase(&EraseInitStruct,&SectorError)==HAL_OK)
{
HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE,ADDR_FLASH_SECTOR_10,0x88);
}
d=*(__IO uint8_t *)ADDR_FLASH_SECTOR_10;
HAL_FLASH_Lock();