Skip to content

Conversation

@nohayassin
Copy link
Contributor

@nohayassin nohayassin commented Dec 16, 2020

When FW update runs, the device disconnects when it switches to DFU.
Exception is thrown when FW update calls query devices while device still connected (not switch to DFU already).
In this fix, after sending the command of switching device to DFU, I checked when device is disconnected then continue to next step of querying devices.

Tracked on DSO-16069

Copy link
Contributor

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SR300 DFU handling should be adjusted as wel, similar to D400 and L515

_hw_monitor->get_gvd(gvd_buff.size(), gvd_buff.data(), ds::GVD);
this_thread::sleep_for(milliseconds(50));
}
throw std::runtime_error("Device still connected!");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reword with "Device failed to switch to DFU within the predefined time"

cmd.param1 = 1;
_hw_monitor->send(cmd);
std::vector<uint8_t> gvd_buff(HW_MONITOR_BUFFER_SIZE);
for (auto i = 0; i < 10; i++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increase iterations count to cover 1000msec
Comment in code as to how the mechanism is expected to work

// Stop all data streaming/exchange pipes with HW
stop_activity();
using namespace std;
using namespace std::chrono;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case use of explicit std::this_thread... std::chrono:millisec(..) is preferred

cmd.param1 = 1;
_hw_monitor->send(cmd);
std::vector<uint8_t> gvd_buff(HW_MONITOR_BUFFER_SIZE);
for (auto i = 0; i < 25; i++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The counter here and for DS5.cpp should probably be synchronized

Copy link
Contributor

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be merged

@ev-mp ev-mp merged commit d7a1a78 into realsenseai:development Mar 24, 2021
Nir-Az added a commit to Nir-Az/librealsense that referenced this pull request Apr 21, 2021
Nir-Az added a commit to Nir-Az/librealsense that referenced this pull request Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants