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

Enabling USB and MIPI at once #10698

Merged
merged 31 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8ed0ec5
comment out and validate libCI without redundent frame copies
Nir-Az Jun 8, 2022
b5bed9d
PR #10573 from Nir: Remove redundant frame copies inside core librs
maloel Jun 9, 2022
8b635a1
Add live fps testing
OhadMeir Jun 13, 2022
8a14565
Test fps mean for 20 seconds
OhadMeir Jun 13, 2022
cc79460
Handle auto-exposure (affects fps)
OhadMeir Jun 13, 2022
194af8e
Handle auto-exposure (affects fps)
OhadMeir Jun 13, 2022
0a00a3f
Merge branch 'testing' of https://github.com/OhadMeir/librealsense in…
OhadMeir Jun 13, 2022
0cd42d9
Handle PR comments
OhadMeir Jun 19, 2022
d3271de
PR #10591 from Ohad: Add live fps test
maloel Jun 19, 2022
14f2007
Merge 'origin/development' into D4XX_MIPI - sensor.cpp to be handled
remibettan Jun 21, 2022
8442bdd
Merge branch 'D4XX_MIPI' of https://github.com/intelrealsense/libreal…
remibettan Jun 29, 2022
d7ecb3e
Merge branch 'D4XX_MIPI' of https://github.com/intelrealsense/libreal…
remibettan Aug 2, 2022
dd713e8
copy frame only when needed
remibettan Jun 22, 2022
cb022fc
code review corrections
remibettan Jun 22, 2022
0fc9b42
hwmc - restoring usb api
remibettan Jul 3, 2022
b136188
comment added for usb enumeration successfull within this branch
remibettan Jul 3, 2022
e09a212
adding ifdef flags for mipi/usb work
remibettan Jul 4, 2022
d3e3d8b
fix minor bug in ds5-color
remibettan Jul 4, 2022
9e4390d
fix profiles unordered_set - permits usb depth stream
remibettan Jul 4, 2022
7d791fa
hack hwm to make mipi and usb work togethter - temp
remibettan Jul 4, 2022
fa7f2a7
permitting usb metadata - v4l_uvc_device checked
remibettan Jul 7, 2022
f40255b
removing ifdef flags
remibettan Jul 7, 2022
7d1da08
adding private methods
remibettan Jul 7, 2022
101d6b5
v4l2_ext_controls initialized to fit different kernel versions
remibettan Jul 10, 2022
0a37ce4
hwm w/a - improved by setting mipi or usb api once instead of try cat…
remibettan Jul 12, 2022
0354229
fix metadata offset acc to v4l device class
remibettan Jul 12, 2022
9521c1a
video-md syncer - override md buffer when same sequence number is pushed
remibettan Jul 13, 2022
1e69df1
DFU via MIPI - started
remibettan Jul 17, 2022
bef6e81
usb hwm api used also for mipi
remibettan Jul 19, 2022
04b3f25
check fw compatibility for dfu via mipi
remibettan Jul 24, 2022
3832346
code review minor changes
remibettan Aug 1, 2022
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
51 changes: 51 additions & 0 deletions common/fw-update-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,61 @@ namespace rs2
return false;
}

void firmware_update_manager_mipi::process_flow(std::function<void()> cleanup, invoker invoke)
{
if (!_is_signed)
{
LOG_INFO("Only Signed Firmware can be burnt on MIPI device");
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;
}

// 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);
remibettan marked this conversation as resolved.
Show resolved Hide resolved
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)
{
auto str = _dev.get_info(RS2_CAMERA_INFO_PRODUCT_ID);
if (!strcmp(_dev.get_info(RS2_CAMERA_INFO_PRODUCT_ID), "ABCD")) // if device is D457
{
firmware_update_manager_mipi fw_update_mgr_mipi(_not_model, _model, _dev, _ctx, _fw, _is_signed);
fw_update_mgr_mipi.process_flow(cleanup, invoke);
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
22 changes: 20 additions & 2 deletions common/fw-update-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#include "notifications.h"
#include "../src/fw-update/fw-update-device-interface.h"


namespace rs2
Expand All @@ -28,7 +29,7 @@ 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;
bool check_for(
Expand All @@ -43,6 +44,23 @@ namespace rs2
device_model& _model;
};

class firmware_update_manager_mipi : public process_manager
{
public:
firmware_update_manager_mipi(std::weak_ptr<notifications_model> not_model, device_model& model, device dev, context ctx, std::vector<uint8_t> fw, bool is_signed)
: process_manager("Firmware Update Mipi"), _not_model(not_model), _model(model),
_fw(fw), _is_signed(is_signed), _dev(dev), _ctx(ctx) {}
void process_flow(std::function<void()> cleanup, invoker invoke);

private:
std::weak_ptr<notifications_model> _not_model;
device _dev;
context _ctx;
std::vector<uint8_t> _fw;
bool _is_signed;
device_model& _model;
};

struct fw_update_notification_model : public process_notification_model
{
fw_update_notification_model(std::string name,
Expand All @@ -53,4 +71,4 @@ namespace rs2
void draw_expanded(ux_window& win, std::string& error_message) override;
int calc_height() override;
};
}
}
2 changes: 1 addition & 1 deletion src/ds5/ds5-color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ namespace librealsense
}
if (_pid != ds::RS457_PID)
{
color_ep.register_processing_block(processing_block_factory::create_pbf_vector<uyvy_converter>(RS2_FORMAT_UYVY, map_supported_color_formats(RS2_FORMAT_UYVY), RS2_STREAM_COLOR));
color_ep.register_processing_block(processing_block_factory::create_pbf_vector<yuy2_converter>(RS2_FORMAT_YUYV, map_supported_color_formats(RS2_FORMAT_YUYV), RS2_STREAM_COLOR));
color_ep.register_processing_block(processing_block_factory::create_id_pbf(RS2_FORMAT_RAW16, RS2_STREAM_COLOR));
remibettan marked this conversation as resolved.
Show resolved Hide resolved
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion src/ds5/ds5-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,8 @@ namespace librealsense
{RS465_PID, "5.12.7.100" },
{RS416_RGB_PID, "5.8.15.0" },
{RS405_PID, "5.12.11.8" },
{RS455_PID, "5.12.7.100" }
{RS455_PID, "5.12.7.100" },
{RS457_PID, "5.13.1.1" }
};


Expand Down
Loading