flash: add stm32lx loader Hard Fault workaround10/1010/5master
commitd631b2e5aca26e96fb6feed2aceb40632bdfca71
authorSpencer Oliver <spen@spen-soft.co.uk>
Fri, 4 Jan 2013 11:46:00 +0000 (4 11:46 +0000)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 21 Jan 2013 16:46:09 +0000 (21 16:46 +0000)
treeba06485537949fcce361a1a7416e6b6fc2c1a35b
parent6efcd943b28cf904362283226b3f51cf52ce3252
flash: add stm32lx loader Hard Fault workaround

An issue has been seen with the stm32lx flash driver that if a
power cycle/reset is applied after a erase, any ram loader will Hard Fault
on execution.

A similar issue is mentioned in the errata for the device.
Two solution's seem to workaround this issue:
1, Handle the exception, this means adding exception vectors to the loader
   and changing the exception address using nvic vtor register.
2. falling back to using slower direct page writes - approx 50% slower.

Using solution 1 would mean restrictions are placed on the loader location.
Solution 2 was chosen mainly as it was simpler too implement.

Change-Id: I429f06b5a3e3b1d8de90071a88a7df11fc9b46a7
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1010
Tested-by: jenkins
src/flash/nor/stm32lx.c