target/cortex_m: prevent asserting reset if examine is deferred
commit38616990744b2bac7026f0d41da9247b42494379
authorTomas Vanek <vanekt@fbl.cz>
Sun, 21 Jan 2024 09:15:07 +0000 (21 10:15 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 11 Feb 2024 23:02:09 +0000 (11 23:02 +0000)
tree067e11be71ddc77ceab0fb40a7b6eb459a4bc6f6
parent0d3d4c981ac77b600ce95c9ea6f1cdb280127342
target/cortex_m: prevent asserting reset if examine is deferred

In a corner case when debug_ap is not available,
cortex_m_assert_reset() asserts reset to restore
communication with the target.

Prevent to do so on targets with defer_examine,
as such targets need some special handling to enable them
after reset anyway.

The change makes possible to handle a multicore Cortex-M SoC with
an auxiliary Cortex-M core(s) switched of by default
even with 'reset_config srst_gates_jtag'

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