From 5c2ad91cff7ea1df1e8b4f59287aa83fa7ec1aa5 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Tue, 10 Nov 2020 01:28:22 -0300 Subject: [PATCH] [spinel] print error on RCP reset before dying (#5784) This commit makes ot-daemon print the RCP reset cause before exit, in case the RCP resets unexpectedly. --- src/lib/spinel/radio_spinel_impl.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/spinel/radio_spinel_impl.hpp b/src/lib/spinel/radio_spinel_impl.hpp index b908d97bb..932d0fb5c 100644 --- a/src/lib/spinel/radio_spinel_impl.hpp +++ b/src/lib/spinel/radio_spinel_impl.hpp @@ -770,8 +770,12 @@ void RadioSpinel::HandleValueIs(spinel_prop_k if (status >= SPINEL_STATUS_RESET__BEGIN && status <= SPINEL_STATUS_RESET__END) { - // If RCP crashes/resets while radio was enabled, posix app exits. - VerifyOrDie(!IsEnabled(), OT_EXIT_RADIO_SPINEL_RESET); + if (IsEnabled()) + { + // If RCP crashes/resets while radio was enabled, posix app exits. + otLogCritPlat("Unexpected RCP reset: %s", spinel_status_to_cstr(status)); + DieNow(OT_EXIT_RADIO_SPINEL_RESET); + } otLogInfoPlat("RCP reset: %s", spinel_status_to_cstr(status)); mIsReady = true;