diff options
author | Tarek BOCHKATI <tarek.bouchkati@gmail.com> | 2021-05-11 09:22:01 +0100 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2021-05-20 20:56:48 +0100 |
commit | 936cff887abf116427802c4f07096fca1f2b1d88 (patch) | |
tree | 1ff0d37d9f4f1c6712b79e1ac0b237e04383230c /src/target | |
parent | 3a85fd52b66360a7cc3fa7ee236f31ac4c46daeb (diff) | |
download | riscv-openocd-936cff887abf116427802c4f07096fca1f2b1d88.zip riscv-openocd-936cff887abf116427802c4f07096fca1f2b1d88.tar.gz riscv-openocd-936cff887abf116427802c4f07096fca1f2b1d88.tar.bz2 |
cortex_m: fix VECTRESET detection for ARMv6-M cores
VECTRESET check should be done after verifying if the core is an ARMv6-M core,
and not before that.
Fixes: 2dc9c1df81b6 ("cortex_m: [FIX] ARMv8-M does not support VECTRESET")
Change-Id: I8306affd332b3a35cea69bba39ef24ca71244273
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/6232
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/cortex_m.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 245490c..9f9bc0d 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2040,9 +2040,6 @@ int cortex_m_examine(struct target *target) } LOG_DEBUG("cpuid: 0x%8.8" PRIx32 "", cpuid); - /* VECTRESET is supported only on ARMv7-M cores */ - cortex_m->vectreset_supported = !armv7m->arm.is_armv8m && !armv7m->arm.is_armv6m; - if (core == 4) { target_read_u32(target, MVFR0, &mvfr0); target_read_u32(target, MVFR1, &mvfr1); @@ -2069,6 +2066,9 @@ int cortex_m_examine(struct target *target) armv7m->arm.is_armv6m = true; } + /* VECTRESET is supported only on ARMv7-M cores */ + cortex_m->vectreset_supported = !armv7m->arm.is_armv8m && !armv7m->arm.is_armv6m; + /* Check for FPU, otherwise mark FPU register as non-existent */ if (armv7m->fp_feature == FP_NONE) for (size_t idx = ARMV7M_FPU_FIRST_REG; idx <= ARMV7M_FPU_LAST_REG; idx++) |