flash.py 885 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (c) 2018 Open Source Foundries Limited.
  2. # Copyright 2019 Foundries.io
  3. # Copyright (c) 2020 Nordic Semiconductor ASA
  4. #
  5. # SPDX-License-Identifier: Apache-2.0
  6. '''west "flash" command'''
  7. from west.commands import WestCommand
  8. from run_common import add_parser_common, do_run_common
  9. class Flash(WestCommand):
  10. def __init__(self):
  11. super(Flash, self).__init__(
  12. 'flash',
  13. # Keep this in sync with the string in west-commands.yml.
  14. 'flash and run a binary on a board',
  15. "Permanently reprogram a board's flash with a new binary.",
  16. accepts_unknown_args=True)
  17. self.runner_key = 'flash-runner' # in runners.yaml
  18. def do_add_parser(self, parser_adder):
  19. return add_parser_common(self, parser_adder)
  20. def do_run(self, my_args, runner_args):
  21. do_run_common(self, my_args, runner_args)