msp430-jtag.py doesn't properly handle uploading starting at
address 0. If you specify "-u 0 -s <whatever>", it just
ignores the upload request. Here's a patch that fixes it.
--
Grant Edwards
[email protected]
--- msp430-jtag.py-orig 2007-10-02 13:42:29.000000000 -0500
+++ msp430-jtag.py 2007-10-02 13:44:44.000000000 -0500
@@ -446,56 +446,56 @@
jtagobj.actionProgram,
)
filename = args[0]
else: #number of args is
wrong
sys.stderr.write("\nUnsuitable number of arguments\n")
usage()
sys.exit(2)
if DEBUG: #debug infos
sys.stderr.write("Debug is level set to %d\n" % DEBUG)
sys.stderr.write("Python version: %s\n" % sys.version)
#~ sys.stderr.write("JTAG backend: %s\n" % jtag.backend)
#sanity check of options
if goaddr and reset:
if not quiet:
sys.stderr.write("Warning: option --reset ignored as --go is
specified!\n")
reset = 0
- if startaddr and reset:
+ if (startaddr is not None) and reset:
if not quiet:
sys.stderr.write("Warning: option --reset ignored as --upload is
specified!\n")
reset = 0
- if startaddr and wait:
+ if (startaddr is not None) and wait:
if not quiet:
sys.stderr.write("Warning: option --wait ignored as --upload is
specified!\n")
wait = 0
#upload ranges and address+size can not be mixed
- if uploadlist and startaddr:
+ if uploadlist and (startaddr is not None):
sys.stderr.write("--upload: Either specify ranges (multiple --upload
allowed) or one --upload and one --size\n")
sys.exit(2)
#backwards compatibility for old parameter format
- if not uploadlist and startaddr:
+ if not uploadlist and (startaddr is not None):
uploadlist.append((startaddr, startaddr+size-1))
#prepare data to download
jtagobj.data = memory.Memory() #prepare downloaded
data
if filetype is not None: #if the filetype is
given...
if filename is None:
raise ValueError("Filetype but no filename specified")
if filename == '-': #get data from stdin
file = sys.stdin
else:
file = open(filename,"rb") #or from a file
if filetype == 0: #select load function
jtagobj.data.loadIHex(file) #intel hex
elif filetype == 1:
jtagobj.data.loadTIText(file) #TI's format
elif filetype == 2:
jtagobj.data.loadELF(file) #ELF format
else:
raise ValueError("Illegal filetype specified")
else: #no filetype given...