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

Complete parsing for FW Error reports #1403

Merged
merged 1 commit into from
Mar 21, 2018
Merged
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
14 changes: 4 additions & 10 deletions src/ds5/ds5-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,10 @@ namespace librealsense

notification ds5_notification_decoder::decode(int value)
{
if (value == 0)
return{ RS2_NOTIFICATION_CATEGORY_HARDWARE_ERROR, value, RS2_LOG_SEVERITY_ERROR, "Success" };
if (value == ds::ds5_notifications_types::hot_laser_power_reduce)
return{ RS2_NOTIFICATION_CATEGORY_HARDWARE_ERROR, value, RS2_LOG_SEVERITY_ERROR, "Hot laser power reduce" };
if (value == ds::ds5_notifications_types::hot_laser_disable)
return{ RS2_NOTIFICATION_CATEGORY_HARDWARE_ERROR, value, RS2_LOG_SEVERITY_ERROR, "Hot laser disable" };
if (value == ds::ds5_notifications_types::flag_B_laser_disable)
return{ RS2_NOTIFICATION_CATEGORY_HARDWARE_ERROR, value, RS2_LOG_SEVERITY_ERROR, "Flag B laser disable" };

return{ RS2_NOTIFICATION_CATEGORY_HARDWARE_ERROR, value, RS2_LOG_SEVERITY_WARN, "Unknown error!" };
if (ds::ds5_fw_error_report.find(static_cast<uint8_t>(value)) != ds::ds5_fw_error_report.end())
return{ RS2_NOTIFICATION_CATEGORY_HARDWARE_ERROR, value, RS2_LOG_SEVERITY_ERROR, ds::ds5_fw_error_report.at(static_cast<uint8_t>(value)) };

return{ RS2_NOTIFICATION_CATEGORY_HARDWARE_ERROR, value, RS2_LOG_SEVERITY_WARN, (to_string() << "D400 HW report - unresolved type " << value) };
}

void ds5_device::create_snapshot(std::shared_ptr<debug_interface>& snapshot) const
Expand Down
58 changes: 55 additions & 3 deletions src/ds5/ds5-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,61 @@ namespace librealsense
enum ds5_notifications_types
{
success = 0,
hot_laser_power_reduce = 1, // reported to error depth XU control
hot_laser_disable = 2, // reported to error depth XU control
flag_B_laser_disable = 3 // reported to error depth XU control
hot_laser_power_reduce,
hot_laser_disable,
flag_B_laser_disable,
stereo_module_not_connected,
eeprom_corrupted,
calibration_corrupted,
mm_upd_fail,
isp_upd_fail,
mm_force_pause,
mm_failure,
usb_scp_overflow,
usb_rec_overflow,
usb_cam_overflow,
mipi_left_error,
mipi_right_error,
mipi_rt_error,
mipi_fe_error,
i2c_cfg_left_error,
i2c_cfg_right_error,
i2c_cfg_rt_error,
i2c_cfg_fe_error,
stream_not_start_z,
stream_not_start_y,
stream_not_start_cam,
rec_error,
};

// Elaborate FW XU report. The reports may be consequently extended for PU/CTL/ISP
const std::map< uint8_t, std::string> ds5_fw_error_report = {
{ success, "Success" },
{ hot_laser_power_reduce, "Laser hot - power reduce" },
{ hot_laser_disable, "Laser hot - disabled" },
{ flag_B_laser_disable, "Flag B - laser disabled" },
{ stereo_module_not_connected, "Stered Module is not connected" },
{ eeprom_corrupted, "EEPROM corrupted" },
{ calibration_corrupted, "Calibration corrupted" },
{ mm_upd_fail, "Moton Module update failed" },
{ isp_upd_fail, "ISP update failed" },
{ mm_force_pause, "Motion Module force pause" },
{ mm_failure, "Motion Module failure" },
{ usb_scp_overflow, "USB SCP overflow" },
{ usb_rec_overflow, "USB REC overflow" },
{ usb_cam_overflow, "USB CAM overflow" },
{ mipi_left_error, "Left MIPI error" },
{ mipi_right_error, "Right MIPI error" },
{ mipi_rt_error, "RT MIPI error" },
{ mipi_fe_error, "FishEye MIPI error" },
{ i2c_cfg_left_error, "Left IC2 Config error" },
{ i2c_cfg_right_error, "Right IC2 Config error" },
{ i2c_cfg_rt_error, "RT IC2 Config error" },
{ i2c_cfg_fe_error, "FishEye IC2 Config error" },
{ stream_not_start_z, "Depth stream start failure" },
{ stream_not_start_y, "IR stream start failure" },
{ stream_not_start_cam, "Camera stream start failure" },
{ rec_error, "REC error" },
};

} // librealsense::ds
Expand Down
6 changes: 2 additions & 4 deletions src/error-handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,14 @@ namespace librealsense
{
if (cancellable_timer.try_sleep(_poll_intervals_ms))
{
auto val = 0;
try
{
val = static_cast<int>(_option->query());
auto val = static_cast<uint8_t>(_option->query());

if (val != 0 && !_silenced)
{
auto n = _decoder->decode(val);
auto strong = _notifications_processor.lock();
if (strong) strong->raise_notification(n);
if (strong) strong->raise_notification(_decoder->decode(val));

val = static_cast<int>(_option->query());
if (val != 0)
Expand Down