STM8AL3188 when performing multiple write block operations the device is freezing.
Posted on April 18, 2018 at 13:13
When performing multiple write block operations the device is freezing. I am unable to recover the device without a manual power off reset. I believe my code is correct. Could this be a driver issue? I am using IAR.
Any help would be appreciated.
Please see my code for this below:
/* Define flash programming Time*/
FLASH_SetProgrammingTime(FLASH_ProgramTime_Standard);
FLASH_Unlock(FLASH_MemType_Program);
/* Wait until Flash Program area unlocked flag is set*/
while (FLASH_GetFlagStatus(FLASH_FLAG_PUL) == RESET)
{}
//inactive_image_first_block
for (block_num=270; block_num <= 507 ; block_num++)
{
FLASH_EraseBlock(block_num, FLASH_MemType_Program);
while (FLASH_GetFlagStatus(FLASH_FLAG_EOP) == RESET)
{}
}
