/// Enters recovery mode, which requests a golden image to be transferred via serial through
/// the XMODEM protocol, then reboot. If Loadstone has no golden image support, recovery
/// mode will allow flashing the bootable bank directly.
Enters recovery mode, which requests a golden image to be transferred via serial through
the XMODEM protocol, then reboot. If Loadstone has no golden image support, recovery
mode will allow flashing the bootable bank directly.
Enters recovery mode which requests a golden image to be transferred via serial through the XMODEM protocol then reboot . If Loadstone has no golden image support recovery mode will allow flashing the bootable bank directly .
pub fn recover(&mut self) -> ! {
        duprintln!(self.serial, "-- Loadstone Recovery Mode --");
        let mcu_golden_bank_exists = self.mcu_banks().any(|b| b.is_golden);
        let external_golden_bank_exists = self.external_banks().any(|b| b.is_golden);
        let no_golden_bank_support = !mcu_golden_bank_exists && !external_golden_bank_exists;
        if mcu_golden_bank_exists {
            duprintln!(self.serial, "Attempting golden image recovery to MCU flash...");
            match self.recover_internal(true) {
                Ok(_) => {
                    duprintln!(self.serial, "Finished flashing golden image.");
                    self.reboot();
                }
                Err(e) => {
                    duprintln!(self.serial, "FATAL: Image did not flash correctly.");
                    if let Some(serial) = self.serial.as_mut() {
                        e.report(serial);
                    }
                    self.reboot();
                }
            }
        }
        if self.external_flash.is_some() && external_golden_bank_exists {
            duprintln!(self.serial, "Attempting golden image recovery to external flash...");
            match self.recover_external(true) {
                Ok(_) => {
                    duprintln!(self.serial, "Finished flashing golden image.");
                    self.reboot();
                }
                Err(e) => {
                    duprintln!(self.serial, "FATAL: Image did not flash correctly.");
                    if let Some(serial) = self.serial.as_mut() {
                        e.report(serial);
                    }
                    self.reboot();
                }
            }
        }
        if no_golden_bank_support {
            duprintln!(self.serial, "Attempting image recovery to MCU flash...");
            match self.recover_internal(false) {
                Ok(_) => {
                    duprintln!(self.serial, "Finished flashing image.");
                    self.reboot();
                }
                Err(e) => {
                    duprintln!(self.serial, "FATAL: Image did not flash correctly.");
                    if let Some(serial) = self.serial.as_mut() {
                        e.report(serial);
                    }
                    self.reboot();
                }
            }
        }
        self.reboot();
    }
pub fn recover ( & mut self ) -> ! { duprintln ! ( self serial " " ) ; let mcu_golden_bank_exists = self . mcu_banks ( ) . any ( | b | b . is_golden ) ; let external_golden_bank_exists = self . external_banks ( ) . any ( | b | b . is_golden ) ; let no_golden_bank_support = ! mcu_golden_bank_exists && ! external_golden_bank_exists ; if mcu_golden_bank_exists { duprintln ! ( self serial " " ) ; match self . recover_internal ( true ) { Ok ( _ ) => { duprintln ! ( self serial " " ) ; self . reboot ( ) ; } Err ( e ) => { duprintln ! ( self serial " " ) ; if let Some ( serial ) = self . serial . as_mut ( ) { e . report ( serial ) ; } self . reboot ( ) ; } } } if self . external_flash . is_some ( ) && external_golden_bank_exists { duprintln ! ( self serial " " ) ; match self . recover_external ( true ) { Ok ( _ ) => { duprintln ! ( self serial " " ) ; self . reboot ( ) ; } Err ( e ) => { duprintln ! ( self serial " " ) ; if let Some ( serial ) = self . serial . as_mut ( ) { e . report ( serial ) ; } self . reboot ( ) ; } } } if no_golden_bank_support { duprintln ! ( self serial " " ) ; match self . recover_internal ( false ) { Ok ( _ ) => { duprintln ! ( self serial " " ) ; self . reboot ( ) ; } Err ( e ) => { duprintln ! ( self serial " " ) ; if let Some ( serial ) = self . serial . as_mut ( ) { e . report ( serial ) ; } self . reboot ( ) ; } } } self . reboot ( ) ; }
Enters recovery mode, which requests a golden image to be transferred via serial through
the XMODEM protocol, then reboot.
Enters recovery mode which requests a golden image to be transferred via serial through the XMODEM protocol then reboot .
&mut self