diff --git a/common/on-chip-calib.cpp b/common/on-chip-calib.cpp index 96f91ce8cd..24b662fb21 100644 --- a/common/on-chip-calib.cpp +++ b/common/on-chip-calib.cpp @@ -1343,6 +1343,12 @@ namespace rs2 void on_chip_calib_manager::process_flow(std::function cleanup, invoker invoke) { + static auto_calib_action prev_action = RS2_CALIB_ACTION_ON_CHIP_OB_CALIB; + if (prev_action != action) + { + prev_action = action; + LOG_WARNING(std::string(to_string() << __LINE__ << " action = " << action )); + } if (action == RS2_CALIB_ACTION_FL_CALIB || action == RS2_CALIB_ACTION_UVMAPPING_CALIB || action == RS2_CALIB_ACTION_FL_PLUS_CALIB) stop_viewer(invoke); @@ -1533,8 +1539,13 @@ namespace rs2 try_start_viewer(0, 0, 0, invoke); // Start with default settings // Make new calibration active + LOG_WARNING(std::string(to_string() << __LINE__ << " wait 4")); + std::this_thread::sleep_for(std::chrono::milliseconds(4000)); // Evgeni - debug apply_calib(true); LOG_WARNING(std::string(to_string() << __LINE__ << " new calib applied")); + LOG_WARNING(std::string(to_string() << __LINE__ << " wait 5")); + std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // Evgeni - debug + //LOG_WARNING(std::string(to_string() << __LINE__ << " wait done")); // Capture metrics after auto metrics_after = get_depth_metrics(invoke); diff --git a/src/ds5/ds5-auto-calibration.cpp b/src/ds5/ds5-auto-calibration.cpp index b07a1dee04..8ac7464bfb 100644 --- a/src/ds5/ds5-auto-calibration.cpp +++ b/src/ds5/ds5-auto-calibration.cpp @@ -509,7 +509,25 @@ namespace librealsense cmd.data.push_back(p[0]); cmd.data.push_back(p[1]); } - _hw_monitor->send(cmd); + bool success = false; + int iter =0; + do + { + try + { + if (iter==0) // apply only in the first iteration + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // Debug sendng request below this threshold + auto res = _hw_monitor->send(cmd); // most likely will fail with MIPI SKU and require retry + LOG_WARNING("occ Save Statistics transfer FR buffer succeeded"); + success = true; + } + catch(...) + { + LOG_WARNING("occ Save Statistics result failed"); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + }; + } + while(( ++iter < 3) && (!success)); } DirectSearchCalibrationResult result = get_calibration_status(timeout_ms, [progress_callback, host_assistance, speed](int count) @@ -1765,7 +1783,14 @@ namespace librealsense uint8_t* table = (uint8_t*)(calibration.data() + sizeof(table_header)); command write_calib(ds::CALIBRECALC, 0, 0, 0, 0xcafecafe); write_calib.data.insert(write_calib.data.end(), (uint8_t*)table, ((uint8_t*)table) + hd->table_size); - _hw_monitor->send(write_calib); + try + { + _hw_monitor->send(write_calib); + } + catch(...) + { + LOG_ERROR("Flashing coefficients_table_id failed"); + } } case rgb_calibration_id: // case fall-through by design. For RGB skip loading to RAM (not supported) _curr_calibration = calibration;