From cd402b6833bc210b002ed75d0e2d0d5e052bb4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 28 Jun 2019 10:24:29 +0200 Subject: [PATCH] [scripts] Fix elf2dfu: avoid removing non-existing file --- scripts/device/elf2dfu.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/device/elf2dfu.py b/scripts/device/elf2dfu.py index f00dd4e63..7dfa0ac39 100644 --- a/scripts/device/elf2dfu.py +++ b/scripts/device/elf2dfu.py @@ -54,14 +54,13 @@ def elf2dfu(elf_file, usb_vid_pid, dfu_file, verbose): external_block = {'name': "external", 'sections': loadable_sections(elf_file, external_address_prefix)} internal_block = {'name': "internal", 'sections': [s for s in loadable_sections(elf_file) if s not in external_block['sections']]} blocks = [external_block, internal_block] + blocks = [b for b in blocks if b['sections']] if verbose: for b in blocks: print(b['name']) print_sections(b['sections']) targets = [] for b in blocks: - if (not b['sections']): - continue name = b['name'] subprocess.call(["arm-none-eabi-objcopy", "-O", "binary"]+[item for sublist in [["-j", s['name']] for s in b['sections']] for item in sublist]+[elf_file, bin_file(b)]) address = min([s['lma'] for s in b['sections']])