Skip to content

Commit

Permalink
PR IntelRealSense#11170 from Eran: Release v2.53.1
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel authored Dec 6, 2022
2 parents 923253f + 23b0904 commit 3371f4d
Show file tree
Hide file tree
Showing 166 changed files with 30,909 additions and 11,551 deletions.
2 changes: 2 additions & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ set(COMMON_SRC
"${CMAKE_CURRENT_LIST_DIR}/decompress-huffman.h"
"${CMAKE_CURRENT_LIST_DIR}/updates-model.h"
"${CMAKE_CURRENT_LIST_DIR}/updates-model.cpp"
"${CMAKE_CURRENT_LIST_DIR}/option-model.h"
"${CMAKE_CURRENT_LIST_DIR}/option-model.cpp"
)

set(SW_UPDATE_FILES
Expand Down
52 changes: 52 additions & 0 deletions common/fw-update-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,62 @@ namespace rs2
return false;
}

void firmware_update_manager::process_mipi()
{
if (!_is_signed)
{
fail("Signed FW update for MIPI device - This FW file is not signed ");
return;
}
auto dev_updatable = _dev.as<updatable>();
if(!(dev_updatable && dev_updatable.check_firmware_compatibility(_fw)))
{
fail("Firmware Update failed - fw version must be newer than version 5.13.1.1");
return;
}

log("Burning Signed Firmware on MIPI device");

// Enter DFU mode
auto device_debug = _dev.as<rs2::debug_protocol>();
uint32_t dfu_opcode = 0x1e;
device_debug.build_command(dfu_opcode, 1);

_progress = 30;
// Grant permissions for writing
// skipped for now - must be done in sudo
//chmod("/dev/d4xx-dfu504", __S_IREAD|__S_IWRITE);

// Write signed firmware to appropriate file descritptor
std::ofstream fw_path_in_device("/dev/d4xx-dfu504", std::ios::binary);
if (fw_path_in_device)
{
fw_path_in_device.write(reinterpret_cast<const char*>(_fw.data()), _fw.size());
}
else
{
fail("Firmware Update failed - wrong path or permissions missing");
return;
}
LOG_INFO("Firmware Update for MIPI device done.");
fw_path_in_device.close();

_progress = 100;
_done = true;
// need to find a way to update the fw version field in the viewer
}

void firmware_update_manager::process_flow(
std::function<void()> cleanup,
invoker invoke)
{
// if device is D457, and fw is signed - using mipi specific procedure
if (!strcmp(_dev.get_info(RS2_CAMERA_INFO_PRODUCT_ID), "ABCD") && _is_signed)
{
process_mipi();
return;
}

std::string serial = "";
if (_dev.supports(RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID))
serial = _dev.get_info(RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID);
Expand Down
5 changes: 3 additions & 2 deletions common/fw-update-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ namespace rs2
const device_model& get_device_model() const { return _model; }
std::shared_ptr<notifications_model> get_protected_notification_model() { return _not_model.lock(); };

private:
protected:
void process_flow(std::function<void()> cleanup,
invoker invoke) override;
void process_mipi();
bool check_for(
std::function<bool()> action, std::function<void()> cleanup,
std::chrono::system_clock::duration delta);
Expand All @@ -53,4 +54,4 @@ namespace rs2
void draw_expanded(ux_window& win, std::string& error_message) override;
int calc_height() override;
};
}
}
9 changes: 8 additions & 1 deletion common/fw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(REALSENSE_FIRMWARE_URL "https://librealsense.intel.com" CACHE STRING
string(REGEX MATCH "D4XX_RECOMMENDED_FIRMWARE_VERSION \"([0-9]+.[0-9]+.[0-9]+.[0-9]+)\"" _ ${ver})
set(D4XX_FW_VERSION ${CMAKE_MATCH_1})
message(STATUS "D4XX_FW_VERSION: ${D4XX_FW_VERSION}")
set(D4XX_FW_SHA1 d5502ba0c51a9994caca72123ce19735bbbbbf97)
set(D4XX_FW_SHA1 8dc3b8a0b9fdf03410c15b30e04f57701985064a)
set(D4XX_FW_URL "${REALSENSE_FIRMWARE_URL}/Releases/RS4xx/FW")


Expand Down Expand Up @@ -44,6 +44,13 @@ set(L53X_FW_URL "${REALSENSE_FIRMWARE_URL}/Releases/L5xx/FW")

add_library(${PROJECT_NAME} STATIC empty.c)

# disable link time optimization for fw by adding -fno-lto to disable -flto flag
# jammy debian has build errors without it
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(STATUS "disable link time optimization for fw project")
target_compile_options(${PROJECT_NAME} PRIVATE -fno-lto)
endif()

if (MSVC)
# lib.exe can't handle multiple .res files, so include them in one.
# even then, the linker won't grab a .res out of a .lib object, so it needs to be explicitly listed
Expand Down
4 changes: 2 additions & 2 deletions common/fw/firmware-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#pragma once

#define D4XX_RECOMMENDED_FIRMWARE_VERSION "5.13.0.50"
#define D4XX_RECOMMENDED_FIRMWARE_VERSION "5.14.0.0"
#define SR3XX_RECOMMENDED_FIRMWARE_VERSION "3.26.1.0"
#define T26X_FIRMWARE_VERSION "0.2.0.951"
#define L51X_RECOMMENDED_FIRMWARE_VERSION "1.5.8.1"
#define L53X_RECOMMENDED_FIRMWARE_VERSION "3.5.5.1"
#define L53X_RECOMMENDED_FIRMWARE_VERSION "3.5.5.1"
Loading

0 comments on commit 3371f4d

Please sign in to comment.