esp32c3: Do not enable memory protection under debugger

This commit is contained in:
Alexey Gerenkov
2021-04-21 23:56:20 +03:00
parent fcad8c7f42
commit 792461aa99

View File

@@ -28,6 +28,8 @@
#include "esp32c3/rom/ets_sys.h"
#include "esp_log.h"
#include "soc/cpu.h"
extern int _iram_text_end;
static const char *TAG = "memprot";
@@ -532,6 +534,11 @@ void esp_memprot_set_prot_int(bool invoke_panic_handler, bool lock_feature, void
esp_memprot_set_monitor_en(MEMPROT_DRAM0_SRAM, false);
}
// do not enable if being debugged
if (esp_cpu_in_ocd_debug_mode()) {
return;
}
//panic handling
if (invoke_panic_handler) {
if (use_iram0) {