esp-idf/components/freertos/FreeRTOS-Kernel
Ivan Grokhotkov 5d32e80ea7 freertos: ensure interrupts are disabled before enabling tick timer
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.
2021-12-20 17:25:56 +01:00
..
include/freertos freertos: remove portmacro.h inclusion from task.h 2021-12-13 14:33:37 +05:30
portable freertos: ensure interrupts are disabled before enabling tick timer 2021-12-20 17:25:56 +01:00
croutine.c freertos: update freertos folder structure to match upstream 2021-10-29 12:05:13 +08:00
event_groups.c freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions 2021-11-22 13:28:39 +08:00
GitHub-FreeRTOS-Kernel-Home.url freertos: update freertos folder structure to match upstream 2021-10-29 12:05:13 +08:00
History.txt freertos: update freertos folder structure to match upstream 2021-10-29 12:05:13 +08:00
LICENSE.md freertos: update freertos folder structure to match upstream 2021-10-29 12:05:13 +08:00
list.c freertos: update freertos folder structure to match upstream 2021-10-29 12:05:13 +08:00
queue.c freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions 2021-11-22 13:28:39 +08:00
Quick_Start_Guide.url freertos: update freertos folder structure to match upstream 2021-10-29 12:05:13 +08:00
stream_buffer.c freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions 2021-11-22 13:28:39 +08:00
tasks.c freertos: update module handles to struct type 2021-12-06 08:37:06 +05:30
timers.c freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions 2021-11-22 13:28:39 +08:00