]> git.sur5r.net Git - openocd/commit
Fix resume when core state has been modified
authorMatthias Welwarsky <matthias.welwarsky@sysgo.com>
Wed, 29 Jun 2016 13:39:11 +0000 (15:39 +0200)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Tue, 9 Aug 2016 13:28:43 +0000 (14:28 +0100)
commit6f8cf930bc015037e2ad4260c7d360d563644329
treed7566e36158c3a1f762143837c23ff9a9e0cfa62
parent5d5c9bc4ecbc8c601e77c95b40fa09ec48a79aea
Fix resume when core state has been modified

Sometimes it is necessary to resume into a different state (ARM/Thumb)
than at debug state entry. According to the documentation this should
be possible with "arm core_state arm|thumb" before the resume command,
however the original code also restores the original CPSR, which
overrides whatever state the core was set to. This seems to work on some
cores (e.g. Cortex-A5) but not on others (e.g. Cortex-A9). Using the "BX"
instruction to set resume PC and core state works on Cortex-A9 and
ARM11, but is not sufficient on Cortex-A5, where an explicit write to
the PC (MOV pc, r0) is required additionally.

Change-Id: Ic03153b4b250fbb8cf6c75f8e329fb34829aa35f
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3386
Tested-by: jenkins
Reviewed-by: Alexander Stein <alexanders83@web.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
src/target/arm11.c
src/target/arm_dpm.c