cortex_m: fix reading of DCB_DSCSR register
commit72131e05e9337f1f950f604f5e07683e887ce3ab
authorBohdan Tymkiv <bohdan200@gmail.com>
Tue, 23 May 2023 11:40:11 +0000 (23 14:40 +0300)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 2 Jun 2023 20:57:49 +0000 (2 20:57 +0000)
tree3b094031ff3f5fe83cce4926263ceee7ae69bd77
parent4a57f3ebb21db6b89b0ceb9df34d32157731ead2
cortex_m: fix reading of DCB_DSCSR register

Value in the 'dscsr' variable is garbage until the DAP queue is run.
Postpone evaluation of the 'secure_state' variable. Reading the
core registers in between will execute the DAP queue.

Change-Id: I44959e882dbafb1b9779e813c3d13f3b3dbcd47f
Signed-off-by: Bohdan Tymkiv <bohdan200@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7693
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/target/cortex_m.c