mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
dc707d5933
xPortStartScheduler calls vPortSetupTimer -> _frxt_tick_timer_init, which enables tick timer interrupt and sets up the first timeout. From that point on, the interrupt can fire. If the interrupt happens while _frxt_dispatch is running, the scheduler will enter an infinite loop. This is because _frxt_dispatch isn't supposed to be preemptable, and the tick interrupt will overwrite some of the registers used by _frxt_dispatch. Note that this situation doesn't practically occur on the real hardware, where the execution of vPortSetupTimer and _frxt_dispatch happens quickly enough. However it can be reproduced on an emulator if the tick period is set to 1ms. Add an explicit call to portDISABLE_INTERRUPTS in xPortStartScheduler to guarantee that _frxt_dispatch doesn't run with interrupts enabled. This is similar to the esprv_intc_int_set_threshold(1); call in RISC-V version of port.c. |
||
---|---|---|
.. | ||
esp_additions | ||
include | ||
port | ||
test | ||
CMakeLists.txt | ||
component.mk | ||
croutine.c | ||
event_groups.c | ||
freertos_v8_compat.c | ||
FreeRTOS-openocd.c | ||
GitHub-FreeRTOS-Kernel-Home.url | ||
History.txt | ||
Kconfig | ||
LICENSE.md | ||
linker.lf | ||
list.c | ||
queue.c | ||
Quick_Start_Guide.url | ||
sdkconfig.rename | ||
stream_buffer.c | ||
tasks.c | ||
timers.c |