diff --git a/src/lib/spinel/radio_spinel_impl.hpp b/src/lib/spinel/radio_spinel_impl.hpp index 4d4fa06c5..c97130564 100644 --- a/src/lib/spinel/radio_spinel_impl.hpp +++ b/src/lib/spinel/radio_spinel_impl.hpp @@ -2143,9 +2143,11 @@ template void RadioSpinel::RestoreProper if (mInstance != nullptr) { - SuccessOrDie(static_cast(mInstance)->template Get().Read(networkInfo)); - SuccessOrDie( - Set(SPINEL_PROP_RCP_MAC_FRAME_COUNTER, SPINEL_DATATYPE_UINT32_S, networkInfo.GetMacFrameCounter())); + if (static_cast(mInstance)->template Get().Read(networkInfo) == OT_ERROR_NONE) + { + SuccessOrDie( + Set(SPINEL_PROP_RCP_MAC_FRAME_COUNTER, SPINEL_DATATYPE_UINT32_S, networkInfo.GetMacFrameCounter())); + } } for (int i = 0; i < mSrcMatchShortEntryCount; ++i) diff --git a/tests/scripts/expect/posix-rcp-restoration.exp b/tests/scripts/expect/posix-rcp-restoration.exp index d745474cc..4b174c6c6 100755 --- a/tests/scripts/expect/posix-rcp-restoration.exp +++ b/tests/scripts/expect/posix-rcp-restoration.exp @@ -54,17 +54,6 @@ puts "RCP PID: $rcp_pid" try { puts "Before enabling" - spawn_node 1 "rcp" "spinel+hdlc_uart://$host_pty" - - exec kill $rcp_pid - puts "Killed $rcp_pid" - sleep 1 - set rcp_pid [exec $::env(OT_SIMULATION_APPS)/ncp/ot-rcp 1 < $radio_pty > $radio_pty &] - puts "RCP PID: $rcp_pid" - - expect eof - - puts "Queued parent-to-child packets, as parent" spawn_node 1 "rcp" "spinel+hdlc_uart://$host_pty"