def METHOD_NAME(self, addr, chunk, len_chunk, block_no, blocks):
    assert len_chunk > 0
    assert len_chunk <= self.CHUNK_SIZE
    assert block_no < blocks
    block = self._to_uint32(self.UF2_FIRST_MAGIC)
    block += self._to_uint32(self.UF2_SECOND_MAGIC)
    block += self._to_uint32(self.UF2_FLAG_FAMILYID_PRESENT | self.UF2_FLAG_MD5_PRESENT)
    block += self._to_uint32(addr)
    block += self._to_uint32(len_chunk)
    block += self._to_uint32(block_no)
    block += self._to_uint32(blocks)
    block += self._to_uint32(self.chip_id)
    block += chunk
    md5_part = self._to_uint32(addr)
    md5_part += self._to_uint32(len_chunk)
    md5_part += hashlib.md5(chunk).digest()
    assert(len(md5_part) == self.UF2_MD5_PART_SIZE)
    block += md5_part
    block += b'\x00' * (self.UF2_DATA_SIZE - self.UF2_MD5_PART_SIZE - len_chunk)
    block += self._to_uint32(self.UF2_FINAL_MAGIC)
    assert len(block) == self.UF2_BLOCK_SIZE
    self.f.write(block)