#[non_exhaustive]pub enum Error {
Show 45 variants
AppPartitionNotFound,
Cancelled,
ChipDetectError(String),
ChipMismatch(String, String),
ChipNotProvided,
CorruptData(usize, usize),
DigestMismatch(Vec<u8>, Vec<u8>),
ElfNotRamLoadable,
ElfTooBig(u32, u32),
FlashConnect,
IncorrectDigestLength(usize),
IncorrectResponse,
InvalidBootloader,
InvalidBootloaderPath,
InvalidFlashSize(String),
InvalidPartitionTablePath,
NoSerial,
ReadMoreThanExpected,
StubRequired,
SerialNotFound(String),
SerialNotSelected,
UnsupportedFeature {
chip: Chip,
feature: String,
},
UnsupportedFlash(u8),
UnsupportedFlashFrequency {
chip: Chip,
frequency: FlashFrequency,
},
UnsupportedChipRevision {
major: u16,
minor: u16,
found_major: u16,
found_minor: u16,
},
ParseChipRevError {
chip_rev: String,
},
Connection(Box<dyn Error + Send + Sync>),
Flashing(Box<dyn Error + Send + Sync>),
InvalidElf(Box<dyn Error + Send + Sync>),
InvalidAppDescriptor(Box<dyn Error + Send + Sync>),
RomError(Box<dyn Error + Send + Sync>),
MissingPartition(Box<dyn Error + Send + Sync>),
MissingPartitionTable(Box<dyn Error + Send + Sync>),
VerifyFailed,
TryFromSlice(Box<dyn Error + Send + Sync>),
ParseIntError(Box<dyn Error + Send + Sync>),
Utf8Error(Box<dyn Error + Send + Sync>),
FileOpenError(String, Error),
Partition(Box<dyn Error + Send + Sync>),
InvalidResponse(String),
InvalidEraseRegionArgument {
address: u32,
size: u32,
},
FirmwareChipMismatch {
elf: String,
detected: Chip,
},
PartitionTableDoesNotFit(FlashSize),
AppDescriptorNotPresent(String),
MisplacedKey(String),
}Expand description
All possible errors returned by espflash
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AppPartitionNotFound
App partition not found
Cancelled
Operation was cancelled by the user
ChipDetectError(String)
Unable to detect chip type
ChipMismatch(String, String)
The specified chip does not match the detected chip
ChipNotProvided
Chip argument not provided, this is required when using the --before no-reset-no-sync option
CorruptData(usize, usize)
Corrupted data received
DigestMismatch(Vec<u8>, Vec<u8>)
The calculated and received MD5 digests do not match
ElfNotRamLoadable
Supplied ELF image can not be run from RAM, as it includes segments mapped to ROM addresses
ElfTooBig(u32, u32)
The supplied ELF image is too large for the configured app partition
FlashConnect
Failed to connect to on-device flash
IncorrectDigestLength(usize)
Received MD5 digest has the incorrect length
IncorrectResponse
Incorrect response from the stub/ROM loader
InvalidBootloader
The provided bootloader binary is invalid
InvalidBootloaderPath
Specified bootloader path is not a .bin file
InvalidFlashSize(String)
Invalid flash size provided
InvalidPartitionTablePath
Specified partition table path is not a .bin or .csv file
NoSerial
No serial ports could be detected
ReadMoreThanExpected
Read more bytes than expected
StubRequired
Command requires using the RAM stub
SerialNotFound(String)
Serial port could not be found
SerialNotSelected
No serial port argument was provided
UnsupportedFeature
Chip does not support a specific feature
UnsupportedFlash(u8)
Unsupported flash chip
UnsupportedFlashFrequency
Flash frequency not supported by chip
UnsupportedChipRevision
Unsupported chip revision for connected chip
Fields
ParseChipRevError
Failed to parse chip revision due to invalid format
Connection(Box<dyn Error + Send + Sync>)
Error while connecting to device
Flashing(Box<dyn Error + Send + Sync>)
Communication error while flashing device
InvalidElf(Box<dyn Error + Send + Sync>)
Supplied ELF image is not valid
InvalidAppDescriptor(Box<dyn Error + Send + Sync>)
Supplied ELF image contains an invalid application descriptor
RomError(Box<dyn Error + Send + Sync>)
serialport only.The bootloader returned an error
MissingPartition(Box<dyn Error + Send + Sync>)
The selected partition does not exist in the partition table
MissingPartitionTable(Box<dyn Error + Send + Sync>)
The partition table is missing or invalid
VerifyFailed
Verification of flash content failed
TryFromSlice(Box<dyn Error + Send + Sync>)
Error while trying to convert from slice
ParseIntError(Box<dyn Error + Send + Sync>)
Error while trying to parse int from text
Utf8Error(Box<dyn Error + Send + Sync>)
Error while trying to parse UTF-8 from bytes
FileOpenError(String, Error)
Failed to open file
Partition(Box<dyn Error + Send + Sync>)
Failed to parse partition table
InvalidResponse(String)
Invalid response from target device
InvalidEraseRegionArgument
An invalid address and/or size argument was provided
FirmwareChipMismatch
Firmware was built for a chip other than what was detected
PartitionTableDoesNotFit(FlashSize)
The partition table does not fit into the flash
AppDescriptorNotPresent(String)
App descriptor not present in the binary
MisplacedKey(String)
Key is not in the expected section
Trait Implementations§
Source§impl Diagnostic for Error
impl Diagnostic for Error
Source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz) is recommended, but more classic codes like
E0123 or enums will work just fine.Source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn url(&self) -> Option<Box<dyn Display + '_>>
fn url(&self) -> Option<Box<dyn Display + '_>>
Diagnostic.Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandlers to change the display format
of this diagnostic. Read moreSource§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic’s Diagnostic::labels to.Source§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic’s Diagnostic::source_codeDiagnostics.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<ParseIntError> for Error
impl From<ParseIntError> for Error
Source§fn from(err: ParseIntError) -> Self
fn from(err: ParseIntError) -> Self
Source§impl From<TryFromSliceError> for Error
impl From<TryFromSliceError> for Error
Source§fn from(err: TryFromSliceError) -> Self
fn from(err: TryFromSliceError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.