stm32_mem.py: Allow to set start address.
This commit is contained in:
parent
7cc9ee9d7a
commit
2b2b6d8f31
|
@ -135,6 +135,7 @@ if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("progfile", help="Binary file to program")
|
parser.add_argument("progfile", help="Binary file to program")
|
||||||
parser.add_argument("-s", "--serial_target", help="Match Serial Number")
|
parser.add_argument("-s", "--serial_target", help="Match Serial Number")
|
||||||
|
parser.add_argument("-a", "--address", help="Start address for firmware")
|
||||||
parser.add_argument("-m", "--manifest", help="Start application, if in DFU mode", action='store_true')
|
parser.add_argument("-m", "--manifest", help="Start application, if in DFU mode", action='store_true')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
dfudev = stm32_scan(args)
|
dfudev = stm32_scan(args)
|
||||||
|
@ -166,6 +167,9 @@ if __name__ == "__main__":
|
||||||
bin = file.read()
|
bin = file.read()
|
||||||
|
|
||||||
product = dfudev.handle.getString(dfudev.dev.iProduct, 64)
|
product = dfudev.handle.getString(dfudev.dev.iProduct, 64)
|
||||||
|
if args.address :
|
||||||
|
start = int(args.address, 0)
|
||||||
|
else :
|
||||||
if "F4" in product:
|
if "F4" in product:
|
||||||
start = 0x8004000
|
start = 0x8004000
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue