Skip to content

Commit

Permalink
esp32c3: Call rtos post_reset_cleanup method after reset
Browse files Browse the repository at this point in the history
Close #144
  • Loading branch information
erhankur authored and gerekon committed May 31, 2021
1 parent 0d1c876 commit 224860b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/target/esp32c3.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "semihosting_common.h"
#include "riscv/debug_defines.h"
#include "esp32_apptrace.h"
#include "rtos/rtos.h"

#define ESP_RISCV_APPTRACE_SYSNR 0x64

Expand Down Expand Up @@ -284,6 +285,12 @@ static int esp32c3_poll(struct target *target)
} else
LOG_ERROR("Failed to halt core (%d)!", res);
}
/* Clear memory which is used by RTOS layer to get the task count */
if (target->rtos && target->rtos->type->post_reset_cleanup) {
res = (*target->rtos->type->post_reset_cleanup)(target);
if (res != ERROR_OK)
LOG_WARNING("Failed to do rtos-specific cleanup (%d)", res);
}
/* enable ebreaks */
res = esp32c3_core_ebreaks_enable(target);
if (res != ERROR_OK)
Expand Down

0 comments on commit 224860b

Please sign in to comment.