2017-12-20 09:20 AM
Hello all.
HAL uses function 'FLASH_WaitForLastOperation' for polling flash 'BUSY' flag, while performing flash page erase or flash write. How can this function be executed from flash if flash bus is blocked during flash erase? Is CPU simply staying in stalled state instead of polling BUSY flag while a page is being erased? Is it a bug in HAL or an intentional trick?
#waiting-for-page-write/erase-completionSolved! Go to Solution.
2017-12-20 11:07 AM
Not sure I'd class this as a bug. You get to choose how to use the library, ramifications of the FLASH stalling are systemic and not simply addressed by tagging one function.
2017-12-20 09:26 AM
It simply stalls, ie stuffs wait states. If you don't want the code to stall, you need to move the code and all its dependencies, vector tables, etc into RAM.
2017-12-20 09:57 AM
So, do I understand correctly that the use of '
FLASH_WaitForLastOperation' without moving it to RAM (e.g. using __ramfunc attribute if in iAR) is a bug?
2017-12-20 11:07 AM
Not sure I'd class this as a bug. You get to choose how to use the library, ramifications of the FLASH stalling are systemic and not simply addressed by tagging one function.