UnknownCommand = 1,
InvalidArgument,
ChecksumMismatch,
+ PermissionDenied,
}
extern {
if sector > 0xff {
Err(Error::InvalidArgument)
+ } else if sector == 0x01 {
+ // The second sector contains the flash configuration field,
+ // and keeping it in the erased state has the potential
+ // to brick the device.
+ Err(Error::PermissionDenied)
} else {
flash::erase(sector);