Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FW update exception fix #8018

Merged
merged 4 commits into from Mar 24, 2021
Merged

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
Collaborator

@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
Collaborator

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"


try {
LOG_INFO("entering to update state, device disconnect is expected");
command cmd(ds::DFU);
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
Collaborator

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

@@ -435,12 +435,26 @@ namespace librealsense
{
// Stop all data streaming/exchange pipes with HW
stop_activity();
using namespace std;
using namespace std::chrono;
Copy link
Collaborator

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


try {
LOG_INFO("entering to update state, device disconnect is expected");
command cmd(ivcam2::DFU);
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
Collaborator

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
Collaborator

@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 IntelRealSense:development Mar 24, 2021
Nir-Az added a commit to Nir-Az/librealsense that referenced this pull request Apr 21, 2021
…069"

This reverts commit d7a1a78, reversing
changes made to 011d869.
Nir-Az added a commit to Nir-Az/librealsense that referenced this pull request Apr 22, 2021
…069"

This reverts commit d7a1a78, reversing
changes made to 011d869.
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.

None yet

2 participants