47 msg::Log::get().sinks.add_Serial();
48 msg::Log::get().sinks.add(&msg::StartupLog::get());
52 LOG_ALWAYS(dist::ident());
53 LOGV(
"Flash image (%d bytes) sha256 sum: %s\n", loader::flashimage::len(),
54 loader::flashimage::sha256sum().to_string().c_str());
60 LOG(ANABRID_DEBUG_INIT,
"Detecting and Initializing carrier board...");
61 auto &carrier_ = carrier::Carrier::get();
62 auto carrier_init_result = carrier_.init();
63 if (!carrier_init_result) {
64 LOG_ERROR(
"Error initializing carrier board.");
65 leds::indicate_error();
71 LOG(ANABRID_DEBUG_INIT,
"Starting up Ethernet...");
72 net::register_settings();
73 auto &netconf = net::StartupConfig::get();
74 int net_error = netconf.begin_ip();
75 if (!net_error && netconf.enable_mdns) {
76 LOG_ALWAYS(
"Starting MDNS");
79 if (!net_error && netconf.enable_jsonl)
80 msg::ApplicationServer::get().begin();
93 auto ® = msg::handlers::Registry::get();
99 if (!carrier_init_result)
return;
103 if (!daq::calibrate(carrier_)) {
104 LOG_ALWAYS(
"Warning: Error during DAQ calibration. Machine will continue with reduced accuracy.");
108 carrier_.reset(entities::ResetAction::OVERLOAD_RESET);
111 mode::RealManualControl::to_ic();
114 LOG(ANABRID_DEBUG_INIT,
"Executing self-calibration, this may take a few moments...");
115 auto mblock_calibrate_result = carrier_.calibrate_m_blocks();
116 if (!mblock_calibrate_result) {
126 LOG_ALWAYS(mblock_calibrate_result.err_value().c_str());
127 LOG_ALWAYS(
"Info: Startup self-calibration apparently did not succeed. The calibration scheme is by "
128 "default not used in this build anyway.");
132 carrier_.reset(entities::ResetAction::CIRCUIT_RESET | entities::ResetAction::OVERLOAD_RESET);
133 (void)carrier_.write_to_hardware();
137 LOG(ANABRID_DEBUG_INIT,
"Initialization done.");
139 static_plugin::setup();
141 platform::CalibrationBase::begin();