From 416895312f635befc91ff43cfe58618edaae47fd Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Wed, 17 May 2023 10:10:39 -0400 Subject: [PATCH] vTaskPrioritySet(NULL, 0) doesn't always fix the issue it was trying to address and could even prevent the current task to be run again. Use a vTaskDelay of 500 ms to address the missing response issue and also make sure the task can execute the device reset. (#26585) --- src/platform/silabs/efr32/ConfigurationManagerImpl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/platform/silabs/efr32/ConfigurationManagerImpl.cpp b/src/platform/silabs/efr32/ConfigurationManagerImpl.cpp index 886a304b2ead17..fc87f438dc6541 100644 --- a/src/platform/silabs/efr32/ConfigurationManagerImpl.cpp +++ b/src/platform/silabs/efr32/ConfigurationManagerImpl.cpp @@ -295,9 +295,8 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) // When called from an RPC, the following reset occurs before the RPC can respond, // which breaks tests (because it looks like the RPC hasn't successfully completed). - // One way to fix this is to reduce the priority of this task, to allow logging to - // complete before the reset occurs. - vTaskPrioritySet(NULL, 0); + // Block the task for 500 ms before the reset occurs to allow RPC response to be sent + vTaskDelay(pdMS_TO_TICKS(500)); NVIC_SystemReset(); }