Example #1
0
    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)
Example #2
0
#
# 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 ""