-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 check for recovery mode #9683
FW check for recovery mode #9683
Conversation
(cherry picked from commit 5820283)
…eleasing resources
src/ds5/ds5-fw-update-device.cpp
Outdated
auto device_pid = _usb_device->get_info().pid; | ||
auto it = ds::device_to_fw_min_version.find(_usb_device->get_info().pid); | ||
if (it == ds::device_to_fw_min_version.end()) | ||
throw std::runtime_error(to_string() << "Min and Max firmware versions have not been defined for this device: " << device_pid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Print the device ID as "0xABCD" hex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -9,18 +9,15 @@ | |||
|
|||
namespace librealsense | |||
{ | |||
class updatable | |||
class fw_checkable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls rename to firmware_image_check
or similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to "firmware_check_interface"
virtual bool check_fw_compatibility(const std::vector<uint8_t>& image) const = 0; | ||
std::string extract_firmware_version_string(const void* fw_image, size_t fw_image_size) const | ||
static std::string extract_firmware_version_string(const void* fw_image, size_t fw_image_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can pass it in as a vector<uint8_t> vector
instead of C-types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/ivcam/sr300-fw-update-device.cpp
Outdated
|
||
// advanced SR3XX devices do not fit the "old" fw versions and | ||
// legacy SR3XX devices do not fit the "new" fw versions | ||
return (firmware_version(fw_version) >= firmware_version(min_max_fw_it->second.first)) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case the condition doesn't hold - print to log the version number extracted from the FW image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
…alsense into firmware_update_recovery_17448
fe7cbc3
to
bf3febf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes + max value for SR300 to be verified
bool result = (firmware_version(fw_version) >= firmware_version(min_max_fw_it->second.first)) && | ||
(firmware_version(fw_version) <= firmware_version(min_max_fw_it->second.second)); | ||
if (!result) | ||
LOG_ERROR(fw_version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls elaborate the error details
(firmware_version(fw_version) <= firmware_version(min_max_fw_it->second.second)); | ||
if (!result) | ||
LOG_ERROR(fw_version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well
{ SR306_PID, {"3.28.3.0", "99.99.99.99"}}, | ||
{ SR306_PID_DBG, {"3.28.3.0", "99.99.99.99"}}, | ||
{ SR300_RECOVERY, {"3.21.0.0", "99.99.99.99"}} | ||
{ SR300v2_PID, {"3.27.0.0", "4.99.99.99"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be 3.xx, not 4
@@ -4,6 +4,7 @@ | |||
#include "l500-fw-update-device.h" | |||
#include "l500-private.h" | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unintended change, pls drop
added a FW check when the device is in recovery mode
Edit: added a heuristic FW size check to sr3xxx when updating in recovery mode.
Tested on: D435i, D405, L515, SR300.
Tracked on: DSO-17448