cancel
Showing results for 
Search instead for 
Did you mean: 

STM8AL3188 when performing multiple write block operations the device is freezing.

Steven Shenker
Associate

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)

    {}

    

   }

2 REPLIES 2
henry.dick
Senior II
Posted on April 19, 2018 at 16:27

'

I believe my code is correct. '

It would be a wonderful world if code works just because we believe in it.

'Could this be a driver issue?'

Possible but not probable.

When reality collides with your beliefs, it is a better strategy to check and recheck your beliefs.

Steven Shenker
Associate
Posted on May 03, 2018 at 14:43

To anyone else who has this problem, it was solved by dropping the clock frequency. Nothing about a requirement to do this in the datasheets however.