Skip to content

Commit c2acddd

Browse files
committed
Merge branch 'fix/sysview_stack_overflow' into 'master'
fix(sysview): reduce isr stack usage to avoid stack guard exception Closes IDF-11338 See merge request espressif/esp-idf!34604
2 parents a71eb45 + d1e5fd0 commit c2acddd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

components/app_trace/sys_view/Sample/FreeRTOSV10.4/Config/esp/SEGGER_SYSVIEW_Config_FreeRTOS.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* SPDX-License-Identifier: BSD-1-Clause
55
*
6-
* SPDX-FileContributor: 2017-2022 Espressif Systems (Shanghai) CO LTD
6+
* SPDX-FileContributor: 2017-2024 Espressif Systems (Shanghai) CO LTD
77
*/
88
/*********************************************************************
99
* SEGGER Microcontroller GmbH *
@@ -58,6 +58,7 @@ File : SEGGER_SYSVIEW_Config_FreeRTOS.c
5858
Purpose : Sample setup configuration of SystemView with FreeRTOS.
5959
Revision: $Rev: 7745 $
6060
*/
61+
#include <string.h>
6162
#include "sdkconfig.h"
6263
#include "freertos/FreeRTOS.h"
6364
#include "SEGGER_SYSVIEW.h"
@@ -156,15 +157,16 @@ static esp_apptrace_lock_t s_sys_view_lock = {.mux = portMUX_INITIALIZER_UNLOCKE
156157
* Sends SystemView description strings.
157158
*/
158159
static void _cbSendSystemDesc(void) {
159-
char irq_str[32];
160+
char irq_str[32] = "I#";
160161
SEGGER_SYSVIEW_SendSysDesc("N="SYSVIEW_APP_NAME",D="SYSVIEW_DEVICE_NAME",C="SYSVIEW_CORE_NAME",O=FreeRTOS");
161-
snprintf(irq_str, sizeof(irq_str), "I#%d=SysTick", SYSTICK_INTR_ID);
162+
strcat(itoa(SYSTICK_INTR_ID, irq_str + 2, 10), "=SysTick");
162163
SEGGER_SYSVIEW_SendSysDesc(irq_str);
163164
size_t isr_count = sizeof(esp_isr_names)/sizeof(esp_isr_names[0]);
164165
for (size_t i = 0; i < isr_count; ++i) {
165166
if (esp_isr_names[i] == NULL || (ETS_INTERNAL_INTR_SOURCE_OFF + i) == SYSTICK_INTR_ID)
166167
continue;
167-
snprintf(irq_str, sizeof(irq_str), "I#%d=%s", ETS_INTERNAL_INTR_SOURCE_OFF + i, esp_isr_names[i]);
168+
strcat(itoa(ETS_INTERNAL_INTR_SOURCE_OFF + i, irq_str + 2, 10), "=");
169+
strncat(irq_str, esp_isr_names[i], sizeof(irq_str) - strlen(irq_str) - 1);
168170
SEGGER_SYSVIEW_SendSysDesc(irq_str);
169171
}
170172
}

0 commit comments

Comments
 (0)