flash/nor/stm32lx: fixed writes at high adapter speeds
authorJimmy <nhminus@gmail.com>
Thu, 23 Apr 2020 10:58:58 +0000 (18:58 +0800)
committerTomas Vanek <vanekt@fbl.cz>
Wed, 3 Nov 2021 20:32:54 +0000 (20:32 +0000)
commit7901cf2124fbaffa85d589b67c580d6ad2e9beb6
treecfc83959ab5352913baee687c847f4ce819dbbb0
parent97db87c22eec204edfebd55973ee1211a1dba6d3
flash/nor/stm32lx: fixed writes at high adapter speeds

The busy flag must be polled after each half-page write.
At low clock speeds, no issue is observed when the poll
is omitted, because the writes complete before the next
write begins. But at high clock speeds the subsequent
writes would overlap and cause the operation to fail.

The status polls are done on the target for efficiency,
since the half-pages are very small.

Change-Id: Ia1e9b4a6a71930549b3d84a902744ce6e596301b
Signed-off-by: Jimmy <nhminus@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/5598
Tested-by: jenkins
Reviewed-by: Jelle De Vleeschouwer
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Andrzej Sierżęga <asier70@gmail.com>
contrib/loaders/flash/stm32/stm32lx.S
contrib/loaders/flash/stm32/stm32lx.inc
src/flash/nor/stm32lx.c