Skip to main content
Visitor II
April 18, 2018
Question

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

  • April 18, 2018
  • 2 replies
  • 1163 views

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)

    {}

    

   }

    This topic has been closed for replies.

    2 replies

    Visitor II
    April 19, 2018
    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.

    Visitor II
    May 3, 2018
    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.