cancel
Showing results for 
Search instead for 
Did you mean: 

Can't halt the core when i run example from CubeMx 4.23

tan loi
Associate II
Posted on November 10, 2017 at 17:11

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.

2 REPLIES 2
Imen.D
ST Employee
Posted on November 13, 2017 at 17:37

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 this

https://community.st.com/0D50X00009XkXMtSAN

 , it may help you.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on November 13, 2017 at 18:50

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();