pub fn new(flash: &'a mut FlashRegion<'a, F>) -> Result<Ota<'a, F>, crate::partitions::Error> {
        if flash.capacity() != 0x2000
            || flash.raw.partition_type()
                != crate::partitions::PartitionType::Data(
                    crate::partitions::DataPartitionSubType::Ota,
                )
        {
            return Err(crate::partitions::Error::InvalidPartition {
                expected_size: 0x2000,
                expected_type: crate::partitions::PartitionType::Data(
                    crate::partitions::DataPartitionSubType::Ota,
                ),
            });
        }

        Ok(Ota { flash })
    }
Create a [Ota] instance from the given [FlashRegion]

# Errors
A [crate::partitions::Error::InvalidPartition] if the given flash region
doesn't represent a Data/Ota partition or the size is unexpected
esp-bootloader-esp-idf/src/ota.rs