Преглед изворни кода

freertos: Fix Systick stuck when systimer was not reset

Relates to OTA update for C3 chips from IDF version 4.3 to v5.0 and above
KonstantinKondrashov пре 2 година
родитељ
комит
42fa005bf7
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      components/freertos/port_systick.c

+ 3 - 0
components/freertos/port_systick.c

@@ -78,7 +78,10 @@ void vSystimerSetup(void)
         systimer_ll_apply_counter_value(systimer_hal.dev, SYSTIMER_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_COUNTER_OS_TICK, cpuid, false);
+            uint32_t alarm_id = SYSTIMER_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) {