target: cortex-m: don't query cache on hla targets

The cache handling code is written and optimized for dap queuing.
On hla targets it causes a segmentation fault due to uninitialized
AP pointer still set to NULL.

While it's possible to modify the code to cope with hla targets,
this would lower the OpenOCD performance on modern adapters.

Make cache handling not available on hla targets.

Reported-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Ief4499caedcee477b9517a7ad4597d06b5cb061e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 04da6e2c62 ("target: cortex-m: add support for armv8m caches")
Reviewed-on: https://review.openocd.org/c/openocd/+/9202
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2025-11-03 11:18:02 +01:00
parent 2bb3e52436
commit ab22b0bf8f

View File

@@ -3007,10 +3007,12 @@ int cortex_m_examine(struct target *target)
cortex_m->fp_num_code,
cortex_m->dwt_num_comp);
retval = armv7m_identify_cache(target);
if (retval != ERROR_OK) {
LOG_ERROR("Cannot detect cache");
return retval;
if (!armv7m->is_hla_target) {
retval = armv7m_identify_cache(target);
if (retval != ERROR_OK) {
LOG_ERROR("Cannot detect cache");
return retval;
}
}
}