ARM: flash programming algorithm for virtual addresses causes timeout
Information in this knowledgebase article applies to:
I have written a Flash Programming Algorithm for a serial flash. As this flash is not memory mapped, the ProgramPage and EraseSector functions "listen" at a virtual address range, from where they take over the data and write/erase related addresses in the flash. However, when trying to use the algorithm, µVision reports a Flash Timeout, causing the Flash Download in general to fail. Why?
The Flash Programming Algorithms normally work on memory mapped flash. Because of that, BlankCheck and Verify functions can have generic implementations. The manual marks that functions also as "optional". µVision has build-in implementations of them, that basically just read from the memory.
The Flash Timeout happens most likely, when the build-in version of BlankCheck or Verify starts reading form the virtual addresses. Depending on the actual addresses, the device can enter a fault exception, if this is "invalid memory" for it. The algorithm function will so never reach the expected end, causing the timeout.
Implement also the "optional" algorithm functions BlankCheck and Verify. They should also map the virtual addresses to the offsets in the serial flash to work properly.
Last Reviewed: Thursday, September 19, 2019
of your data.