mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-02 01:50:58 +02:00
fix(esp_system): clear cache error interrupt in panic handler
This commit is contained in:
committed by
Alexey Lapshin
parent
73edc2903b
commit
fab0bb1056
@@ -88,6 +88,8 @@ uint32_t panic_get_cause(const void* frame);
|
|||||||
|
|
||||||
void panic_prepare_frame_from_ctx(void* frame);
|
void panic_prepare_frame_from_ctx(void* frame);
|
||||||
|
|
||||||
|
void panic_clear_active_interrupts(const void* frame);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -391,6 +391,9 @@ void esp_panic_handler(panic_info_t *info)
|
|||||||
PANIC_INFO_DUMP(info, state);
|
PANIC_INFO_DUMP(info, state);
|
||||||
panic_print_str("\r\n");
|
panic_print_str("\r\n");
|
||||||
|
|
||||||
|
// Now, after all panic info was printed we can clear active interrupts
|
||||||
|
panic_clear_active_interrupts(info->frame);
|
||||||
|
|
||||||
/* No matter if we come here from abort or an exception, this variable must be reset.
|
/* No matter if we come here from abort or an exception, this variable must be reset.
|
||||||
* Else, any exception/error occurring during the current panic handler would considered
|
* Else, any exception/error occurring during the current panic handler would considered
|
||||||
* an abort. Do this after PANIC_INFO_DUMP(info, state) as it also checks this variable.
|
* an abort. Do this after PANIC_INFO_DUMP(info, state) as it also checks this variable.
|
||||||
|
@@ -374,3 +374,10 @@ void panic_prepare_frame_from_ctx(void* frame)
|
|||||||
|
|
||||||
((RvExcFrame *)frame)->mhartid = RV_READ_CSR(mhartid);
|
((RvExcFrame *)frame)->mhartid = RV_READ_CSR(mhartid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void panic_clear_active_interrupts(const void *frame)
|
||||||
|
{
|
||||||
|
if (((RvExcFrame *)frame)->mcause == ETS_CACHEERR_INUM) {
|
||||||
|
esp_cache_err_clear_active_err();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -343,3 +343,9 @@ void panic_prepare_frame_from_ctx(void* frame)
|
|||||||
/* Nothing to cleanup on xtensa */
|
/* Nothing to cleanup on xtensa */
|
||||||
(void)frame;
|
(void)frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void panic_clear_active_interrupts(const void *frame)
|
||||||
|
{
|
||||||
|
/* Nothing to cleanup on xtensa */
|
||||||
|
(void)frame;
|
||||||
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -58,6 +58,12 @@ void esp_cache_err_get_panic_info(esp_cache_err_info_t *err_info);
|
|||||||
*/
|
*/
|
||||||
bool esp_cache_err_has_active_err(void);
|
bool esp_cache_err_has_active_err(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear any cache errors interrupt
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void esp_cache_err_clear_active_err(void);
|
||||||
|
|
||||||
#if SOC_CACHE_ACS_INVALID_STATE_ON_PANIC
|
#if SOC_CACHE_ACS_INVALID_STATE_ON_PANIC
|
||||||
/**
|
/**
|
||||||
* @brief Saves and clears active access errors
|
* @brief Saves and clears active access errors
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -134,6 +134,12 @@ bool esp_cache_err_has_active_err(void)
|
|||||||
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK) || cache_ll_l1_get_illegal_error_intr_status(0, CACHE_LL_L1_ILG_EVENT_MASK);
|
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK) || cache_ll_l1_get_illegal_error_intr_status(0, CACHE_LL_L1_ILG_EVENT_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_cache_err_clear_active_err(void)
|
||||||
|
{
|
||||||
|
cache_ll_l1_clear_access_error_intr(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
|
cache_ll_l1_clear_illegal_error_intr(0, CACHE_LL_L1_ILG_EVENT_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
void esp_cache_err_int_init(void)
|
void esp_cache_err_int_init(void)
|
||||||
{
|
{
|
||||||
const uint32_t core_id = 0;
|
const uint32_t core_id = 0;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -134,6 +134,12 @@ bool esp_cache_err_has_active_err(void)
|
|||||||
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK) || cache_ll_l1_get_illegal_error_intr_status(0, CACHE_LL_L1_ILG_EVENT_MASK);
|
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK) || cache_ll_l1_get_illegal_error_intr_status(0, CACHE_LL_L1_ILG_EVENT_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_cache_err_clear_active_err(void)
|
||||||
|
{
|
||||||
|
cache_ll_l1_clear_access_error_intr(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
|
cache_ll_l1_clear_illegal_error_intr(0, CACHE_LL_L1_ILG_EVENT_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
void esp_cache_err_int_init(void)
|
void esp_cache_err_int_init(void)
|
||||||
{
|
{
|
||||||
const uint32_t core_id = 0;
|
const uint32_t core_id = 0;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -40,6 +40,11 @@ bool esp_cache_err_has_active_err(void)
|
|||||||
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_cache_err_clear_active_err(void)
|
||||||
|
{
|
||||||
|
cache_ll_l1_clear_access_error_intr(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
void esp_cache_err_int_init(void)
|
void esp_cache_err_int_init(void)
|
||||||
{
|
{
|
||||||
const uint32_t core_id = 0;
|
const uint32_t core_id = 0;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -39,6 +39,11 @@ bool esp_cache_err_has_active_err(void)
|
|||||||
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_cache_err_clear_active_err(void)
|
||||||
|
{
|
||||||
|
cache_ll_l1_clear_access_error_intr(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
void esp_cache_err_int_init(void)
|
void esp_cache_err_int_init(void)
|
||||||
{
|
{
|
||||||
const uint32_t core_id = 0;
|
const uint32_t core_id = 0;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -39,6 +39,11 @@ bool esp_cache_err_has_active_err(void)
|
|||||||
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_cache_err_clear_active_err(void)
|
||||||
|
{
|
||||||
|
cache_ll_l1_clear_access_error_intr(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
void esp_cache_err_int_init(void)
|
void esp_cache_err_int_init(void)
|
||||||
{
|
{
|
||||||
const uint32_t core_id = 0;
|
const uint32_t core_id = 0;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -39,6 +39,11 @@ bool esp_cache_err_has_active_err(void)
|
|||||||
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_cache_err_clear_active_err(void)
|
||||||
|
{
|
||||||
|
cache_ll_l1_clear_access_error_intr(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
void esp_cache_err_int_init(void)
|
void esp_cache_err_int_init(void)
|
||||||
{
|
{
|
||||||
const uint32_t core_id = 0;
|
const uint32_t core_id = 0;
|
||||||
|
@@ -39,6 +39,11 @@ bool esp_cache_err_has_active_err(void)
|
|||||||
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_cache_err_clear_active_err(void)
|
||||||
|
{
|
||||||
|
cache_ll_l1_clear_access_error_intr(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
void esp_cache_err_int_init(void)
|
void esp_cache_err_int_init(void)
|
||||||
{
|
{
|
||||||
const uint32_t core_id = 0;
|
const uint32_t core_id = 0;
|
||||||
|
@@ -39,6 +39,11 @@ bool esp_cache_err_has_active_err(void)
|
|||||||
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
return cache_ll_l1_get_access_error_intr_status(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_cache_err_clear_active_err(void)
|
||||||
|
{
|
||||||
|
cache_ll_l1_clear_access_error_intr(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
void esp_cache_err_int_init(void)
|
void esp_cache_err_int_init(void)
|
||||||
{
|
{
|
||||||
const uint32_t core_id = 0;
|
const uint32_t core_id = 0;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -41,6 +41,12 @@ bool esp_cache_err_has_active_err(void)
|
|||||||
return has_active_err;
|
return has_active_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_cache_err_clear_active_err(void)
|
||||||
|
{
|
||||||
|
cache_ll_l1_clear_access_error_intr(0, CACHE_LL_L1_ACCESS_EVENT_MASK);
|
||||||
|
cache_ll_l2_clear_access_error_intr(0, CACHE_LL_L2_ACCESS_EVENT_MASK);
|
||||||
|
}
|
||||||
|
|
||||||
void esp_cache_err_int_init(void)
|
void esp_cache_err_int_init(void)
|
||||||
{
|
{
|
||||||
const uint32_t core_id = 0;
|
const uint32_t core_id = 0;
|
||||||
|
Reference in New Issue
Block a user