scripts: runner: dfu-util: add --dfuse-modifiers option

This gives callers finer-grained control over the flash. For example,
giving --dfuse-modifiers=force:mass-erase allows a chip-erase rather
than just erasing the sectors which need to be overwritten with the image.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
This commit is contained in:
Marti Bolivar 2017-12-14 16:55:45 -05:00 committed by Anas Nashif
commit 1645d372d2

View file

@ -57,6 +57,11 @@ class DfuUtilBinaryRunner(ZephyrBinaryRunner):
parser.add_argument("--dfuse", default=False, action='store_true',
help='''set if target is a DfuSe device;
implies --dt-flash.''')
parser.add_argument("--dfuse-modifiers", default='leave',
help='''colon-separated list of DfuSe modifiers
(default is "leave", which starts execution
immediately); --dfuse must also be given for this
option to take effect.''')
parser.add_argument('--dfu-util', default='dfu-util',
help='dfu-util executable; defaults to "dfu-util"')
@ -69,7 +74,7 @@ class DfuUtilBinaryRunner(ZephyrBinaryRunner):
args.dt_flash = True # --dfuse implies --dt-flash.
build_conf = BuildConfiguration(os.getcwd())
dcfg = DfuSeConfig(address=cls.get_flash_address(args, build_conf),
options="leave")
options=args.dfuse_modifiers)
else:
dcfg = None