Skip to content

Commit 794cf2e

Browse files
committed
Merge branch 'bugfix/xtensa_startup_stack' into 'master'
fix(system): fixed potential double exception when booting on xtensa Closes IDFGH-13515 See merge request espressif/esp-idf!33190
2 parents e770372 + 4bf8d49 commit 794cf2e

File tree

2 files changed

+10
-0
lines changed
  • components/freertos
    • FreeRTOS-Kernel-SMP/portable/xtensa
    • FreeRTOS-Kernel/portable/xtensa

2 files changed

+10
-0
lines changed

components/freertos/FreeRTOS-Kernel-SMP/portable/xtensa/port.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ BaseType_t xPortStartScheduler( void )
348348
}
349349
#endif // configNUM_CORES > 1
350350

351+
// Windows contain references to the startup stack which will be reclaimed by the main task
352+
// Spill the windows to create a clean environment to ensure we do not carry over any such references
353+
// to invalid SPs which will cause problems if main_task does a windowoverflow to them
354+
xthal_window_spill();
355+
351356
// Cannot be directly called from C; never returns
352357
__asm__ volatile ("call0 _frxt_dispatch\n");
353358

components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ BaseType_t xPortStartScheduler( void )
108108

109109
port_xSchedulerRunning[xPortGetCoreID()] = 1;
110110

111+
// Windows contain references to the startup stack which will be reclaimed by the main task
112+
// Spill the windows to create a clean environment to ensure we do not carry over any such references
113+
// to invalid SPs which will cause problems if main_task does a windowoverflow to them
114+
xthal_window_spill();
115+
111116
// Cannot be directly called from C; never returns
112117
__asm__ volatile ("call0 _frxt_dispatch\n");
113118

0 commit comments

Comments
 (0)