2018-04-18 04:13 AM
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)
{}
}
2018-04-19 07:27 AM
'
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.
2018-05-03 05:43 AM
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.