Commit 1645d372 authored by Martí Bolívar's avatar Martí Bolívar Committed by Anas Nashif
Browse files

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: default avatarMarti Bolivar <marti@opensourcefoundries.com>
parent 3ebc2e46
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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