def save(self, basename):
        """ Save a set of V1 images for flashing. Parameter is a base filename. """
        # IROM data goes in its own plain binary file
        irom_segment = self.get_irom_segment()
        if irom_segment is not None:
            with open("%s0x%05x.bin" % (basename, irom_segment.addr - ESP8266ROM.IROM_MAP_START), "wb") as f:
                f.write(irom_segment.data)

        # everything but IROM goes at 0x00000 in an image file
        normal_segments = self.get_non_irom_segments()
        with open("%s0x00000.bin" % basename, 'wb') as f:
            self.write_common_header(f, normal_segments)
            checksum = ESPLoader.ESP_CHECKSUM_MAGIC
            for segment in normal_segments:
                checksum = self.save_segment(f, segment, checksum)
            self.append_checksum(f, checksum)
def save ( self , basename ) : irom_segment = self . get_irom_segment ( ) if irom_segment is not None : with open ( "%s0x%05x.bin" % ( basename , irom_segment . addr - ESP8266ROM . IROM_MAP_START ) , "wb" ) as f : f . write ( irom_segment . data ) normal_segments = self . get_non_irom_segments ( ) with open ( "%s0x00000.bin" % basename , 'wb' ) as f : self . write_common_header ( f , normal_segments ) checksum = ESPLoader . ESP_CHECKSUM_MAGIC for segment in normal_segments : checksum = self . save_segment ( f , segment , checksum ) self . append_checksum ( f , checksum )
Save a set of V1 images for flashing. Parameter is a base filename.