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

Bundle FW added for D555 #13556

Draft
wants to merge 3 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 16 additions & 0 deletions common/fw-update-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

#ifdef INTERNAL_FW
#include "common/fw/D4XX_FW_Image.h"
#include "common/fw/D555_FW_Image.h"
#else
#define FW_D4XX_FW_IMAGE_VERSION ""
#define FW_D555_FW_IMAGE_VERSION ""
const char* fw_get_D4XX_FW_Image(int) { return NULL; }
const char* fw_get_D555_FW_Image(int) { return NULL; }


#endif // INTERNAL_FW
Expand All @@ -47,12 +50,14 @@ namespace rs2
int parse_product_line(const std::string& product_line)
{
if (product_line == "D400") return RS2_PRODUCT_LINE_D400;
else if (product_line == "D500") return RS2_PRODUCT_LINE_D500;
else return -1;
}

std::string get_available_firmware_version(int product_line, const std::string& pid)
{
if (product_line == RS2_PRODUCT_LINE_D400) return FW_D4XX_FW_IMAGE_VERSION;
else if (pid == "0B56" || pid == "DDS") return FW_D555_FW_IMAGE_VERSION;
else return "";
}

Expand All @@ -73,6 +78,17 @@ namespace rs2
}
}
break;
case RS2_PRODUCT_LINE_D500:
{
bool allow_rc_firmware = config_file::instance().get_or_default(configurations::update::allow_rc_firmware, false);
if (strlen(FW_D555_FW_IMAGE_VERSION) && !allow_rc_firmware)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will we be able to distinguish other D500 devices?

{
int size = 0;
auto hex = fw_get_D555_FW_Image(size);
image = std::vector< uint8_t >(hex, hex + size);
}
}
break;
default:
break;
}
Expand Down
7 changes: 7 additions & 0 deletions common/fw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ set(D4XX_FW_VERSION ${CMAKE_MATCH_1})
set(D4XX_FW_SHA1 51e37fd01132c500bb4e4af408a41f42391289a5)
set(D4XX_FW_URL "${REALSENSE_FIRMWARE_URL}/Releases/RS4xx/FW")

string(REGEX MATCH "D555_RECOMMENDED_FIRMWARE_VERSION \"([0-9]+.[0-9]+.[0-9]+.[0-9]+)\"" _ ${ver})
set(D555_FW_VERSION ${CMAKE_MATCH_1})
#message(STATUS "D555_FW_VERSION: ${D555_FW_VERSION}")
set(D555_FW_SHA1 5c5e6cb3c61756fa556c067b9166ba8d92320188)
set(D555_FW_URL "${REALSENSE_FIRMWARE_URL}/Releases/RS555/FW")

add_library(${PROJECT_NAME} STATIC empty.c)

# disable link time optimization for fw by adding -fno-lto to disable -flto flag
Expand Down Expand Up @@ -66,6 +72,7 @@ function(target_binary url version sha1 symbol ext)
endfunction()

target_binary( "${D4XX_FW_URL}" "${D4XX_FW_VERSION}" "${D4XX_FW_SHA1}" D4XX_FW_Image .bin)
target_binary( "${D555_FW_URL}" "${D555_FW_VERSION}" "${D555_FW_SHA1}" D555_FW_Image .img)


install(TARGETS ${PROJECT_NAME} EXPORT realsense2Targets
Expand Down
1 change: 1 addition & 0 deletions common/fw/firmware-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

#define D4XX_RECOMMENDED_FIRMWARE_VERSION "5.16.0.1"

#define D555_RECOMMENDED_FIRMWARE_VERSION "7.56.19752.406"
1 change: 1 addition & 0 deletions common/fw/fw.rc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#include "D4XX_FW_Image.rc"
#include "D555_FW_Image.rc"

15 changes: 12 additions & 3 deletions src/ds/d500/d500-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "proc/depth-formats-converter.h"
#include "proc/y8i-to-y8y8.h"
#include "proc/y16i-to-y10msby10msb.h"
#include <common/fw/firmware-version.h>

#include <rsutils/type/fourcc.h>
using rs_fourcc = rsutils::type::fourcc;
Expand Down Expand Up @@ -489,7 +490,7 @@ namespace librealsense
_device_capabilities = ds_caps::CAP_ACTIVE_PROJECTOR | ds_caps::CAP_RGB_SENSOR | ds_caps::CAP_IMU_SENSOR |
ds_caps::CAP_BMI_085 | ds_caps::CAP_GLOBAL_SHUTTER | ds_caps::CAP_INTERCAM_HW_SYNC;

_fw_version = rsutils::version(gvd_parsed_fields.fw_version);
_fw_version = rsutils::version(gvd_parsed_fields.fw_version);

auto _usb_mode = usb3_type;
usb_type_str = usb_spec_names.at(_usb_mode);
Expand Down Expand Up @@ -519,6 +520,11 @@ namespace librealsense

_is_locked = _ds_device_common->is_locked( gvd_buff.data(), is_camera_locked_offset );

// Recommended FW only for D555
if (pid_hex_str == "0B56")
{
_recommended_fw_version = firmware_version(D555_RECOMMENDED_FIRMWARE_VERSION);
}

//EXPOSURE AND GAIN - preparing uvc options
auto exposure_option = std::make_shared<uvc_xu_option<uint32_t>>(raw_depth_sensor,
Expand Down Expand Up @@ -695,8 +701,11 @@ namespace librealsense
register_info(RS2_CAMERA_INFO_ADVANCED_MODE, ((advanced_mode) ? "YES" : "NO"));
register_info(RS2_CAMERA_INFO_PRODUCT_ID, pid_hex_str);
register_info(RS2_CAMERA_INFO_PRODUCT_LINE, "D500");
// Uncomment once D500 recommended FW exist
//register_info(RS2_CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION, _recommended_fw_version);
// Recommended FW only for D555
if (pid_hex_str == "0B56")
{
register_info(RS2_CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION, _recommended_fw_version);
}
register_info(RS2_CAMERA_INFO_CAMERA_LOCKED, _is_locked ? "YES" : "NO");

if (usb_modality)
Expand Down
2 changes: 2 additions & 0 deletions tools/realsense-viewer/realsense-viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@

#ifdef INTERNAL_FW
#include "common/fw/D4XX_FW_Image.h"
#include "common/fw/D555_FW_Image.h"
#else
#define FW_D4XX_FW_IMAGE_VERSION ""
#define FW_D555_FW_IMAGE_VERSION ""
#endif // INTERNAL_FW

using namespace rs2;
Expand Down