mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
hal/esp32c3: Avoid entering WFI mode under debugger
This commit is contained in:
parent
ec22b4991b
commit
fcad8c7f42
@ -16,6 +16,8 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "soc/soc_caps.h"
|
||||
#include "soc/dport_access.h"
|
||||
#include "soc/system_reg.h"
|
||||
#include "esp_bit_defs.h"
|
||||
#include "soc/assist_debug_reg.h"
|
||||
#include "esp_attr.h"
|
||||
@ -153,6 +155,11 @@ static inline void cpu_ll_set_vecbase(const void* vecbase)
|
||||
|
||||
static inline void cpu_ll_waiti(void)
|
||||
{
|
||||
if (cpu_ll_is_debugger_attached() && DPORT_REG_GET_BIT(SYSTEM_CPU_PER_CONF_REG, SYSTEM_CPU_WAIT_MODE_FORCE_ON) == 0) {
|
||||
/* when SYSTEM_CPU_WAIT_MODE_FORCE_ON is disabled in WFI mode SBA access to memory does not work for debugger,
|
||||
so do not enter that mode when debugger is connected */
|
||||
return;
|
||||
}
|
||||
asm volatile ("wfi\n");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user