Skip to content
Permalink
Browse files

scripts: openocd: use hex file for flash command

Use hex file for flash command, instead of elf file. This allows to
flash signed firmware, which is not available in elf format, by
specifying --hex-file command line argument.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
  • Loading branch information...
mniestroj authored and carlescufi committed Jul 27, 2019
1 parent 6778468 commit b08adcdd7e7f9d8eef5b99f9e02e046d3d52c366
Showing with 3 additions and 2 deletions.
  1. +3 −2 scripts/west_commands/runners/openocd.py
@@ -34,6 +34,7 @@ def __init__(self, cfg,
if cfg.openocd_search is not None:
search_args = ['-s', cfg.openocd_search]
self.openocd_cmd = [cfg.openocd] + search_args
self.hex_name = cfg.hex_file
self.elf_name = cfg.elf_file
self.load_cmd = load_cmd
self.verify_cmd = verify_cmd
@@ -114,9 +115,9 @@ def do_flash(self, **kwargs):
'-c', 'targets'] +
pre_cmd +
['-c', 'reset halt',
'-c', self.load_cmd + ' ' + self.elf_name,
'-c', self.load_cmd + ' ' + self.hex_name,
'-c', 'reset halt',
'-c', self.verify_cmd + ' ' + self.elf_name] +
'-c', self.verify_cmd + ' ' + self.hex_name] +
post_cmd +
['-c', 'reset run',
'-c', 'shutdown'])

0 comments on commit b08adcd

Please sign in to comment.
You can’t perform that action at this time.