Skip to main content
tan loi
Associate II
Nov 10, 2017 4:11 PM UTC
Question

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

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.

    This topic has been closed for replies.

    2 replies

    ST Technical Moderator
    Nov 13, 2017 4:37 PM UTC
    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

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    tan loi
    tan loiAuthor
    Associate II
    Nov 13, 2017 6:50 PM UTC
    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();