diff --git a/micro-rdk-installer/src/error.rs b/micro-rdk-installer/src/error.rs index 665e411d2..d281ab9c6 100644 --- a/micro-rdk-installer/src/error.rs +++ b/micro-rdk-installer/src/error.rs @@ -45,6 +45,8 @@ pub enum Error { MonitorError(String), #[error("Unimplemented command: {0}")] UnimplementedError(String), + #[error("Serial config error: {0}")] + SerialConfigError(String), #[error("No command received")] NoCommandError, } diff --git a/micro-rdk-installer/src/main.rs b/micro-rdk-installer/src/main.rs index 595f51223..96d7f8bba 100644 --- a/micro-rdk-installer/src/main.rs +++ b/micro-rdk-installer/src/main.rs @@ -234,7 +234,7 @@ fn flash( port: None, no_stub: false, }; - let conf = Config::default(); + let conf = Config::load().map_err(|err| Error::SerialConfigError(err.to_string()))?; log::info!("Connecting..."); let mut flasher = connect(&connect_args, &conf).map_err(|_| Error::FlashConnect)?; let mut f = File::open(binary_path).map_err(Error::FileError)?; @@ -265,7 +265,7 @@ fn monitor_esp32(baud_rate: Option, log_file_path: Option) -> Resul port: None, no_stub: false, }; - let conf = Config::default(); + let conf = Config::load().map_err(|err| Error::SerialConfigError(err.to_string()))?; log::info!("Connecting..."); let flasher = connect(&connect_args, &conf).map_err(|_| Error::FlashConnect)?; let pid = flasher.get_usb_pid().map_err(Error::EspFlashError)?;