Esempio n. 1
0
 def actionProgram(self):
     """program data into flash memory."""
     if self.data is not None:
         sys.stderr.write("Program ...\n")
         if self.showprogess:
             _parjtag.set_flash_callback(self.progess_update)
         bytes = 0
         for seg in self.data:
             _parjtag.memwrite(seg.startaddress, seg.data)
             bytes += len(seg.data)
         if self.showprogess:
             sys.stderr.write("\r")
         sys.stderr.write("%i bytes programmed.\n" % bytes)
     else:
         raise JTAGException("programming without data not possible")
Esempio n. 2
0
 def actionProgram(self):
     """program data into flash memory."""
     if self.data is not None:
         sys.stderr.write("Program ...\n")
         if self.showprogess:
             _parjtag.set_flash_callback(self.progess_update)
         bytes = 0
         for seg in self.data:
             _parjtag.memwrite(seg.startaddress, seg.data)
             bytes += len(seg.data)
         if self.showprogess:
             sys.stderr.write("\r")
         sys.stderr.write("%i bytes programmed.\n" % bytes)
     else:
         raise JTAGException("programming without data not possible")
Esempio n. 3
0
 def actionProgram(self):
     """Program data into flash memory."""
     if self.data is not None:
         if self.verbose:
             sys.stderr.write("Program...\n")
             sys.stderr.flush()
         if self.showprogess:
             _parjtag.set_flash_callback(self.progess_update)
         bytes = 0
         for seg in self.data:
             # pad length if it is not even
             if len(seg.data) & 1: seg.data += '\xff'
             _parjtag.memwrite(seg.startaddress, seg.data)
             bytes += len(seg.data)
         if self.verbose:
             sys.stderr.write("%i bytes programmed.\n" % bytes)
             sys.stderr.flush()
     else:
         raise JTAGException("Programming without data is not possible")
Esempio n. 4
0
 def downloadData(self, startaddress, data ):
     """download a datablock"""
     return _parjtag.memwrite(startaddress, data )
Esempio n. 5
0
 def downloadData(self, startaddress, data):
     """Write data to given address."""
     _parjtag.memwrite(startaddress, data)