diff --git a/examples/platform/linux/AppMain.cpp b/examples/platform/linux/AppMain.cpp index 8afd89d23b8098..35f85dc3f016ca 100644 --- a/examples/platform/linux/AppMain.cpp +++ b/examples/platform/linux/AppMain.cpp @@ -315,12 +315,12 @@ void ChipLinuxAppMainLoop() initParams.testEventTriggerDelegate = &testEventTriggerDelegate; #endif + // We need to set DeviceInfoProvider before Server::Init to setup the storage of DeviceInfoProvider properly. + DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); + // Init ZCL Data Model and CHIP App Server Server::GetInstance().Init(initParams); - gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage()); - DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); - // Now that the server has started and we are done with our startup logging, // log our discovery/onboarding information again so it's not lost in the // noise.