Skip to content

Commit

Permalink
[posix] Fix rcp reset flow in ResetRcp.
Browse files Browse the repository at this point in the history
Remove call to `WaitResponse` after calling `HardwareReset` which didn't
trigger any spinel transaction.

`kOpenFileDelay` change form 500 to 50.
  • Loading branch information
canisLupus1313 committed Aug 3, 2023
1 parent 9b0d3db commit e64ad77
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion script/check-arm-build
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ build_nrf52840()

main()
{
export CPPFLAGS="${CPPFLAGS:-} -DNDEBUG"
export CPPFLAGS="${CPPFLAGS-} -DNDEBUG"

if [[ $# == 0 ]]; then
build_nrf52840
Expand Down
2 changes: 1 addition & 1 deletion script/test
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ main()
{
envsetup "$@"

if [[ -z ${1:-} ]]; then
if [[ -z ${1-} ]]; then
print_usage 1
fi

Expand Down
6 changes: 5 additions & 1 deletion src/lib/spinel/radio_spinel_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ template <typename InterfaceType> void RadioSpinel<InterfaceType>::ResetRcp(bool
}

hardwareReset = (mSpinelInterface.HardwareReset() == OT_ERROR_NONE);
SuccessOrExit(WaitResponse(false));

if (hardwareReset)
{
SuccessOrExit(WaitResponse(false));
}

resetDone = true;

Expand Down
2 changes: 1 addition & 1 deletion src/posix/platform/hdlc_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class HdlcInterface : public ot::Spinel::SpinelInterface
{
kMaxWaitTime = 2000, ///< Maximum wait time in Milliseconds for socket to become writable (see `SendFrame`).
kResetTimeout = 5000, ///< Maximum wait time in Milliseconds for file to become ready (see `ResetConnection`).
kOpenFileDelay = 500, ///< Delay between open file calls, in Milliseconds (see `ResetConnection`).
kOpenFileDelay = 50, ///< Delay between open file calls, in Milliseconds (see `ResetConnection`).
kRemoveRcpDelay =
2000, ///< Delay for removing RCP device from host OS after hard reset (see `ResetConnection`).
};
Expand Down

0 comments on commit e64ad77

Please sign in to comment.