hardware/espressif/esp32/tools/esptool.py
def flash_defl_begin(self, size, compsize, offset):
        """ Start downloading compressed data to Flash (performs an erase)

        Returns number of blocks (size self.FLASH_WRITE_SIZE) to write.
        """
        old_tmo = self._port.timeout
        num_blocks = (compsize + self.FLASH_WRITE_SIZE - 1) // self.FLASH_WRITE_SIZE
        erase_blocks = (size + self.FLASH_WRITE_SIZE - 1) // self.FLASH_WRITE_SIZE

        self._port.timeout = 20
        t = time.time()
        if self.IS_STUB:
            write_size = size  # stub expects number of bytes here, manages erasing internally
        else:
            write_size = erase_blocks * self.FLASH_WRITE_SIZE  # ROM expects rounded up to erase block size
        print("Compressed %d bytes to %d..." % (size, compsize))
        self.check_command("enter compressed flash mode", self.ESP_FLASH_DEFL_BEGIN,
                           struct.pack('<IIII', write_size, num_blocks, self.FLASH_WRITE_SIZE, offset))
        if size != 0 and not self.IS_STUB:
            # (stub erases as it writes, but ROM loaders erase on begin)
            print("Took %.2fs to erase flash block" % (time.time() - t))
        self._port.timeout = old_tmo
        return num_blocks
 Start downloading compressed data to Flash (performs an erase)

        Returns number of blocks (size self.FLASH_WRITE_SIZE) to write.
        
Start downloading compressed data to Flash (performs an erase)
Returns number of blocks (size self.FLASH_WRITE_SIZE) to write.
Start downloading compressed data to Flash ( performs an erase ) Returns number of blocks ( size self . FLASH_WRITE_SIZE ) to write .
def flash_defl_begin(self, size, compsize, offset):
        old_tmo = self._port.timeout
        num_blocks = (compsize + self.FLASH_WRITE_SIZE - 1) // self.FLASH_WRITE_SIZE
        erase_blocks = (size + self.FLASH_WRITE_SIZE - 1) // self.FLASH_WRITE_SIZE
        self._port.timeout = 20
        t = time.time()
        if self.IS_STUB:
            write_size = size  
        else:
            write_size = erase_blocks * self.FLASH_WRITE_SIZE  
        print("Compressed %d bytes to %d..." % (size, compsize))
        self.check_command("enter compressed flash mode", self.ESP_FLASH_DEFL_BEGIN,
                           struct.pack('<IIII', write_size, num_blocks, self.FLASH_WRITE_SIZE, offset))
        if size != 0 and not self.IS_STUB:
            print("Took %.2fs to erase flash block" % (time.time() - t))
        self._port.timeout = old_tmo
        return num_blocks
def flash_defl_begin ( self , size , compsize , offset ) : old_tmo = self . _port . timeout num_blocks = ( compsize + self . FLASH_WRITE_SIZE - 1 ) // self . FLASH_WRITE_SIZE erase_blocks = ( size + self . FLASH_WRITE_SIZE - 1 ) // self . FLASH_WRITE_SIZE self . _port . timeout = 20 t = time . time ( ) if self . IS_STUB : write_size = size else : write_size = erase_blocks * self . FLASH_WRITE_SIZE print ( "Compressed %d bytes to %d..." % ( size , compsize ) ) self . check_command ( "enter compressed flash mode" , self . ESP_FLASH_DEFL_BEGIN , struct . pack ( '<IIII' , write_size , num_blocks , self . FLASH_WRITE_SIZE , offset ) ) if size != 0 and not self . IS_STUB : print ( "Took %.2fs to erase flash block" % ( time . time ( ) - t ) ) self . _port . timeout = old_tmo return num_blocks
Start downloading compressed data to Flash (performs an erase)
Returns number of blocks (size self.FLASH_WRITE_SIZE) to write.
Start downloading compressed data to Flash ( performs an erase ) Returns number of blocks ( size self . FLASH_WRITE_SIZE ) to write .
""" Start downloading compressed data to Flash (performs an erase)

        Returns number of blocks (size self.FLASH_WRITE_SIZE) to write.
        """ # stub expects number of bytes here, manages erasing internally # ROM expects rounded up to erase block size # (stub erases as it writes, but ROM loaders erase on begin)
self
size
compsize
offset