Skip to content

Commit

Permalink
Reduce priority of factory reset task (#25598)
Browse files Browse the repository at this point in the history
Since the task priorities were adjusted for #24099
(and maybe even before?) the factory reset RPC would
time out, breaking any test which relies on the RPC
successfully completing.

This is because the reset is happening immediately,
before whatever is handling the RPC can complete.

Reducing the FreeRTOS task priority just before the
reset "fixes" it. (Maybe there's a better fix?)

Tested on Mighty Gecko SiLabs board.
  • Loading branch information
mlepage-google authored and pull[bot] committed Nov 13, 2023
1 parent 18255b3 commit 1070680
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/platform/silabs/efr32/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)

// Restart the system.
ChipLogProgress(DeviceLayer, "System restarting");

// 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);

NVIC_SystemReset();
}

Expand Down

0 comments on commit 1070680

Please sign in to comment.