esp-idf/components/freertos/port/xtensa
Ivan Grokhotkov dc707d5933 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-30 18:00:59 +08:00
..
include/freertos freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions 2021-11-22 18:42:10 +08:00
port.c freertos: ensure interrupts are disabled before enabling tick timer 2021-12-30 18:00:59 +08:00
portasm.S freertos(esp32s3): SysTick uses systimer 2021-08-04 20:33:44 +08:00
readme_xtensa.txt freertos: Add RISC-V port 2020-11-13 07:49:11 +11:00
xt_asm_utils.h freertos: Add RISC-V port 2020-11-13 07:49:11 +11:00
xtensa_context.S freertos: Add RISC-V port 2020-11-13 07:49:11 +11:00
xtensa_init.c freertos: Add RISC-V port 2020-11-13 07:49:11 +11:00
xtensa_loadstore_handler.S freertos: Add RISC-V port 2020-11-13 07:49:11 +11:00
xtensa_overlay_os_hook.c freertos: Add RISC-V port 2020-11-13 07:49:11 +11:00
xtensa_vector_defaults.S components/doc: Update doc about high-level interrupt 2021-09-09 20:40:09 +08:00
xtensa_vectors.S components/bt: High level interrupt in bluetooth 2021-09-09 11:29:06 +08:00