print "Usage: cc_write_flash.py <hex file> [[[<license key>] <bt address>] <hw version>]" print "" print " <license key> : A 32-byte, hex representation of the license key (64 characters)" print " <bt address> : A bluetooth mac address in XX:XX:XX:XX:XX:XX format" print " <hw version> : A decimal number that defines the hardware version" print "" # Wait for filename if len(sys.argv) < 2: print "ERROR: Please specify a source hex filename!" printHelp() sys.exit(1) # Open debugger try: dbg = CCDebugger("/dev/tty.usbmodem12341") except Exception as e: print "ERROR: %s" % str(e) sys.exit(1) # Get info print "\nChip information:" print " Chip ID : 0x%04x" % dbg.chipID print " Flash size : %i Kb" % dbg.chipInfo['flash'] print " SRAM size : %i Kb" % dbg.chipInfo['sram'] if dbg.chipInfo['usb']: print " USB : Yes" else: print " USB : No" # Get bluegiga-specific info
# # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # from cclib import CCDebugger, CCHEXFile import sys # Wait for filename if len(sys.argv) < 2: print "ERROR: Please specify a filename to dump the FLASH memory to!" sys.exit(1) # Open debugger try: dbg = CCDebugger("/dev/tty.usbmodem12341") except Exception as e: print "ERROR: %s" % str(e) sys.exit(1) # Get info print "\nChip information:" print " Chip ID : 0x%04x" % dbg.chipID print " Flash size : %i Kb" % dbg.chipInfo['flash'] print " SRAM size : %i Kb" % dbg.chipInfo['sram'] if dbg.chipInfo['usb']: print " USB : Yes" else: print " USB : No" # Get serial number
print "ERROR: Please specify a source hex filename!" usage() sys.exit(2) #get filename filename = "".join(args) #there is no need to do a page erase #when we do a full erase... do_page_erase = True if (full_erase): do_page_erase = False #open debugger try: dbg = CCDebugger(tty) except Exception as e: print "ERROR: %s" % str(e) sys.exit(1) print "> using file " + filename # Get info print "> Chip information:" print " Chip ID : 0x%04x" % dbg.chipID print " Flash size : %3i Kb" % dbg.chipInfo['flash'] print " SRAM size : %3i Kb" % dbg.chipInfo['sram'] print "" # Parse the HEX file hexFile = CCHEXFile(filename)
# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # from cclib import CCDebugger, hexdump import sys # Open debugger try: dbg = CCDebugger("/dev/ttyACM0") except Exception as e: print "ERROR: %s" % str(e) sys.exit(1) # Get info print "\nChip information:" print " Chip ID : 0x%04x" % dbg.chipID print " Flash size : %i Kb" % dbg.chipInfo['flash'] print " SRAM size : %i Kb" % dbg.chipInfo['sram'] if dbg.chipInfo['usb']: print " USB : Yes" else: print " USB : No" print ""
# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # from cclib import CCDebugger, hexdump import sys # Open debugger try: dbg = CCDebugger("/dev/ttyACM0") except Exception as e: print "ERROR: %s" % str(e) sys.exit(1) # Get info print "\nChip information:" print " Chip ID : 0x%04x" % dbg.chipID print " Flash size : %i Kb" % dbg.chipInfo['flash'] print " SRAM size : %i Kb" % dbg.chipInfo['sram'] if dbg.chipInfo['usb']: print " USB : Yes" else: print " USB : No" print "" dbg.enter()
# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # from cclib import CCDebugger, hexdump import sys # Open debugger try: dbg = CCDebugger("/dev/ttyACM0") except Exception as e: print "ERROR: %s" % str(e) sys.exit(1) # Get info print "\nChip information:" print " Chip ID : 0x%04x" % dbg.chipID print " Flash size : %i Kb" % dbg.chipInfo["flash"] print " SRAM size : %i Kb" % dbg.chipInfo["sram"] if dbg.chipInfo["usb"]: print " USB : Yes" else: print " USB : No" print ""
# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # from cclib import CCDebugger, hexdump, renderDebugStatus, renderDebugConfig import sys # Open debugger try: dbg = CCDebugger("/dev/ttyACM0") except Exception as e: print "ERROR: %s" % str(e) sys.exit(1) # Get info print "\nChip information:" print " Chip ID : 0x%04x" % dbg.chipID print " Flash size : %i Kb" % dbg.chipInfo['flash'] print " SRAM size : %i Kb" % dbg.chipInfo['sram'] if dbg.chipInfo['usb']: print " USB : Yes" else: print " USB : No" # Get device information from the read-only section
# # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # from cclib import CCDebugger, CCHEXFile import sys # Wait for filename if len(sys.argv) < 2: print "ERROR: Please specify a filename to dump the FLASH memory to!" sys.exit(1) # Open debugger try: dbg = CCDebugger("/dev/ttyACM0") except Exception as e: print "ERROR: %s" % str(e) sys.exit(1) # Get info print "\nChip information:" print " Chip ID : 0x%04x" % dbg.chipID print " Flash size : %i Kb" % dbg.chipInfo['flash'] print " SRAM size : %i Kb" % dbg.chipInfo['sram'] if dbg.chipInfo['usb']: print " USB : Yes" else: print " USB : No" # Get serial number
# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # from cclib import CCDebugger, hexdump, renderDebugStatus, renderDebugConfig import sys # Open debugger try: dbg = CCDebugger("/dev/tty.usbmodem12341") except Exception as e: print "ERROR: %s" % str(e) sys.exit(1) # Get info print "\nChip information:" print " Chip ID : 0x%04x" % dbg.chipID print " Flash size : %i Kb" % dbg.chipInfo['flash'] print " SRAM size : %i Kb" % dbg.chipInfo['sram'] if dbg.chipInfo['usb']: print " USB : Yes" else: print " USB : No" # Get device information from the read-only section
usage() sys.exit(2) #get filename filename = "".join(args) #there is no need to do a page erase #when we do a full erase... do_page_erase = True if (full_erase): do_page_erase = False #open debugger try: dbg = CCDebugger(tty) except Exception as e: print "ERROR: %s" % str(e) sys.exit(1) print "> using file " + filename # Get info print "> Chip information:" print " Chip ID : 0x%04x" % dbg.chipID print " Flash size : %3i Kb" % dbg.chipInfo['flash'] print " SRAM size : %3i Kb" % dbg.chipInfo['sram'] print "" # Parse the HEX file hexFile = CCHEXFile(filename)