Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
L515 FW version prerequisites must be defined with min/max range to a…
…void cross-product versions recognition.

This might a temporal solution as eventually FW versions may overlap.
Update L515 minimal downgradeable version to 1.5.1.3 instead of 1.4.xx

Change-Id: I774c934edd6df2339b610f4d4c59f04fa4fdf69b
  • Loading branch information
Evgeni Raikhel committed Jun 8, 2021
commit c41eb6858aa22d5ebaae0c5303b63d4cd6b17edc
11 changes: 7 additions & 4 deletions src/l500/l500-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,11 +696,14 @@ namespace librealsense
{
std::string fw_version = extract_firmware_version_string((const void*)image.data(), image.size());

auto it = ivcam2::device_to_fw_min_version.find(_pid);
if (it == ivcam2::device_to_fw_min_version.end())
throw std::runtime_error("Minimum firmware version has not been defined for this device!");
auto min_max_fw_it = ivcam2::device_to_fw_min_max_version.find(_pid);
if (min_max_fw_it == ivcam2::device_to_fw_min_max_version.end())
throw std::runtime_error("Min and Max firmware versions have not been defined for this device!");

// Limit L515 to FW versions within the 1.5.1.3-1.99.99.99 range to differenciate from the other products
return (firmware_version(fw_version) >= firmware_version(min_max_fw_it->second.first)) &&
(firmware_version(fw_version) <= firmware_version(min_max_fw_it->second.second));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can use [) for ranges here so it's be < rather than <=?
Then you wouldn't have to write numbers like 1.99.99.99...

I also don't like putting the build number in there. It's got nothing to do with the version number.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The max is required to prevent recognizing D400's 5.12.14.50 as a valid candidate for L515.
Since no formal definition is given 1.99..... is the version that will be currently supported.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm saying rather than <= 1.99.99.99 we should say < 2.0


return (firmware_version(fw_version) >= firmware_version(it->second));
}

notification l500_notification_decoder::decode(int value)
Expand Down
16 changes: 8 additions & 8 deletions src/l500/l500-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ namespace librealsense

};

static std::map<uint16_t, std::string> device_to_fw_min_version = {
{ L500_RECOVERY_PID, "1.4.1.0"},
{ L535_RECOVERY_PID, "1.4.1.0"},
{ L500_USB2_RECOVERY_PID_OLD, "1.4.1.0"},
{ L500_PID, "1.4.1.0"},
{ L515_PID_PRE_PRQ, "1.4.1.0"},
{ L515_PID, "1.4.1.0"},
{ L535_PID, "1.4.1.0"}
static std::map<uint16_t, std::pair<std::string, std::string>> device_to_fw_min_max_version = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not a pair of firmware_version... or even char const *?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can consider firmware_version as enhancement separately, I'm not sure whether it improves readability.

{ L500_RECOVERY_PID, { "1.5.1.3", "1.99.99.99"}},
{ L535_RECOVERY_PID, { "1.5.1.3", "1.99.99.99"}},
{ L500_USB2_RECOVERY_PID_OLD, { "1.5.1.3", "1.99.99.99"}},
{ L500_PID, { "1.5.1.3", "1.99.99.99"}},
{ L515_PID_PRE_PRQ, { "1.5.1.3", "1.99.99.99"}},
{ L515_PID, { "1.5.1.3", "1.99.99.99"}},
{ L535_PID, { "1.5.1.3", "1.99.99.99"}}
};

// Known FW error codes, if we poll for errors (RS2_OPTION_ERROR_POLLING_ENABLED)
Expand Down