Skip to content

Commit

Permalink
testing/esp: enable exception tests for esp32p4
Browse files Browse the repository at this point in the history
  • Loading branch information
erhankur committed Feb 5, 2025
1 parent 9753829 commit fdeb57c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
35 changes: 23 additions & 12 deletions src/target/espressif/esp_riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,21 +535,32 @@ int esp_riscv_breakpoint_add(struct target *target, struct breakpoint *breakpoin
struct esp_riscv_common *esp_riscv;

int res = riscv_add_breakpoint(target, breakpoint);
if (res == ERROR_TARGET_RESOURCE_NOT_AVAILABLE && breakpoint->type == BKPT_HARD) {
/* For SMP target return OK if SW flash breakpoint is already set using another
*core; GDB causes call to esp_algo_flash_breakpoint_add() for every core, since it
*treats flash breakpoints as HW ones */
if (target->smp) {
struct target_list *curr;
foreach_smp_target(curr, target->smp_targets) {
esp_riscv = target_to_esp_riscv(curr->target);
if (esp_common_flash_breakpoint_exists(&esp_riscv->esp, breakpoint))
return ERROR_OK;

if (breakpoint->type == BKPT_HARD) {
if (res == ERROR_OK) {
RISCV_INFO(info);
/* manual_hwbp_set is required to be set for all harts.
* Otherwise bps coming from hart1 will not be handled properly during step.
* TODO: Check if needs to be set earlier in the first TDATA1 or TDATA2 modification.
*/
info->manual_hwbp_set = true;
} else if (res == ERROR_TARGET_RESOURCE_NOT_AVAILABLE) {
/* For SMP target return OK if SW flash breakpoint is already set using another
*core; GDB causes call to esp_algo_flash_breakpoint_add() for every core, since it
*treats flash breakpoints as HW ones */
if (target->smp) {
struct target_list *curr;
foreach_smp_target(curr, target->smp_targets) {
esp_riscv = target_to_esp_riscv(curr->target);
if (esp_common_flash_breakpoint_exists(&esp_riscv->esp, breakpoint))
return ERROR_OK;
}
}
esp_riscv = target_to_esp_riscv(target);
return esp_common_flash_breakpoint_add(target, &esp_riscv->esp, breakpoint);
}
esp_riscv = target_to_esp_riscv(target);
return esp_common_flash_breakpoint_add(target, &esp_riscv->esp, breakpoint);
}

return res;
}

Expand Down
1 change: 0 additions & 1 deletion testing/esp/test_special.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def test_wp_reconfigure_by_program(self):
"""
self._do_test_bp_and_wp_set_by_program()

@skip_for_chip(['esp32p4'], 'skipped - OCD-1094')
def test_exception(self):
"""
This test checks that expected exception cause string equal to the OpenOCD output.
Expand Down

0 comments on commit fdeb57c

Please sign in to comment.