Skip to content

Commit

Permalink
Merge branch 'bugfix/xtensa_startup_stack_v5.3' into 'release/v5.3'
Browse files Browse the repository at this point in the history
fix(system): fixed potential double exception when booting on xtensa (v5.3)

See merge request espressif/esp-idf!33902
  • Loading branch information
ESP-Marius committed Oct 16, 2024
2 parents 5d3399f + 590309a commit dbbdb0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ BaseType_t xPortStartScheduler( void )
}
#endif // configNUM_CORES > 1

// Windows contain references to the startup stack which will be reclaimed by the main task
// Spill the windows to create a clean environment to ensure we do not carry over any such references
// to invalid SPs which will cause problems if main_task does a windowoverflow to them
xthal_window_spill();

// Cannot be directly called from C; never returns
__asm__ volatile ("call0 _frxt_dispatch\n");

Expand Down
5 changes: 5 additions & 0 deletions components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ BaseType_t xPortStartScheduler( void )

port_xSchedulerRunning[xPortGetCoreID()] = 1;

// Windows contain references to the startup stack which will be reclaimed by the main task
// Spill the windows to create a clean environment to ensure we do not carry over any such references
// to invalid SPs which will cause problems if main_task does a windowoverflow to them
xthal_window_spill();

// Cannot be directly called from C; never returns
__asm__ volatile ("call0 _frxt_dispatch\n");

Expand Down

0 comments on commit dbbdb0d

Please sign in to comment.