mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 11:44:31 +02:00
Merge branch 'bugfix/panic_dport_no_mutex' into 'master'
Panic: stop dport access handler without trying to use a lock See merge request !1244
This commit is contained in:
@@ -194,6 +194,15 @@ void IRAM_ATTR esp_dport_access_int_pause(void)
|
|||||||
portEXIT_CRITICAL_ISR(&g_dport_mux);
|
portEXIT_CRITICAL_ISR(&g_dport_mux);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Used in panic code: the enter_critical stuff may be messed up so we just stop everything without checking the mux.
|
||||||
|
void IRAM_ATTR esp_dport_access_int_abort(void)
|
||||||
|
{
|
||||||
|
dport_core_state[0] = DPORT_CORE_STATE_IDLE;
|
||||||
|
#ifndef CONFIG_FREERTOS_UNICORE
|
||||||
|
dport_core_state[1] = DPORT_CORE_STATE_IDLE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void IRAM_ATTR esp_dport_access_int_resume(void)
|
void IRAM_ATTR esp_dport_access_int_resume(void)
|
||||||
{
|
{
|
||||||
portENTER_CRITICAL_ISR(&g_dport_mux);
|
portENTER_CRITICAL_ISR(&g_dport_mux);
|
||||||
|
@@ -27,6 +27,10 @@ void esp_dport_access_int_init(void);
|
|||||||
void esp_dport_access_int_pause(void);
|
void esp_dport_access_int_pause(void);
|
||||||
void esp_dport_access_int_resume(void);
|
void esp_dport_access_int_resume(void);
|
||||||
|
|
||||||
|
//This routine does not stop the dport routines in any way that is recoverable. Please
|
||||||
|
//only call in case of panic().
|
||||||
|
void esp_dport_access_int_abort(void);
|
||||||
|
|
||||||
#if defined(BOOTLOADER_BUILD) || defined(CONFIG_FREERTOS_UNICORE) || !defined(ESP_PLATFORM)
|
#if defined(BOOTLOADER_BUILD) || defined(CONFIG_FREERTOS_UNICORE) || !defined(ESP_PLATFORM)
|
||||||
#define DPORT_STALL_OTHER_CPU_START()
|
#define DPORT_STALL_OTHER_CPU_START()
|
||||||
#define DPORT_STALL_OTHER_CPU_END()
|
#define DPORT_STALL_OTHER_CPU_END()
|
||||||
|
@@ -211,7 +211,7 @@ void panicHandler(XtExcFrame *frame)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
haltOtherCore();
|
haltOtherCore();
|
||||||
esp_dport_access_int_pause();
|
esp_dport_access_int_abort();
|
||||||
panicPutStr("Guru Meditation Error: Core ");
|
panicPutStr("Guru Meditation Error: Core ");
|
||||||
panicPutDec(core_id);
|
panicPutDec(core_id);
|
||||||
panicPutStr(" panic'ed (");
|
panicPutStr(" panic'ed (");
|
||||||
@@ -264,7 +264,7 @@ void panicHandler(XtExcFrame *frame)
|
|||||||
void xt_unhandled_exception(XtExcFrame *frame)
|
void xt_unhandled_exception(XtExcFrame *frame)
|
||||||
{
|
{
|
||||||
haltOtherCore();
|
haltOtherCore();
|
||||||
esp_dport_access_int_pause();
|
esp_dport_access_int_abort();
|
||||||
if (!abort_called) {
|
if (!abort_called) {
|
||||||
panicPutStr("Guru Meditation Error of type ");
|
panicPutStr("Guru Meditation Error of type ");
|
||||||
int exccause = frame->exccause;
|
int exccause = frame->exccause;
|
||||||
|
Reference in New Issue
Block a user