From d479407339053ac5cf99041f4f97b52de144ce8a Mon Sep 17 00:00:00 2001 From: KonstantinKondrashov Date: Mon, 19 Jun 2023 21:57:02 +0800 Subject: [PATCH] freertos: Fix Systick stuck when systimer was not reset Relates to OTA update for S3/C3 chips from IDF version 4.3 to v5.0 and above --- components/freertos/port/port_systick.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/freertos/port/port_systick.c b/components/freertos/port/port_systick.c index ebc4b3cf79..501f7c04bc 100644 --- a/components/freertos/port/port_systick.c +++ b/components/freertos/port/port_systick.c @@ -86,7 +86,10 @@ void vPortSetupTimer(void) systimer_ll_apply_counter_value(systimer_hal.dev, SYSTIMER_LL_COUNTER_OS_TICK); for (cpuid = 0; cpuid < SOC_CPU_CORES_NUM; cpuid++) { + // Set stall option and alarm mode to default state. Below they will be set to a required state. systimer_hal_counter_can_stall_by_cpu(&systimer_hal, SYSTIMER_LL_COUNTER_OS_TICK, cpuid, false); + uint32_t alarm_id = SYSTIMER_LL_ALARM_OS_TICK_CORE0 + cpuid; + systimer_hal_select_alarm_mode(&systimer_hal, alarm_id, SYSTIMER_ALARM_MODE_ONESHOT); } for (cpuid = 0; cpuid < portNUM_PROCESSORS; ++cpuid) {