diff options
-rw-r--r-- | src/target/cortex_m.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index b6043fcc..d1afbd56 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -1137,6 +1137,10 @@ int cortex_m_set_breakpoint(struct target *target, struct breakpoint *breakpoint breakpoint->set = fp_num + 1; fpcr_value = breakpoint->address | 1; if (cortex_m->fp_rev == 0) { + if (breakpoint->address > 0x1FFFFFFF) { + LOG_ERROR("Cortex-M Flash Patch Breakpoint rev.1 cannot handle HW breakpoint above address 0x1FFFFFFE"); + return ERROR_FAIL; + } uint32_t hilo; hilo = (breakpoint->address & 0x2) ? FPCR_REPLACE_BKPT_HIGH : FPCR_REPLACE_BKPT_LOW; fpcr_value = (fpcr_value & 0x1FFFFFFC) | hilo | 1; |