esp32: fix cache error interrupt handler

Cache error interrupt would read DPORT registers, which caused DPORT
access protection to kick in. Disable DPORT protection before doing the
reads.
This commit is contained in:
Ivan Grokhotkov 2017-09-08 01:29:37 +08:00
parent 3c470e7c43
commit 33cb16fd2a
2 changed files with 4 additions and 2 deletions

View File

@ -29,6 +29,7 @@
#include "esp_attr.h"
#include "soc/dport_reg.h"
#include "sdkconfig.h"
#include "esp_dport_access.h"
void esp_cache_err_int_init()
{
@ -72,6 +73,7 @@ void esp_cache_err_int_init()
int IRAM_ATTR esp_cache_err_get_cpuid()
{
esp_dport_access_int_pause();
const uint32_t pro_mask =
DPORT_PRO_CPU_DISABLED_CACHE_IA_DRAM1 |
DPORT_PRO_CPU_DISABLED_CACHE_IA_DROM0 |

View File

@ -184,7 +184,7 @@ void esp_dport_access_int_init(void)
assert(res == pdTRUE);
}
void esp_dport_access_int_pause(void)
void IRAM_ATTR esp_dport_access_int_pause(void)
{
portENTER_CRITICAL_ISR(&g_dport_mux);
dport_core_state[0] = DPORT_CORE_STATE_IDLE;
@ -194,7 +194,7 @@ void esp_dport_access_int_pause(void)
portEXIT_CRITICAL_ISR(&g_dport_mux);
}
void esp_dport_access_int_resume(void)
void IRAM_ATTR esp_dport_access_int_resume(void)
{
portENTER_CRITICAL_ISR(&g_dport_mux);
dport_core_state[0] = DPORT_CORE_STATE_RUNNING;